forked from noxious/client
refactoring pointer events and input handling improvements
This commit is contained in:
@ -12,14 +12,8 @@ const currentMap = ref<Map | null>(null)
|
||||
const active = ref(false)
|
||||
const tool = ref('move')
|
||||
const drawMode = ref('tile')
|
||||
const eraserMode = ref('tile')
|
||||
const selectedTile = ref('')
|
||||
const selectedMapObject = ref<MapObject | null>(null)
|
||||
const isTileListModalShown = ref(false)
|
||||
const isMapObjectListModalShown = ref(false)
|
||||
const isMapListModalShown = ref(false)
|
||||
const isCreateMapModalShown = ref(false)
|
||||
const isSettingsModalShown = ref(false)
|
||||
const shouldClearTiles = ref(false)
|
||||
const teleportSettings = ref<TeleportSettings>({
|
||||
toMapId: '',
|
||||
@ -59,10 +53,6 @@ export function useMapEditorComposable() {
|
||||
drawMode.value = mode
|
||||
}
|
||||
|
||||
const setEraserMode = (mode: string) => {
|
||||
eraserMode.value = mode
|
||||
}
|
||||
|
||||
const setSelectedTile = (tile: string) => {
|
||||
selectedTile.value = tile
|
||||
}
|
||||
@ -71,19 +61,6 @@ export function useMapEditorComposable() {
|
||||
selectedMapObject.value = object
|
||||
}
|
||||
|
||||
const toggleSettingsModal = () => {
|
||||
isSettingsModalShown.value = !isSettingsModalShown.value
|
||||
}
|
||||
|
||||
const toggleMapListModal = () => {
|
||||
isMapListModalShown.value = !isMapListModalShown.value
|
||||
isCreateMapModalShown.value = false
|
||||
}
|
||||
|
||||
const toggleCreateMapModal = () => {
|
||||
isCreateMapModalShown.value = !isCreateMapModalShown.value
|
||||
}
|
||||
|
||||
const setTeleportSettings = (settings: TeleportSettings) => {
|
||||
teleportSettings.value = settings
|
||||
}
|
||||
@ -101,11 +78,6 @@ export function useMapEditorComposable() {
|
||||
drawMode.value = 'tile'
|
||||
selectedTile.value = ''
|
||||
selectedMapObject.value = null
|
||||
isTileListModalShown.value = false
|
||||
isMapObjectListModalShown.value = false
|
||||
isSettingsModalShown.value = false
|
||||
isMapListModalShown.value = false
|
||||
isCreateMapModalShown.value = false
|
||||
shouldClearTiles.value = false
|
||||
}
|
||||
|
||||
@ -115,14 +87,8 @@ export function useMapEditorComposable() {
|
||||
active,
|
||||
tool,
|
||||
drawMode,
|
||||
eraserMode,
|
||||
selectedTile,
|
||||
selectedMapObject,
|
||||
isTileListModalShown,
|
||||
isMapObjectListModalShown,
|
||||
isMapListModalShown,
|
||||
isCreateMapModalShown,
|
||||
isSettingsModalShown,
|
||||
shouldClearTiles,
|
||||
teleportSettings,
|
||||
|
||||
@ -133,12 +99,8 @@ export function useMapEditorComposable() {
|
||||
toggleActive,
|
||||
setTool,
|
||||
setDrawMode,
|
||||
setEraserMode,
|
||||
setSelectedTile,
|
||||
setSelectedMapObject,
|
||||
toggleSettingsModal,
|
||||
toggleMapListModal,
|
||||
toggleCreateMapModal,
|
||||
setTeleportSettings,
|
||||
triggerClearTiles,
|
||||
resetClearTilesFlag,
|
||||
|
Reference in New Issue
Block a user