Add a free-costs sandbox tool

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
Loïc Wisniewski 2026-09-04 22:34:36 +02:00
commit 571f01dc31
5 changed files with 136 additions and 18 deletions

View file

@ -4,6 +4,7 @@ signal fleet_add_requested(vessel_type: String)
signal fleet_remove_requested(vessel_type: String)
signal unlock_skills_requested
signal unlimited_resources_requested(enabled: bool)
signal free_costs_requested(enabled: bool)
signal wave_requested
const ICON_BUTTON = preload("res://ui/IconButton.gd")
@ -16,8 +17,10 @@ const DESIGN_SIZE := Vector2(720.0, 1280.0)
@onready var fleet_rows: VBoxContainer = $Content/FleetRows
@onready var unlock_button: IconButton = $Content/ToolButtons/UnlockSkills
@onready var unlimited_button: IconButton = $Content/ToolButtons/UnlimitedResources
@onready var free_costs_button: IconButton = $Content/ToolButtons/FreeCosts
@onready var wave_button: IconButton = $Content/ToolButtons/StartWave
@onready var unlimited_label: Label = $Content/ToolLabels/UnlimitedLabel
@onready var free_costs_label: Label = $Content/ToolLabels/FreeCostsLabel
@onready var status: Label = $Content/StatusLabel
var fleet: Node = null
@ -31,6 +34,8 @@ func _ready() -> void:
unlock_button.pressed.connect(func(): unlock_skills_requested.emit())
unlimited_button.pressed.connect(func():
unlimited_resources_requested.emit(not GameState.dev_unlimited_resources))
free_costs_button.pressed.connect(func():
free_costs_requested.emit(not GameState.dev_free_costs))
wave_button.pressed.connect(func(): wave_requested.emit())
_layout_content()
@ -80,8 +85,11 @@ func refresh() -> void:
(controls.remove as IconButton).enabled = count > 0 and total > 1
unlock_button.highlighted = _all_skills_unlocked()
unlimited_button.highlighted = GameState.dev_unlimited_resources
unlimited_label.text = "UNLIMITED RESOURCES\n%s" \
unlimited_label.text = "UNLIMITED\nRESOURCES\n%s" \
% ("ON" if GameState.dev_unlimited_resources else "OFF")
free_costs_button.highlighted = GameState.dev_free_costs
free_costs_label.text = "FREE\nCOSTS\n%s" \
% ("ON" if GameState.dev_free_costs else "OFF")
func _all_skills_unlocked() -> bool: