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:

View file

@ -105,11 +105,11 @@ horizontal_alignment = 1
[node name="ToolButtons" type="HBoxContainer" parent="Content"]
anchor_right = 1.0
offset_left = 70.0
offset_left = 24.0
offset_top = 896.0
offset_right = -70.0
offset_right = -24.0
offset_bottom = 1012.0
theme_override_constants/separation = 56
theme_override_constants/separation = 52
alignment = 1
[node name="UnlockSkills" type="Control" parent="Content/ToolButtons"]
@ -126,6 +126,13 @@ script = ExtResource("icon_button")
icon = 29
glow_color = Color(1, 0.78, 0.25, 1)
[node name="FreeCosts" type="Control" parent="Content/ToolButtons"]
custom_minimum_size = Vector2(116, 116)
layout_mode = 2
script = ExtResource("icon_button")
icon = 28
glow_color = Color(0.55, 0.75, 1, 1)
[node name="StartWave" type="Control" parent="Content/ToolButtons"]
custom_minimum_size = Vector2(116, 116)
layout_mode = 2
@ -135,15 +142,15 @@ glow_color = Color(1, 0.45, 0.2, 1)
[node name="ToolLabels" type="HBoxContainer" parent="Content"]
anchor_right = 1.0
offset_left = 28.0
offset_left = 24.0
offset_top = 1018.0
offset_right = -28.0
offset_bottom = 1098.0
offset_right = -24.0
offset_bottom = 1114.0
theme_override_constants/separation = 8
alignment = 1
[node name="UnlockLabel" type="Label" parent="Content/ToolLabels"]
custom_minimum_size = Vector2(210, 76)
custom_minimum_size = Vector2(160, 92)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "UNLOCK ALL\nSKILLS"
@ -151,15 +158,23 @@ horizontal_alignment = 1
vertical_alignment = 1
[node name="UnlimitedLabel" type="Label" parent="Content/ToolLabels"]
custom_minimum_size = Vector2(210, 76)
custom_minimum_size = Vector2(160, 92)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "UNLIMITED RESOURCES\nOFF"
text = "UNLIMITED\nRESOURCES\nOFF"
horizontal_alignment = 1
vertical_alignment = 1
[node name="FreeCostsLabel" type="Label" parent="Content/ToolLabels"]
custom_minimum_size = Vector2(160, 92)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "FREE\nCOSTS\nOFF"
horizontal_alignment = 1
vertical_alignment = 1
[node name="WaveLabel" type="Label" parent="Content/ToolLabels"]
custom_minimum_size = Vector2(210, 76)
custom_minimum_size = Vector2(160, 92)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "START ENEMY\nWAVE"