Files
security-game/src/test/smoke_session_shell.gd
T
zwitschi be429cab29
Full build / Import + headless tests (push) Successful in 24s
Full build / Full desktop build + optional release (push) Skipped
Add session shell and close world presentation follow-ups
Session shell
- Startup venue menu (src/game/ui/start_menu.gd): keyboard + mouse, replaces
  the live-shift boot and V as the player-facing venue path (V stays a debug bind).
- Pause overlay on Esc (src/game/ui/pause_overlay.gd): resume, restart shift,
  settings, quit to menu.
- Settings panel (src/game/ui/settings_panel.gd): mouse look sensitivity and
  HUD font scale, persisted via Save into user://settings.json and loaded on boot.
- Shift review "Run another shift" now returns to the venue menu.
- New smoke: src/test/smoke_session_shell.gd (menu -> shift -> pause -> settings
  -> menu), passes headless and windowed.

World and presentation
- Skyline backdrop restored with a transparent asset and an alpha-scissor
  unshaded material; fixes the opaque black slab from the earlier attempt and
  the unimported texture path.
- Steps and landing are a StaticBody3D with per-tread colliders, so the guard
  and NPCs walk up instead of clipping through.
- Marquee Label3D scaled up (72 -> 160) so STEP LINE reads from the sidewalk.
- Focus torus and name tag enlarged for 2-3 m readability.
- Routine traffic despawns after an idle lifetime (NpcAvatar.ephemeral), so the
  16-NPC cap no longer fills with standers; authored events stay for the shift.

Docs and tests
- PLAN.md test/CI section corrected to the custom headless runner and Gitea Actions.
- README controls table, smoke checklist, test count, and status lists refreshed.
- TODO/DONE/MEMORY updated; completed sections moved to DONE.md.
- Headless suite 77 -> 88 passing (settings round-trip, step colliders, skyline
  alpha, session-shell UI behavior, traffic lifetime).
2026-10-31 20:19:22 +01:00

64 lines
1.9 KiB
GDScript

extends SceneTree
## Session-shell smoke: boot the main scene, confirm the venue menu is showing,
## start a Joke Shop shift, open the pause overlay and settings, then return to
## the menu. Exits non-zero on failure.
##
## Usage:
## godot --headless --path . --script res://src/test/smoke_session_shell.gd
## godot --path . --script res://src/test/smoke_session_shell.gd (windowed)
var _frames := 0
var _manager = null
var _main = null
func _initialize() -> void:
var packed: PackedScene = load("res://scenes/main.tscn")
if packed == null:
printerr("cannot load main scene")
quit(1)
return
_main = packed.instantiate()
root.add_child(_main)
print("boot: main scene added")
func _process(_delta: float) -> bool:
_frames += 1
if _frames == 10:
_manager = _main.get_node_or_null("GameManager")
if _manager.start_menu == null or not _manager.start_menu.visible:
printerr("start menu not visible at boot")
quit(1)
return true
print("boot: start menu visible")
_manager._on_venue_selected("joke_shop")
if _frames == 200:
if _manager.npcs.size() == 0:
printerr("no NPCs spawned after shift start")
quit(1)
return true
print("boot: shift running, npcs=%d" % _manager.npcs.size())
_manager._open_pause()
if _frames == 210:
if _manager.pause_overlay == null or not _manager.pause_overlay.visible:
printerr("pause overlay did not open")
quit(1)
return true
print("boot: pause overlay visible")
_manager._open_settings()
if _frames == 220:
if _manager.settings_panel == null or not _manager.settings_panel.visible:
printerr("settings panel did not open")
quit(1)
return true
print("boot: settings visible")
_manager.settings_panel._on_cancel()
_manager._quit_to_menu()
if _frames == 230:
if not _manager.start_menu.visible:
printerr("quit-to-menu did not return to the start menu")
quit(1)
return true
print("SMOKE PASS: menu -> shift -> pause -> settings -> menu")
quit(0)
return true
return false