Commit Graph

16 Commits

Author SHA1 Message Date
Zihao Xu
ce64c6b048 fix(web): decouple manual pause state from system pause behavior (#37)
The pause indicator was showing 'paused' while the game was still running
because isManualPaused was being modified by both user actions (clicking
pause button) and system actions (opening menu).

Changes:
- systemStore: pause()/resume() no longer modify isManualPaused, only
  togglePause() does (with optimistic update + rollback on failure)
- useGameControl: consolidate 3 overlapping watches into 1 clean watch
  that only handles menu open/close without polluting manual pause state
- App.vue: explicitly call resumeGame() API when game initializes
2026-01-18 16:59:44 +08:00
bridge
9b294ccba3 fix: game control bug 2026-01-15 08:55:01 +08:00
4thfever
0d34b27fff Feat: Add splash layer (#29)
Add splash layer, support game start, settings, exit
Modify settings layer, add "go back to splash" and "exit"
Add character threshold for history input
Closes #28
2026-01-13 22:00:23 +08:00
bridge
879a3c0d1f refactor frontend (not done) 2026-01-11 22:29:53 +08:00
bridge
f33cfab0d5 refactor frontend (not done) 2026-01-11 22:08:01 +08:00
Zihao Xu
9485b62cfd feat: add loading screen with progress tracking
- Add async initialization with 6 phases: scanning_assets, loading_map,
  initializing_sects, generating_avatars, checking_llm, generating_initial_events
- Add /api/init-status endpoint for frontend polling
- Add /api/control/reinit endpoint for error recovery
- Add LoadingOverlay.vue component with:
  - Progress ring with gradient
  - Phase text in xianxia style (rotating messages for LLM phase)
  - Tips that rotate every 5 seconds
  - Time-based background transparency (fades to 80% over 20s)
  - Backdrop blur effect
  - Error state with retry button
- Preload map and avatars during LLM initialization for smoother UX
- Add comprehensive tests for init status API
2026-01-08 21:12:18 +08:00
Zihao Xu
8631be501b fix: prevent game from auto-starting to avoid stale initialization events
Problem:
When loading a save (e.g., from year 106), events from year 100 would appear.
This happened because the game auto-started on server startup and client
connection, generating initialization events before the user could load a save.

Solution:
1. Backend: Keep game paused on startup even if LLM check passes
2. Backend: Remove auto-resume on first WebSocket connection
3. Frontend: Start with game paused (isManualPaused = true)

Now the user must explicitly click 'resume' to start a new game, or load a
save first. This prevents the race condition where game_loop generates events
with stale world state.
2026-01-08 21:10:05 +08:00
bridge
d55ada7d66 refactor llm config 2025-12-30 22:20:30 +08:00
bridge
ef0ff24783 refactor frontend 2025-12-04 21:33:14 +08:00
bridge
9e1c536c07 fix bug 2025-11-22 20:48:51 +08:00
bridge
d4e0fdacf3 refactor web code 2025-11-22 15:32:46 +08:00
bridge
6ab05edab2 update map 2025-11-21 23:11:35 +08:00
bridge
41d2103ffc refactor web 2025-11-21 01:38:41 +08:00
bridge
5a51b6638d fix bug 2025-11-20 23:55:22 +08:00
bridge
10d571e6bb refactor web 2025-11-20 22:16:27 +08:00
bridge
cdc3322ff0 temp 2025-11-20 01:27:48 +08:00