1
0
forked from noxious/client

npm run format, started working on follow player logic, refactor some camera logic

This commit is contained in:
2024-09-22 02:14:32 +02:00
parent 42291b93eb
commit 9b592d6c7c
14 changed files with 101 additions and 111 deletions

View File

@ -68,9 +68,7 @@
<div class="w-px bg-cyan"></div>
<button class="flex justify-center items-center min-w-10 p-0 relative" @click="handleClick('settings')" v-if="zoneEditorStore.zone">
<img class="invert w-5 h-5" src="/assets/icons/zoneEditor/gear.svg" alt="Zone settings" /> <span class="ml-2.5">(Z)</span>
</button>
<button class="flex justify-center items-center min-w-10 p-0 relative" @click="handleClick('settings')" v-if="zoneEditorStore.zone"><img class="invert w-5 h-5" src="/assets/icons/zoneEditor/gear.svg" alt="Zone settings" /> <span class="ml-2.5">(Z)</span></button>
</div>
<div class="flex gap-2.5 ml-auto">
@ -163,14 +161,14 @@ onBeforeUnmount(() => {
})
function handleClick(tool: string) {
if(tool === 'settings') {
if (tool === 'settings') {
zoneEditorStore.toggleSettingsModal()
} else {
zoneEditorStore.setTool(tool)
}
selectPencilOpen.value = tool === 'pencil' ? !selectPencilOpen.value : false;
selectEraserOpen.value = tool === 'eraser' ? !selectEraserOpen.value : false;
selectPencilOpen.value = tool === 'pencil' ? !selectPencilOpen.value : false
selectEraserOpen.value = tool === 'eraser' ? !selectEraserOpen.value : false
}
// Key bindings
@ -180,15 +178,15 @@ function initKeyShortcuts(event: KeyboardEvent) {
if (document.activeElement?.tagName === 'INPUT') return
const keyActions: any = {
'm': 'move',
'p': 'pencil',
'e': 'eraser',
'b': 'paint',
'z': 'settings'
};
m: 'move',
p: 'pencil',
e: 'eraser',
b: 'paint',
z: 'settings'
}
if (keyActions.hasOwnProperty(event.key)) {
handleClick(keyActions[event.key]);
handleClick(keyActions[event.key])
}
}