Skip to content

Fixes #376: End-turn buttons double-advancing turns in Observer Mode - #1001

Merged
ajhalme merged 1 commit into
C7-Game:Developmentfrom
Billytifft:billy/observer-enter-double-turn
Oct 3, 2026
Merged

ajhalme merged 1 commit into
C7-Game:Developmentfrom
Billytifft:billy/observer-enter-double-turn

Conversation

@Billytifft

Copy link
Copy Markdown
Contributor

What was wrong

In Observer Mode, pressing Enter would often advance the turn twice.
Enter (and Space) are bound to the end_turn input action, which calls
OnPlayerEndTurn. But the two end-turn TextureButtons in the lower-right
info box were keyboard-focusable, so when either had focus Godot's
ui_accept fired them too, emitting BlinkyEndTurnButtonPressed ->
OnPlayerEndTurn a second time. NumPad Enter advanced only once because
it is not bound to end_turn, matching the reported behavior.

How it was fixed

Set FocusMode = FocusModeEnum.None on nextTurnButton and
boxRightRectangleButton in LowerRightInfoBox.cs, so Enter/Space no
longer activate them via ui_accept. Mouse clicks still work. This uses
the same pattern already established in ConsoleButton.cs.

How it was tested

Verified manually in Godot with Observer Mode (Cmd+Shift+Alt+O, fast
forward set to 0):

  • Click the end-turn button once, then press Enter repeatedly - exactly
    one turn per press (was two before the fix).
  • Same result with Space and NumPad Enter.
  • Clicking the invisible box area (boxRightRectangleButton) then Enter
    advances exactly one turn.
  • Normal (non-observer) play regression: end-turn button clicks still
    work and arrow-key unit movement is unaffected.

Build: 0 errors. dotnet format ... --verify-no-changes: clean.
Tests: 74/74 passed.

Fixes #376

Comment thread C7/UIElements/GameStatus/LowerRightInfoBox.cs
@Billytifft
Billytifft force-pushed the billy/observer-enter-double-turn branch 2 times, most recently from 9a1ee48 to 72c94f1 Compare September 30, 2026 15:48
@ajhalme

ajhalme commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

LGTM

@ajhalme
ajhalme merged commit 34a16e2 into C7-Game:Development Oct 3, 2026
3 checks passed
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.

Observer Mode - "Enter" causes turns to advance twice

2 participants