Add game UI panels, keyboard shortcuts, docs narrative overhaul, and unified dev script
- Add MiniStarMap, NpcMarketPanel, ShipStatusPanel, useKeyboardShortcuts - Add progress bars for approach/mining operations and cargo fill indicator - Rewrite docs from spreadsheet-first to exploration-first open-world RPG - Replace dev:db + dev:standalone with unified dev script (scripts/dev.sh) - Add Vite chunk splitting for three.js and spacetimedb - Fix displayName dependency in useSpacetimeConnection - Remove stale usePlayerSession.ts - Add AGENTS.md files across all packages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import type { DbConnection } from "../module_bindings";
|
||||
import { createSpacetimeConnection, type ConnectionStatus, type IdentityLike } from "./client";
|
||||
|
||||
@@ -22,10 +22,13 @@ export function useSpacetimeConnection(displayName: string) {
|
||||
[],
|
||||
);
|
||||
|
||||
const displayNameRef = useRef(displayName);
|
||||
displayNameRef.current = displayName;
|
||||
|
||||
useEffect(() => {
|
||||
const conn = createSpacetimeConnection({
|
||||
...config,
|
||||
displayName,
|
||||
displayName: displayNameRef.current,
|
||||
onStatus: (nextStatus, nextMessage) => {
|
||||
setStatus(nextStatus);
|
||||
setMessage(nextMessage);
|
||||
@@ -45,7 +48,7 @@ export function useSpacetimeConnection(displayName: string) {
|
||||
window.clearInterval(refresh);
|
||||
conn?.disconnect?.();
|
||||
};
|
||||
}, [config, displayName]);
|
||||
}, [config]);
|
||||
|
||||
return {
|
||||
connection,
|
||||
|
||||
Reference in New Issue
Block a user