Skip to content

fix: route selection events to game.eventBus instead of bridge.eventBus#1222

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-unit-selection-ArDN2
Feb 2, 2026
Merged

fix: route selection events to game.eventBus instead of bridge.eventBus#1222
braedonsaunders merged 1 commit into
mainfrom
claude/fix-unit-selection-ArDN2

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

The InputManager was emitting selection events (selection:clickScreen, selection:boxScreen) to WorkerBridge's EventBus, but SelectionSystem listens on Game's EventBus. These are separate instances created independently, so selection events never reached the SelectionSystem.

Changes:

  • useGameInput now uses gameRef.current?.eventBus for InputManager
  • Added isGameInitialized prop to trigger dependency update when game is ready (refs don't trigger re-renders)
  • WebGPUGameCanvas passes isWorkerInitialized to useGameInput

https://claude.ai/code/session_01BmdZYCrmAFPEq52NqmaXJ9

The InputManager was emitting selection events (selection:clickScreen,
selection:boxScreen) to WorkerBridge's EventBus, but SelectionSystem
listens on Game's EventBus. These are separate instances created
independently, so selection events never reached the SelectionSystem.

Changes:
- useGameInput now uses gameRef.current?.eventBus for InputManager
- Added isGameInitialized prop to trigger dependency update when game
  is ready (refs don't trigger re-renders)
- WebGPUGameCanvas passes isWorkerInitialized to useGameInput

https://claude.ai/code/session_01BmdZYCrmAFPEq52NqmaXJ9
@braedonsaunders braedonsaunders merged commit ea3677a into main Feb 2, 2026
3 of 4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-unit-selection-ArDN2 branch February 2, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants