Main menu scene #47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #40, which needs a main menu to host the map editor. There is none today -
project.godotboots straight intores://Main.tscn.Scope
MainMenu.tscn+MainMenu.gd- 720x1280 portrait, styled like the existing menus:ui_theme.tres,IconButton,NeonDraw. Reusing thestarfield.gdshaderbackground fromMain.tscngives it the right look for free.get_tree().change_scene_to_file("res://Main.tscn")res://PlanetSetupEditor.tscn; until that ticket lands, keep the button present but disabled with a short "coming soon" state rather than a dead link.get_tree().quit(), hidden whenOS.has_feature("web").project.godot:run/main_scene="res://MainMenu.tscn".Main.tscndepend on having come through the menu. Every existing headless test loadsres://Main.tscndirectly and must keep working untouched.GameState.reset_new_game()(resetting bank/fleet/buildings/extractors/transporters/research/conquest to their initial values) and call it from the Play handler, so returning to the menu and pressing Play again does not inherit the previous run. Keep it in one place - the autoload persists acrosschange_scene_to_file.Acceptance criteria
Main.tscnwith a default fleet and empty buildings.Tests
tests/test_main_menu.gd(bash tests/run_tests.sh menu) covering scene load, the reset call, and the web-conditional Quit button; plus a 720x1280 screenshot of the menu.Repo notes (read before starting)
/storage/emulated/0/GodotProjects/SpaceshipTest.touchon it. Android FUSE does not bump mtime under~/storage/shared, and Godot's import cache will silently keep serving the old version, making a correct fix look like it did nothing.bash tests/run_tests.sh <substring>; full suite with no argument. Tests areSceneTreescripts printingTEST_NAME: PASS/TEST_NAME: FAIL (reason)and callingquit(0|1)- copy the shape oftests/test_gas_bomber_cooldowns.gd.bash tests/screenshot.sh <res://Scene.tscn> <out.png> <frames> 720x1280. Use few frames (~10-20); the software rasterizer is slow.--headlessrenders nothing at all, so it cannot validate visuals.NeonDraw/NeonPiece; do not introduce a different visual idiom.*Definitionresources plus capability component scenes. Do not addif type == "..."branches.FileAccess, nouser://anywhere outside this ticket's explicit scope).GameStateis an in-memory autoload. Do not invent a save system.Implemented and pushed as
a1fb239.MainMenu.tscnis nowproject.godot's entry point: Play / Map Editor (disabled, explains itself with a status message until #48 wires it up) / Quit (hidden in web builds), styled like the rest of the game's menus and reusing the starfield shader for its background.GameState.reset_new_game()resets bank/fleet/buildings/extractors/transporters/research/formation/conquest to defaults; Play calls it before swapping toMain.tscn, so a second playthrough in the same process starts fresh instead of inheriting the previous run's state.New test
tests/test_main_menu.gdcovers the disabled editor button explaining itself, Quit's visibility followingOS.has_feature("web"), and Play genuinely resetting a dirtied GameState before reachingMain.tscn. All existing tests still loadMain.tscndirectly and are unaffected by the entry-point change. Verified visually at 720x1280.#48 needs this as its entry point.