From 15a50f3d7cec1886cbbc6fa764d2aa1baf709333 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 8 Mar 2026 18:10:57 -0400 Subject: [PATCH] =?UTF-8?q?Fix:=20battlefield=20popup=20=E2=80=94=20Contro?= =?UTF-8?q?l=20wrapper=20between=20CanvasLayer=20and=20popup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CenterContainer/ScrollContainer require a proper Control parent to compute sizes. Adding CardDetailPopup directly to a CanvasLayer broke the nested container layout chain, causing zero-height Panel (invisible content despite the grey overlay showing correctly). Fix: spawn a dedicated CanvasLayer (layer 20, above HUD at layer 10) containing a full-rect Control anchor, then parent the popup to that Control. This restores proper anchor→Control→Container sizing. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/scenes/game/game_screen.gd | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index 1fc0389..d31d5ba 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -161,9 +161,16 @@ func _ready() -> void: get_tree().change_scene_to_file("res://scenes/main/MainScreen.tscn")) _hold_timer.timeout.connect(_on_hold_timer_fired) - # Card detail popup (shared overlay — reused across multiple unit clicks). + # Card detail popup — needs a Control parent (not CanvasLayer directly) for + # CenterContainer/ScrollContainer layout to work, and its own layer above HUD. + var _popup_layer := CanvasLayer.new() + _popup_layer.layer = 20 + add_child(_popup_layer) + var _popup_anchor := Control.new() + _popup_anchor.set_anchors_preset(Control.PRESET_FULL_RECT) + _popup_layer.add_child(_popup_anchor) _card_detail_popup = _CARD_DETAIL_POPUP_SCENE.instantiate() - _hud.add_child(_card_detail_popup) + _popup_anchor.add_child(_card_detail_popup) _card_detail_popup.hide() Game.state_updated.connect(_on_state_updated)