1
0
forked from noxious/client

refactoring pointer events and input handling improvements

This commit is contained in:
2025-01-26 19:07:27 -06:00
parent 791830fd6f
commit 9618e07bc6
11 changed files with 123 additions and 158 deletions

View File

@ -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,