Add prebattle camp overview
This commit is contained in:
@@ -25,6 +25,7 @@ func _init() -> void:
|
||||
_check_completed_replay_cannot_claim(failures)
|
||||
_check_conditional_camp_conversations(failures)
|
||||
_check_wuchao_branch_camp_conversations(failures)
|
||||
_check_talk_menu_closes_on_cancel_and_reload(failures)
|
||||
|
||||
if not _restore_user_file(SAVE_PATH, save_backup):
|
||||
failures.append("could not restore automatic campaign save")
|
||||
@@ -280,6 +281,25 @@ func _check_wuchao_branch_camp_conversations(failures: Array[String]) -> void:
|
||||
defense_scene.free()
|
||||
|
||||
|
||||
func _check_talk_menu_closes_on_cancel_and_reload(failures: Array[String]) -> void:
|
||||
var scene = _new_prebattle_scene(failures, "talk menu close guards")
|
||||
if scene == null:
|
||||
return
|
||||
scene._create_hud()
|
||||
scene.briefing_panel.visible = true
|
||||
scene.talk_menu.visible = true
|
||||
var cancel_event := InputEventKey.new()
|
||||
cancel_event.keycode = KEY_ESCAPE
|
||||
scene._handle_key(cancel_event)
|
||||
if scene.talk_menu.visible:
|
||||
failures.append("Escape should close the pre-battle talk menu")
|
||||
scene.talk_menu.visible = true
|
||||
scene._reload_from_campaign_state()
|
||||
if scene.talk_menu.visible:
|
||||
failures.append("campaign reload should hide the pre-battle talk menu")
|
||||
scene.free()
|
||||
|
||||
|
||||
func _new_prebattle_scene(failures: Array[String], label: String):
|
||||
return _new_prebattle_scene_for(failures, label, SCENARIO_ID, SCENARIO_PATH)
|
||||
|
||||
|
||||
@@ -195,6 +195,10 @@ func _check_scene_texture_loading(failures: Array[String]) -> void:
|
||||
var merchant_notice := scene._format_shop_merchant_notice_text(scene.state.get_shop_merchant())
|
||||
if not merchant_notice.contains("Camp Merchant") or not merchant_notice.contains("Roadside stores"):
|
||||
failures.append("shop merchant notice should include name and flavor lines")
|
||||
var camp_overview := scene._format_briefing_camp_overview_text(scene.state.get_briefing(), false)
|
||||
for expected in ["Yingchuan, 184 CE", "Gold 0G", "Talk 3", "1 supply", "Shop 2 buy", "Deploy 2/2", "Formation 4 tiles", "Armory ready"]:
|
||||
if not camp_overview.contains(expected):
|
||||
failures.append("camp overview should include %s: %s" % [expected, camp_overview])
|
||||
var bean: Dictionary = scene.state.get_item_def("bean")
|
||||
var bean_buy_detail := scene._format_shop_buy_item_detail_text("bean", bean, int(bean.get("price", 0)), 0)
|
||||
if not bean_buy_detail.contains("Heal 20") or not bean_buy_detail.contains("Owned x0"):
|
||||
|
||||
Reference in New Issue
Block a user