Refactor gameplay menus into owned scenes

This commit is contained in:
Loïc Wisniewski 2026-08-31 02:18:08 +02:00
commit a17fe88197
50 changed files with 3449 additions and 3619 deletions

View file

@ -105,7 +105,7 @@ func _process(delta: float) -> bool:
# --- D. locked state in the crafter UI -------------------------
controller.craft_building_id = crafter_id
controller._refresh_craft_status()
if controller.craft_vessel_buttons[FLEET_UI_INDEX].enabled:
if controller.craft_menu.vessel_buttons[FLEET_UI_INDEX].enabled:
return _fail("a locked carrier shows enabled in the crafter menu")
stage = 1
@ -126,8 +126,8 @@ func _process(delta: float) -> bool:
# --- D. unlocked state in the crafter UI ------------------------
controller._refresh_craft_status()
var craft_button: IconButton = controller.craft_vessel_buttons[FLEET_UI_INDEX]
var craft_label: Label = controller.craft_vessel_labels[FLEET_UI_INDEX]
var craft_button: IconButton = controller.craft_menu.vessel_buttons[FLEET_UI_INDEX]
var craft_label: Label = controller.craft_menu.vessel_labels[FLEET_UI_INDEX]
if not craft_button.enabled:
return _fail("an unlocked carrier still shows disabled in the crafter menu")
if craft_button.icon != definition.icon or craft_button.glow_color != definition.glow_color:
@ -148,8 +148,8 @@ func _process(delta: float) -> bool:
# --- D. hangar display -------------------------------------------
controller._refresh_hangar()
var available_slot: IconButton = controller.hangar_available_slots[FLEET_UI_INDEX]
var available_label: Label = controller.hangar_available_labels[FLEET_UI_INDEX]
var available_slot: IconButton = controller.hangar_menu.available_slots[FLEET_UI_INDEX]
var available_label: Label = controller.hangar_menu.available_labels[FLEET_UI_INDEX]
if available_slot.icon != definition.icon or available_slot.glow_color != definition.glow_color:
return _fail("hangar carrier slot does not match its definition's icon/colour")
var expected_available: String = "%s\n1 available" % definition.display_name
@ -177,8 +177,8 @@ func _process(delta: float) -> bool:
# --- D. ship lab display -------------------------------------------
controller.lab_vessel = GameState.VESSEL_CARRIER
controller._refresh_lab()
var lab_button: IconButton = controller.lab_vessel_buttons[LAB_UI_INDEX]
var lab_label: Label = controller.lab_vessel_labels[LAB_UI_INDEX]
var lab_button: IconButton = controller.lab_menu.vessel_buttons[LAB_UI_INDEX]
var lab_label: Label = controller.lab_menu.vessel_labels[LAB_UI_INDEX]
if lab_button.icon != definition.icon or lab_button.glow_color != definition.glow_color:
return _fail("ship lab carrier slot does not match its definition's icon/colour")
if lab_label.text != definition.display_name: