chore(client): gdformat visual_capture + visual_scenarios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user