feat(thought): wire client socket, GameScene thought handling, emoji animation, and info panel display

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-08 21:12:00 +00:00
parent b515f7195f
commit daddf2583d
3 changed files with 100 additions and 3 deletions
+2
View File
@@ -17,6 +17,7 @@ export class SocketClient {
onNarrationEvent: ((data: NarrationEvent) => void) | null = null;
onNarrationUpdate: ((data: { id: number; narration: string }) => void) | null = null;
onNarrationHistory: ((data: NarrationEvent[]) => void) | null = null;
onNpcThought: ((data: { entityId: number; text: string; emoji: string }) => void) | null = null;
constructor(url: string) {
this.socket = io(url);
@@ -48,6 +49,7 @@ export class SocketClient {
this.socket.on('narration-event', (data) => this.onNarrationEvent?.(data));
this.socket.on('narration-update', (data) => this.onNarrationUpdate?.(data));
this.socket.on('narration-history', (data) => this.onNarrationHistory?.(data));
this.socket.on('npc-thought', (data) => this.onNpcThought?.(data));
}
get playerId(): string | null { return this._playerId; }