Split objective panel progress and risk
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user