cfg image-strip

This commit is contained in:
Alexander Drozdov
2020-07-25 13:02:17 +03:00
parent e157189cd0
commit 793546ebd8
5 changed files with 31 additions and 4 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

+17 -1
View File
@@ -54,7 +54,7 @@ type WidgetWellKnownFlag =
'hide-on-blur(close)'
export const defaultConfig: Config = {
configVersion: 2,
configVersion: 3,
priceCheckKey: 'D',
priceCheckKeyHold: 'Ctrl',
priceCheckLocked: 'Ctrl + Alt + D',
@@ -203,6 +203,22 @@ export const defaultConfig: Config = {
{ id: 5, text: '"Map Device" "Rarity: Normal"' },
{ id: 6, text: 'Tane Laboratory' }
]
},
{
wmId: 6,
wmType: 'image-strip',
wmTitle: 'Cheat sheets',
wmWants: 'hide',
wmZorder: 6,
wmFlags: ['invisible-on-blur'],
anchor: {
pos: 'tc',
x: 50,
y: 10
},
images: [
{ url: 'syndicate.jpg' }
]
}
]
}
+9 -1
View File
@@ -60,7 +60,15 @@ export const config = (() => {
}))
}
}
config.set('widgets', widgets)
if (config.configVersion < 3) {
config.widgets.push({
...defaultConfig.widgets.find(w => w.wmType === 'image-strip')!,
wmId: Math.max(0, ...config.widgets.map(_ => _.wmId)) + 1,
wmZorder: null
})
config.configVersion = 3
}
store.store = config
+3
View File
@@ -143,6 +143,9 @@ export default {
if (this.moveHandles === 'corners') {
return ['tl', 'tr', 'br', 'bl']
}
if (this.moveHandles === 'top-bottom') {
return ['tl', 'tc', 'tr', 'br', 'bc', 'bl']
}
return []
}
},
+2 -2
View File
@@ -1,5 +1,5 @@
<template>
<widget :config="config" v-slot="{ isEditing, isMoving }">
<widget :config="config" v-slot="{ isEditing, isMoving }" move-handles="top-bottom">
<div class="widget-default-style p-1" style="min-width: 5rem;">
<template>
<div v-if="!isEditing" class="text-gray-100 m-1 leading-4 text-center">{{ config.wmTitle || 'Untitled' }}</div>
@@ -55,7 +55,7 @@ export default {
y: 10
})
this.$set(this.config, 'images', [{
url: 'syndicate.png'
url: 'syndicate.jpg'
}])
this.wm.show(this.config.wmId)
}