Connect autoload signals only outside the editor (#149) #150

Merged
liamjd merged 2 commits from 149-game-gd-editor-signals into main 2026-10-10 15:39:15 +01:00
Owner

Closes #149

Moves the GameState.building_placed / building_removed and GameClock.tick connections in common/game.gd inside the existing if not Engine.is_editor_hint(): guard. game.gd is @tool, and in the editor the autoloads are bare Nodes with no signals. The first connect therefore errored, and stopped _ready(), every time the editor opened game.tscn.

Verification

  • --headless --editor --quit: no script errors (was 1).
  • On a live instance of game.tscn, GameState.building_placed, building_removed and GameClock.tick are all still connected to their handlers.
  • GUT suite: 883 passed, 1 pending (the existing #85 placeholder).

Note

Branched from origin/main and independent of #148. The two touch nearby lines of game.gd, so whichever merges second may need a trivial rebase.

🤖 Generated with Claude Code

Closes #149 Moves the `GameState.building_placed` / `building_removed` and `GameClock.tick` connections in `common/game.gd` inside the existing `if not Engine.is_editor_hint():` guard. `game.gd` is `@tool`, and in the editor the autoloads are bare `Node`s with no signals. The first `connect` therefore errored, and stopped `_ready()`, every time the editor opened `game.tscn`. ## Verification - `--headless --editor --quit`: no script errors (was 1). - On a live instance of `game.tscn`, `GameState.building_placed`, `building_removed` and `GameClock.tick` are all still connected to their handlers. - GUT suite: 883 passed, 1 pending (the existing #85 placeholder). ## Note Branched from `origin/main` and independent of #148. The two touch nearby lines of `game.gd`, so whichever merges second may need a trivial rebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
game.gd is @tool, so _ready() also runs when the editor opens game.tscn. The
GameState/GameClock connections sat outside the is_editor_hint() guard, and in
the editor the autoloads are bare Nodes with no signals, so the first one
errored and aborted _ready(). They are game wiring, so they move inside the
guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
liamjd merged commit 1c827dd890 into main 2026-10-10 15:39:15 +01:00
liamjd deleted branch 149-game-gd-editor-signals 2026-10-10 15:39:15 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder!150
No description provided.