Show next camp preview in results
This commit is contained in:
@@ -10,6 +10,11 @@ func _init() -> void:
|
||||
push_error("Could not load smoke scenario.")
|
||||
quit(1)
|
||||
return
|
||||
if not scene.campaign_state.load_campaign("res://data/campaign/campaign.json"):
|
||||
push_error("Could not load smoke campaign.")
|
||||
quit(1)
|
||||
return
|
||||
scene.campaign_state.start_new("001_yellow_turbans")
|
||||
scene.campaign_state.gold = 320
|
||||
|
||||
scene.battle_result_summary = {
|
||||
@@ -24,6 +29,7 @@ func _init() -> void:
|
||||
"progression_events": [
|
||||
{"type": "level_up", "name": "Cao Cao", "to_level": 2}
|
||||
],
|
||||
"next_scenario_id": "002_sishui_gate",
|
||||
"next_scenario_title": "Sishui Gate",
|
||||
"choice_applied": true,
|
||||
"choice_label": ""
|
||||
@@ -35,6 +41,11 @@ func _init() -> void:
|
||||
_check_contains(failures, "roster section", result_text, "Joined: Dian Wei")
|
||||
_check_contains(failures, "growth section", result_text, "Cao Cao Lv.2")
|
||||
_check_contains(failures, "campaign section", result_text, "Next: Sishui Gate")
|
||||
_check_contains(failures, "next camp section", result_text, "Next Camp")
|
||||
_check_contains(failures, "next camp location", result_text, "Sishui Gate, 190 CE")
|
||||
_check_contains(failures, "next camp shop", result_text, "Shop 6 goods")
|
||||
_check_contains(failures, "next camp deploy", result_text, "Deploy 2/3")
|
||||
_check_contains(failures, "next camp formation", result_text, "Formation 6 tiles")
|
||||
|
||||
scene.battle_result_summary = {
|
||||
"saved": false,
|
||||
@@ -57,14 +68,22 @@ func _init() -> void:
|
||||
scene.battle_result_summary = {
|
||||
"saved": true,
|
||||
"pending_choice": true,
|
||||
"next_scenario_id": "002_sishui_gate",
|
||||
"next_scenario_title": "Qingzhou Campaign"
|
||||
}
|
||||
var pending_choice_text := scene._format_battle_result_summary()
|
||||
_check_contains(
|
||||
failures,
|
||||
"pending choice prompt",
|
||||
scene._format_battle_result_summary(),
|
||||
pending_choice_text,
|
||||
"Select a campaign response"
|
||||
)
|
||||
_check_not_contains(
|
||||
failures,
|
||||
"pending choice should wait for response before next camp preview",
|
||||
pending_choice_text,
|
||||
"Next Camp"
|
||||
)
|
||||
|
||||
scene.battle_result_summary = {
|
||||
"saved": true,
|
||||
@@ -103,3 +122,9 @@ func _check_contains(failures: Array[String], label: String, text: String, expec
|
||||
if text.contains(expected):
|
||||
return
|
||||
failures.append("%s expected `%s` in `%s`" % [label, expected, text])
|
||||
|
||||
|
||||
func _check_not_contains(failures: Array[String], label: String, text: String, unexpected: String) -> void:
|
||||
if not text.contains(unexpected):
|
||||
return
|
||||
failures.append("%s did not expect `%s` in `%s`" % [label, unexpected, text])
|
||||
|
||||
Reference in New Issue
Block a user