Compact top battle HUD text
This commit is contained in:
@@ -1707,6 +1707,8 @@ func _create_hud() -> void:
|
||||
|
||||
status_label = Label.new()
|
||||
status_label.custom_minimum_size = Vector2(118, 48)
|
||||
status_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
status_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
_apply_label_style(status_label, UI_PARCHMENT_TEXT)
|
||||
top_row.add_child(status_label)
|
||||
|
||||
@@ -1730,6 +1732,8 @@ func _create_hud() -> void:
|
||||
|
||||
campaign_status_label = Label.new()
|
||||
campaign_status_label.custom_minimum_size = Vector2(144, 48)
|
||||
campaign_status_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
campaign_status_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
_apply_label_style(campaign_status_label, UI_PARCHMENT_TEXT)
|
||||
top_row.add_child(campaign_status_label)
|
||||
|
||||
@@ -6323,8 +6327,8 @@ func _refresh_ranges() -> void:
|
||||
|
||||
|
||||
func _update_hud() -> void:
|
||||
status_label.text = state.get_status_text()
|
||||
status_label.tooltip_text = state.get_status_text()
|
||||
status_label.text = _format_status_hud_text()
|
||||
status_label.tooltip_text = _format_status_hud_detail_text()
|
||||
objective_label.text = _format_objective_hud_text()
|
||||
objective_label.tooltip_text = _format_objective_hud_detail_text()
|
||||
_fit_label_font_size_to_text(
|
||||
@@ -6393,14 +6397,41 @@ func _update_hud() -> void:
|
||||
_update_targeting_hint_panel()
|
||||
|
||||
|
||||
func _format_status_hud_text() -> String:
|
||||
if state.battle_status == BattleState.STATUS_VICTORY:
|
||||
return "승전"
|
||||
if state.battle_status == BattleState.STATUS_DEFEAT:
|
||||
return "패전"
|
||||
var turn_limit := state.get_turn_limit()
|
||||
var team_text := _team_hud_short_text(state.current_team)
|
||||
if turn_limit > 0:
|
||||
return "령 %d/%d\n%s" % [state.turn_number, turn_limit, team_text]
|
||||
return "령 %d\n%s" % [state.turn_number, team_text]
|
||||
|
||||
|
||||
func _format_status_hud_detail_text() -> String:
|
||||
var status_text := state.get_status_text()
|
||||
if status_text.strip_edges().is_empty():
|
||||
return "현재 군령 상태입니다."
|
||||
return "%s\n현재 차례와 제한 턴을 표시합니다." % status_text
|
||||
|
||||
|
||||
func _team_hud_short_text(team: String) -> String:
|
||||
if team == BattleState.TEAM_PLAYER:
|
||||
return "아군"
|
||||
if team == BattleState.TEAM_ENEMY:
|
||||
return "적군"
|
||||
return team.capitalize()
|
||||
|
||||
|
||||
func _format_objective_hud_text() -> String:
|
||||
var progress_lines := state.get_objective_progress_lines(false, false)
|
||||
if not progress_lines.is_empty():
|
||||
return "목표: %s" % _join_strings(progress_lines, " · ")
|
||||
return _join_strings(progress_lines, " · ")
|
||||
var victory := String(state.objectives.get("victory", "적군을 모두 격파하라.")).strip_edges()
|
||||
if victory.is_empty():
|
||||
return "목표 대기"
|
||||
return "목표: %s" % _truncate_hud_text(victory, 34)
|
||||
return "대기"
|
||||
return _truncate_hud_text(victory, 34)
|
||||
|
||||
|
||||
func _format_objective_hud_detail_text() -> String:
|
||||
@@ -6424,7 +6455,7 @@ func _truncate_hud_text(text: String, max_length: int) -> String:
|
||||
|
||||
|
||||
func _format_campaign_hud_summary_text() -> String:
|
||||
return "전기 %d/%d\n%d냥" % [
|
||||
return "봉 %d/%d\n%d냥" % [
|
||||
campaign_state.completed_scenarios.size(),
|
||||
campaign_state.get_scenario_count(),
|
||||
campaign_state.gold
|
||||
|
||||
Reference in New Issue
Block a user