chore(client): gdformat visual_capture + visual_scenarios

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-24 22:54:51 +02:00
co-authored by Claude Opus 4.7
parent 6bb21db2cb
commit c3bcf09c72
2 changed files with 15 additions and 5 deletions
+14 -5
View File
@@ -134,7 +134,9 @@ func _run(): # gdlint:disable=max-returns
push_error("visual_capture: no snapshot after %d frames" % waited)
quit(1)
return
print("visual_capture: first snapshot tick=%d (%d frames)" % [game_state.current_tick, waited])
print(
"visual_capture: first snapshot tick=%d (%d frames)" % [game_state.current_tick, waited]
)
if not _scenario.is_empty():
await _run_scenario(main_node)
@@ -194,10 +196,17 @@ func _run_scenario(_main_node: Node) -> void:
push_error("visual_capture: Protocol.decode_snapshot failed for %s" % abs_path)
quit(1)
return
print("visual_capture: replaying %s (%d bytes, tick=%s, %d tiles)" % [
replay_path, replay_bytes.size(),
str(replay_data.get("tick", "?")),
replay_data.get("visible_tiles", []).size()])
print(
(
"visual_capture: replaying %s (%d bytes, tick=%s, %d tiles)"
% [
replay_path,
replay_bytes.size(),
str(replay_data.get("tick", "?")),
replay_data.get("visible_tiles", []).size()
]
)
)
var game_state := root.get_node("/root/GameState")
var fog_state := root.get_node("/root/FogState")
game_state.apply_snapshot(replay_data)
+1
View File
@@ -8,6 +8,7 @@ extends RefCounted
## compile-time identifiers in -s mode. All methods receive tree_root and
## look up autoloads via get_node("/root/...").
## Apply scenario-specific setup before tick advancement.
## Returns true if the scenario is recognized, false otherwise.
func apply_setup(scenario_name: String, tree_root: Node) -> bool: