Refine context actions and preserve fleet landings

This commit is contained in:
Loïc Wisniewski 2026-08-14 23:15:12 +02:00
commit 663648d949
20 changed files with 197 additions and 103 deletions

View file

@ -0,0 +1,37 @@
extends Node
# Visual-only phone preview for the top-level context controls. It composes a
# mothership action set with a landing action so the horizontal foldout and
# the independent Transfer shortcut can be inspected in one screenshot.
func _ready() -> void:
GameState.buildings.clear()
GameState.extractors.clear()
var main: Node2D = load("res://Main.tscn").instantiate()
add_child(main)
main.get_node("AsteroidField").set_process(false)
main.get_node("EnemySpawner").set_process(false)
main.get_node("LandingController").set_process(false)
var building: Node2D = load("res://Building.tscn").instantiate()
building.definition_id = GameState.BUILDING_MOTHERSHIP
building.position = Vector2(0, 420)
main.add_child(building)
var controller: Node2D = main.get_node("BuildController")
controller.set_process(false)
controller.current_building = building
var planet: Node2D = Node2D.new()
main.add_child(planet)
controller.current_landing_planet = planet
controller.building_action_button.icon = int(building.definition.action_icon)
controller.transfer_button.visible = controller._has_transfer_context()
controller.action_button.visible = true
controller.action_button.icon = IconButton.Icon.ACTION_MENU
controller.context_actions_expanded = true
controller._layout_context_buttons()
var label: Label = main.get_node("UI/PlanetNameLabel")
label.text = "PLANET ACTIONS"
label.visible = true