diff --git a/src/components/Editor/Editor.svelte b/src/components/Editor/Editor.svelte index 9d2fcd8..b792276 100644 --- a/src/components/Editor/Editor.svelte +++ b/src/components/Editor/Editor.svelte @@ -8,7 +8,10 @@ isToolActivated, currentAI, currentTexture, - currentDoodad + currentDoodad, + + currentNpc + } from '$stores/editor' import type { Script, Tile } from '../..'; import EditorTile from './EditorTile.svelte'; @@ -106,6 +109,19 @@ }); } + if($activatedTool === 'npc' && e.type === 'mousedown') { + store.update((store) => { + const ai = store.levels[$currentLevelNumber].getScriptAt(x, y); + if(ai) { + store.levels[$currentLevelNumber].removeScriptAt(x, y); + } else { + store.levels[$currentLevelNumber].addNpcAt(x, y , $currentNpc) + } + + return store; + }); + } + if($activatedTool === 'doodad' && e.type === 'mousedown') { store.update((store) => { const doodad = store.levels[$currentLevelNumber].getScriptAt(x, y); diff --git a/src/components/Editor/EditorInfoPane.svelte b/src/components/Editor/EditorInfoPane.svelte index cd7b9f6..58b88ff 100644 --- a/src/components/Editor/EditorInfoPane.svelte +++ b/src/components/Editor/EditorInfoPane.svelte @@ -1,10 +1,10 @@ @@ -148,6 +150,15 @@ + + NPC + + + Doodad