Split objective panel progress and risk

This commit is contained in:
2026-06-18 13:27:55 +09:00
parent f15caf49e7
commit 0bd84d50bc
8 changed files with 84 additions and 26 deletions

View File

@@ -15,7 +15,7 @@ func _init() -> void:
_check_contains(
failures,
"001 briefing progress",
_progress_text("res://data/scenarios/001_yellow_turbans.json", true),
_defeat_text("res://data/scenarios/001_yellow_turbans.json"),
"Allies remaining"
)
_check_contains(
@@ -39,7 +39,7 @@ func _init() -> void:
_check_contains(
failures,
"007 protected-unit risk progress",
_progress_text("res://data/scenarios/007_xian_emperor_escort.json", true),
_defeat_text("res://data/scenarios/007_xian_emperor_escort.json"),
"Imperial Envoy safe"
)
_check_contains(
@@ -66,6 +66,13 @@ func _progress_text(path: String, include_defeat_risks: bool) -> String:
return state.get_objective_progress_text(include_defeat_risks)
func _defeat_text(path: String) -> String:
var state = BattleStateScript.new()
if not state.load_battle(path):
return "<load failed: %s>" % path
return state.get_defeat_progress_text()
func _check_contains(failures: Array[String], label: String, text: String, expected: String) -> void:
if text.contains(expected):
return