Skip to content

joryirving/windowstead #94: keep controls clickable after hut placement - #96

Merged
joryirving merged 1 commit into
mainfrom
fix/issue-94-build-placement-soft-lock
Apr 24, 2026
Merged

joryirving/windowstead #94: keep controls clickable after hut placement#96
joryirving merged 1 commit into
mainfrom
fix/issue-94-build-placement-soft-lock

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Fixes #94. Closes the build popup when entering, completing, or canceling placement and immediately resyncs the HUD button labels so build/menu controls stay clickable.

@smurf-bot

smurf-bot Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: MiniMax-M2.7@https://api.minimax.io/v1

Review: PR #96 — Fix build placement soft-lock after hut placement

Summary

This PR directly addresses issue #94 by ensuring consistent UI panel visibility and button label synchronization across all build placement state transitions.

Change-by-Change Findings

1. begin_build_placement() (line ~939)

  • Added sidebar_scroll.visible = false to match the existing visibility-hiding pattern for other panels
  • This ensures the sidebar scroll container is also hidden when entering placement mode, matching what queue_structure_at and cancel_build_placement will now do on exit

2. queue_structure_at() (line ~981)

  • Added visibility hiding for sidebar_scroll, menu_actions, management_panels, and settings_panel
  • Added update_menu_button_text() call after clearing pending_build_kind
  • Root cause fixed: The original code was missing the update_menu_button_text() call, which caused button labels to desync from actual click behavior, creating the "unclickable" soft-lock perception
  • The sidebar_scroll visibility fix ensures all panels consistently hide on structure placement

3. cancel_build_placement() (line ~996)

  • Added visibility hiding for all UI panels (consistent with the other two functions)
  • Added update_menu_button_text() call to sync button state after cancellation
  • Added render_all() call (this function was missing it, while queue_structure_at already has it)

Standards Compliance

  • ✅ Minimal, focused change (12 additions, no deletions)
  • ✅ Follows repository GDScript patterns
  • ✅ Consistent pattern applied across all three state-transition functions
  • ✅ Validation command available: GODOT --headless --path . --script res://tests/test_runner.gd

Linked Issue Fit

Acceptance Criteria Status
controls remain clickable after placing a hut ✅ Fixed via update_menu_button_text() in queue_structure_at()
build placement can always be cancelled while active ✅ Fixed via cancel_build_placement() now properly hiding all panels and syncing labels
placing one structure does not soft-lock subsequent input ✅ Fixed via consistent panel visibility handling
repeated placement attempts do not trap the player ✅ Fixed via consistent state reset across all three functions

Root Cause Analysis

The soft-lock occurred because:

  1. queue_structure_at() was not hiding sidebar_scroll (creating UI inconsistency)
  2. queue_structure_at() was not calling update_menu_button_text(), so "Cancel Build" remained after placement completed, but the click handler may have been in an unexpected state
  3. The three state-transition functions had inconsistent visibility patterns

Recommendation

Approve. The fix is targeted, consistent, and addresses the exact issue described. The code is syntactically correct and follows repository conventions.

@joryirving
joryirving merged commit ac5b94b into main Apr 24, 2026
4 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.

bug: build placement can soft-lock controls after placing a hut

2 participants