diff --git a/src/routes/scene/+page.svelte b/src/routes/scene/+page.svelte index 5a875f7..f22a2c9 100644 --- a/src/routes/scene/+page.svelte +++ b/src/routes/scene/+page.svelte @@ -12,6 +12,48 @@ import { commands } from "$lib/bindings"; import DebugBar from "./components/debug-bar.svelte"; import Neko from "./components/neko/neko.svelte"; + import PetMenu from "./components/pet-menu.svelte"; + + function createPetActions(name: string) { + // TODO: replace `name` with full user object, onClicks with proper actions + return [ + { + icon: "👋", + label: `Wave at ${name}`, + onClick: () => { + console.log(`Wave at ${name}`); + }, + }, + { + icon: "💬", + label: `Message ${name}`, + onClick: () => { + console.log(`Message ${name}`); + }, + }, + { + icon: "🔔", + label: `Ping ${name}`, + onClick: () => { + console.log(`Ping ${name}`); + }, + }, + { + icon: "🔎", + label: `Inspect ${name}`, + onClick: () => { + console.log(`Inspect ${name}`); + }, + }, + ]; + } + + function getFriendName(friendId: string) { + return ( + ($appData?.friends ?? []).find((friend) => friend.friend?.id === friendId) + ?.friend?.name || friendId + ); + }
@@ -27,17 +69,32 @@ targetX={$cursorPositionOnScreen.raw.x} targetY={$cursorPositionOnScreen.raw.y} spriteUrl={$activeDollSpriteUrl} - /> + > + {#if $sceneInteractive} + + {/if} + {/if} {#each Object.entries($friendsCursorPositions) as [friendId, position] (friendId)} {#if $friendActiveDollSpriteUrls[friendId]} + {@const friendName = getFriendName(friendId)} + > + {#if $sceneInteractive} + + {/if} + {/if} {/each}
diff --git a/src/routes/scene/components/neko/neko.svelte b/src/routes/scene/components/neko/neko.svelte index 3308c2d..225b623 100644 --- a/src/routes/scene/components/neko/neko.svelte +++ b/src/routes/scene/components/neko/neko.svelte @@ -1,5 +1,6 @@ + +
+ {#each actions as action, index} + {@const position = getButtonPosition(index, actions.length)} + {@const openDelay = index * 35} + {@const closeDelay = (actions.length - 1 - index) * 25} + + + {/each} + + +