Add the planet setup map editor (#48)

PlanetSetupEditor authors PlanetSetup resources: pick a surface
profile (drives the real lunar_surface background, not a blank
sheet), place/move/delete capture points and enemies from a palette
generated straight off EnemyDefinitions.all() (a new enemy definition
shows up with no editor change), pan/pinch-zoom the canvas with the
same touch idiom as GameController, then save to
res://PlanetSetups/<id>.tres via ResourceSaver - reachable now from
the main menu's Map Editor button. The mutation methods
(new_setup/load_setup/add_*/move_*/remove_*/save_setup) are the whole
model and work standalone, which is what lets
tests/test_setup_editor.gd drive placement/move/delete/save/reload
directly without simulating touch input.

Every cross-file reference is a preloaded script const rather than a
bare global class name, matching #42/#44's load-order notes - this
file is instantiated from other scripts' function bodies, never as a
script-mode test entry point itself, so it wasn't at risk the same way
the test files were, but the pattern is kept consistent throughout.

Part of the #40 conquest-mechanic breakdown. This closes out the
breakdown: #41-#48 are now all implemented, tested, and merged.
This commit is contained in:
Loïc Wisniewski 2026-08-15 21:24:28 +02:00
commit df2f252970
12 changed files with 876 additions and 15 deletions

View file

@ -9,10 +9,7 @@ extends Node2D
func _ready() -> void:
play_button.pressed.connect(_on_play_pressed)
editor_button.pressed.connect(_on_editor_pressed)
# #48 wires the real map editor scene up to this button; until then it
# stays visible but explains itself instead of silently doing nothing
# or pointing at a scene that doesn't exist yet.
editor_button.enabled = false
editor_button.enabled = true
quit_button.pressed.connect(_on_quit_pressed)
quit_button.visible = not OS.has_feature("web")