From b5dceea84872d68eda346b932a531ccfb2d98683 Mon Sep 17 00:00:00 2001 From: Wickedness Date: Fri, 19 Jun 2026 22:21:50 +0900 Subject: [PATCH] Compact top battle HUD text --- scripts/scenes/battle_scene.gd | 43 +++++++++++++++++++++++++++++----- tools/smoke_visual_assets.gd | 20 ++++++++++++++-- 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index a211b3c..0810878 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -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 diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index 4a1fbcd..d64c696 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -3156,10 +3156,26 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void: failures.append("briefing objective parchment should stay concise without `%s`: %s" % [clutter, briefing_text]) var hud_objective := scene._format_objective_hud_text() var hud_objective_detail := scene._format_objective_hud_detail_text() - if not hud_objective.begins_with("목표:"): - failures.append("HUD objective should stay as a concise current-goal summary: %s" % hud_objective) + if hud_objective.begins_with("목표:") or hud_objective.contains("승리 조건") or hud_objective.contains("패배 조건"): + failures.append("HUD objective should hide labels and keep only a concise current-goal summary: %s" % hud_objective) if not hud_objective_detail.contains("승리:") or not hud_objective_detail.contains("패배:"): failures.append("HUD objective tooltip should retain win/loss details: %s" % hud_objective_detail) + scene.battle_started = true + scene.briefing_panel.visible = false + scene.result_panel.visible = false + scene._update_hud() + if scene.status_label == null or scene.status_label.text.contains("군령") or scene.status_label.text.contains("제"): + failures.append("top turn status should stay compact and leave full wording to tooltip: %s" % ("" if scene.status_label == null else scene.status_label.text)) + elif not scene.status_label.tooltip_text.contains("군령"): + failures.append("top turn status tooltip should retain full turn wording: %s" % scene.status_label.tooltip_text) + if scene.campaign_status_label == null or scene.campaign_status_label.text.contains("전기") or scene.campaign_status_label.text.contains("군자금"): + failures.append("top campaign status should use compact seal/gold counts: %s" % ("" if scene.campaign_status_label == null else scene.campaign_status_label.text)) + elif not scene.campaign_status_label.tooltip_text.contains("군자금"): + failures.append("top campaign status tooltip should retain full campaign progress: %s" % scene.campaign_status_label.tooltip_text) + if scene.objective_label == null or scene.objective_label.text.begins_with("목표:"): + failures.append("top objective label should avoid repeated visible heading: %s" % ("" if scene.objective_label == null else scene.objective_label.text)) + elif not scene.objective_label.tooltip_text.contains("승리:") or not scene.objective_label.tooltip_text.contains("패배:"): + failures.append("top objective tooltip should retain objective detail: %s" % ("" if scene.objective_label == null else scene.objective_label.tooltip_text)) var mission_text := scene._format_mission_panel_text() for expected in ["승리:", "패배:", "진행:", "주의:"]: if not mission_text.contains(expected):