Add campaign chapter metadata
This commit is contained in:
@@ -1841,6 +1841,13 @@ func _format_briefing_title(briefing: Dictionary) -> String:
|
||||
var title := str(briefing.get("title", state.battle_name))
|
||||
if title.is_empty():
|
||||
title = campaign_state.get_scenario_title(active_scenario_id)
|
||||
var chapter_title := campaign_state.get_chapter_title_for_scenario(active_scenario_id)
|
||||
if not chapter_title.is_empty():
|
||||
var chapter_position := campaign_state.get_chapter_position_for_scenario(active_scenario_id)
|
||||
var chapter_count := campaign_state.get_chapter_count()
|
||||
if chapter_position > 0 and chapter_count > 0:
|
||||
return "Chapter %02d/%02d - %s" % [chapter_position, chapter_count, chapter_title]
|
||||
return chapter_title
|
||||
var position := campaign_state.get_scenario_position(active_scenario_id)
|
||||
var count := campaign_state.get_scenario_count()
|
||||
if position > 0 and count > 0:
|
||||
@@ -1850,6 +1857,12 @@ func _format_briefing_title(briefing: Dictionary) -> String:
|
||||
|
||||
func _format_briefing_location(briefing: Dictionary) -> String:
|
||||
var location := str(briefing.get("location", ""))
|
||||
var chapter_title := campaign_state.get_chapter_title_for_scenario(active_scenario_id)
|
||||
if not chapter_title.is_empty():
|
||||
var battle_text := _format_briefing_chapter_battle_text(briefing)
|
||||
if location.is_empty():
|
||||
return battle_text
|
||||
return "%s | %s" % [battle_text, location]
|
||||
if campaign_state.campaign_title.is_empty():
|
||||
return location
|
||||
if location.is_empty():
|
||||
@@ -1857,6 +1870,17 @@ func _format_briefing_location(briefing: Dictionary) -> String:
|
||||
return "%s | %s" % [campaign_state.campaign_title, location]
|
||||
|
||||
|
||||
func _format_briefing_chapter_battle_text(briefing: Dictionary) -> String:
|
||||
var title := str(briefing.get("title", state.battle_name))
|
||||
if title.is_empty():
|
||||
title = campaign_state.get_scenario_title(active_scenario_id)
|
||||
var position := campaign_state.get_scenario_position_in_chapter(active_scenario_id)
|
||||
var count := campaign_state.get_scenario_count_in_chapter(active_scenario_id)
|
||||
if position > 0 and count > 0:
|
||||
return "Battle %02d/%02d: %s" % [position, count, title]
|
||||
return title
|
||||
|
||||
|
||||
func _format_briefing_objectives() -> String:
|
||||
var text := ""
|
||||
var victory := str(state.objectives.get("victory", ""))
|
||||
|
||||
Reference in New Issue
Block a user