Commit 72aa3b1
refactor: extract mode controllers from GameApp (plan 42)
Split game-app.ts (1,532 lines) into four focused files with no
behavior changes:
- loading-controller.ts: owns WorldLoadingState and loading token
machinery (beginLoading, isLoadingTokenActive, applyLoadingProgress,
failLoading, etc.) plus the loading-screen tick UI
- menu-controller.ts: owns MenuState, menu tick, all action dispatch,
and world/server management helpers (syncMenuWorlds, syncSavedServers,
createWorld, deleteWorld, saveServer, deleteServer)
- play-controller.ts: owns chat/inventory/pause state,
firstPersonSwingRemaining, debug-memory helpers, the fixed-step
gameplay tick (updateGame), input routing, HUD build, and overlay text
- game-app.ts: reduced to 719 lines; retains connections, appMode,
timing, settings, joinWorld/joinServer, completeWorldJoinLoading,
registerConnectionEventHandlers, renderFrame, and the main tick
dispatcher
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 4e4465d commit 72aa3b1
5 files changed
Lines changed: 1322 additions & 1033 deletions
File tree
- apps/client/src/app
- plans
0 commit comments