Gate the R/T debug keys behind OS.is_debug_build() #8

Closed
opened 2026-08-15 15:55:54 +01:00 by liamjd · 1 comment
Owner

TerrainGrid._unhandled_input() handles two development affordances:

  • R rerolls map_seed and regenerates, for eyeballing many seeds quickly.
  • T cycles to the next terrain preset and regenerates.

Both are useful and both currently ship in an exported build. R in particular would let a player destroy their colony's map with a stray keypress.

The cheap fix is an early return at the top of the handler:

if not OS.is_debug_build():
    return

That keeps them in editor and debug builds and strips them from a release export.

While here

These read raw physical keycodes rather than InputMap actions. That is fine for throwaway keys, but R and T are both plausible real bindings later (rotate, build menu), and a raw handler will silently compete with them. The POC's note applies: move to named actions once the game has real, rebindable bindings.

`TerrainGrid._unhandled_input()` handles two development affordances: - **R** rerolls `map_seed` and regenerates, for eyeballing many seeds quickly. - **T** cycles to the next terrain preset and regenerates. Both are useful and both currently ship in an exported build. R in particular would let a player destroy their colony's map with a stray keypress. The cheap fix is an early return at the top of the handler: ```gdscript if not OS.is_debug_build(): return ``` That keeps them in editor and debug builds and strips them from a release export. ## While here These read raw physical keycodes rather than InputMap actions. That is fine for throwaway keys, but R and T are both plausible real bindings later (rotate, build menu), and a raw handler will silently compete with them. The POC's note applies: move to named actions once the game has real, rebindable bindings.
liamjd referenced this issue from a commit 2026-08-16 08:04:08 +01:00
Author
Owner

This was fixed with PR #14

This was fixed with PR #14
Sign in to join this conversation.
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#8
No description provided.