From 372ad8472b5fa0c5cac8ac656ddca95c66f106a8 Mon Sep 17 00:00:00 2001 From: Wind-Explorer Date: Thu, 8 Jan 2026 17:42:31 +0800 Subject: [PATCH] Pet & user info + fake buttons in pet menu --- src/routes/scene/+page.svelte | 8 ++++---- src/routes/scene/components/DesktopPet.svelte | 16 ++++++++++------ src/routes/scene/components/PetMenu.svelte | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/routes/scene/+page.svelte b/src/routes/scene/+page.svelte index 0ae6fd1..68aeb80 100644 --- a/src/routes/scene/+page.svelte +++ b/src/routes/scene/+page.svelte @@ -16,9 +16,9 @@ $: isInteractive = $sceneInteractive; - function getFriendName(userId: string) { + function getFriendById(userId: string) { const friend = $appData?.friends?.find((f) => f.friend.id === userId); - return friend ? friend.friend.name : userId.slice(0, 8) + "..."; + return friend!.friend; } function getFriendDoll(userId: string) { @@ -69,7 +69,7 @@ {#each Object.entries($friendsCursorPositions) as [userId, position]} {@const dollConfig = getFriendDoll(userId)}
- {getFriendName(userId)} + {getFriendById(userId).name}
({position.mapped.x.toFixed(3)}, {position.mapped.y.toFixed( @@ -94,7 +94,7 @@ id={userId} targetX={position.mapped.x * innerWidth} targetY={position.mapped.y * innerHeight} - name={getFriendName(userId)} + user={getFriendById(userId)} {doll} {isInteractive} /> diff --git a/src/routes/scene/components/DesktopPet.svelte b/src/routes/scene/components/DesktopPet.svelte index 27c6ad7..9c25dbd 100644 --- a/src/routes/scene/components/DesktopPet.svelte +++ b/src/routes/scene/components/DesktopPet.svelte @@ -7,11 +7,12 @@ import onekoGif from "../../../assets/oneko/oneko.gif"; import PetMenu from "./PetMenu.svelte"; import type { DollDto } from "../../../types/bindings/DollDto"; + import type { UserBasicDto } from "../../../types/bindings/UserBasicDto"; export let id = ""; export let targetX = 0; export let targetY = 0; - export let name = ""; + export let user: UserBasicDto; export let doll: DollDto | undefined = undefined; export let isInteractive = false; @@ -27,7 +28,10 @@ let isPetMenuOpen = false; // Watch for color changes to regenerate sprite - $: updateSprite(doll?.configuration.colorScheme.body, doll?.configuration.colorScheme.outline); + $: updateSprite( + doll?.configuration.colorScheme.body, + doll?.configuration.colorScheme.outline, + ); $: (isInteractive, (isPetMenuOpen = false)); @@ -87,13 +91,13 @@ > {#if isPetMenuOpen} {/if} @@ -111,9 +115,9 @@ - {name} + {doll?.name}
diff --git a/src/routes/scene/components/PetMenu.svelte b/src/routes/scene/components/PetMenu.svelte index 20668be..99fadae 100644 --- a/src/routes/scene/components/PetMenu.svelte +++ b/src/routes/scene/components/PetMenu.svelte @@ -1,10 +1,23 @@
-

{doll.name}

+
+

{doll.name}

+

From {user.name}

+
+
+ + +
+
+ + +