Streamline battle HUD controls

This commit is contained in:
2026-06-19 21:23:32 +09:00
parent 7d4827201f
commit c1c58337f4
2 changed files with 399 additions and 54 deletions

View File

@@ -3028,6 +3028,7 @@ func _check_hud_focus_text(failures: Array[String]) -> void:
return
var cao_cao: Dictionary = scene.state.get_unit("cao_cao")
var cao_text := scene._format_unit_focus_text(cao_cao, "Selected")
var cao_summary := scene._format_unit_focus_summary_text(cao_cao, "Selected")
if not cao_text.contains("군령 지휘"):
failures.append("Cao Cao HUD focus should describe command role: %s" % cao_text)
if not cao_text.contains("행군 4 (보병)") or not cao_text.contains("타격 1-1"):
@@ -3042,6 +3043,8 @@ func _check_hud_focus_text(failures: Array[String]) -> void:
failures.append("Cao Cao HUD focus should include terrain move cost: %s" % cao_text)
if not cao_text.contains("방비 +0"):
failures.append("Cao Cao HUD focus should include terrain defense: %s" % cao_text)
if not cao_summary.contains("군기: 조조") or not cao_summary.contains("병력") or cao_summary.contains("무위") or cao_summary.contains("지형 2,7"):
failures.append("Cao Cao visible HUD summary should stay compact while tooltip keeps detail: %s" % cao_summary)
var xiahou_dun: Dictionary = scene.state.get_unit("xiahou_dun")
xiahou_dun["pos"] = Vector2i(4, 1)
var forest_text := scene._unit_current_terrain_text(xiahou_dun)
@@ -3121,8 +3124,11 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
if briefing_text.contains(clutter):
failures.append("briefing objective parchment should stay concise without `%s`: %s" % [clutter, briefing_text])
var hud_objective := scene._format_objective_hud_text()
if not hud_objective.contains("승리:") or not hud_objective.contains("패배:"):
failures.append("HUD objective should use concise Korean labels: %s" % hud_objective)
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 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)
var mission_text := scene._format_mission_panel_text()
for expected in ["승리:", "패배:", "진행:", "주의:"]:
if not mission_text.contains(expected):
@@ -3223,15 +3229,15 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
failures.append("dialogue continue button should use the project serif font override")
if scene.mission_title_label == null or scene.mission_title_label.text != "전투 목표":
failures.append("mission panel title should use clear Korean wording")
if scene.mission_toggle_button == null or scene.mission_toggle_button.text != "":
failures.append("mission objective panel should expose a close control")
if scene.mission_toggle_button == null or scene.mission_toggle_button.text != "":
failures.append("mission objective panel should start compact with an open control")
else:
scene._on_mission_toggle_pressed()
if scene.mission_detail_panel == null or scene.mission_detail_panel.visible or scene.mission_toggle_button.text != "보기":
failures.append("mission objective panel should collapse cleanly")
scene._on_mission_toggle_pressed()
if scene.mission_detail_panel == null or not scene.mission_detail_panel.visible or scene.mission_toggle_button.text != "접기":
failures.append("mission objective panel should reopen cleanly")
scene._on_mission_toggle_pressed()
if scene.mission_detail_panel == null or scene.mission_detail_panel.visible or scene.mission_toggle_button.text != "보기":
failures.append("mission objective panel should collapse cleanly")
if scene.briefing_start_button == null or scene.briefing_start_button.text != "전투 시작":
failures.append("briefing start button should clearly start after briefing")
if scene.briefing_objective_toggle_button == null or scene.briefing_objective_toggle_button.text != "닫기":
@@ -3457,29 +3463,47 @@ func _find_descendant_by_name(root: Node, node_name: String) -> Node:
func _check_hud_command_grid_layout(failures: Array[String]) -> void:
var scene = BattleSceneScript.new()
scene._create_hud()
var command_grid := scene.end_turn_button.get_parent() as GridContainer
var command_grid := scene.wait_button.get_parent() as GridContainer
if command_grid == null:
failures.append("HUD command buttons should live in a fixed grid")
failures.append("unit command buttons should live in a fixed grid")
else:
if command_grid.columns != BattleSceneScript.HUD_COMMAND_GRID_COLUMNS:
failures.append("HUD command grid should use %d columns, got %d" % [BattleSceneScript.HUD_COMMAND_GRID_COLUMNS, command_grid.columns])
failures.append("unit command grid should use %d columns, got %d" % [BattleSceneScript.HUD_COMMAND_GRID_COLUMNS, command_grid.columns])
if command_grid.custom_minimum_size.x < BattleSceneScript.HUD_COMMAND_GRID_SIZE.x or command_grid.custom_minimum_size.y < BattleSceneScript.HUD_COMMAND_GRID_SIZE.y:
failures.append("HUD command grid should reserve stable space: %s" % str(command_grid.custom_minimum_size))
failures.append("unit command grid should reserve stable space: %s" % str(command_grid.custom_minimum_size))
for button in [
scene.wait_button,
scene.tactic_button,
scene.item_button,
scene.equip_button,
scene.threat_button,
scene.end_turn_button
scene.equip_button
]:
if button == null:
failures.append("HUD command button missing")
failures.append("unit command button missing")
continue
if button.get_parent() != command_grid:
failures.append("unit command button should stay in the side command grid: %s" % str(button.name))
if button.custom_minimum_size.x < BattleSceneScript.HUD_COMMAND_BUTTON_SIZE.x or button.custom_minimum_size.y < BattleSceneScript.HUD_COMMAND_BUTTON_SIZE.y:
failures.append("HUD command button should reserve fixed Korean label space: %s" % str(button.custom_minimum_size))
if scene.end_turn_button.text != "차례 종료":
failures.append("end turn command should use a short visible Korean label: %s" % scene.end_turn_button.text)
failures.append("unit command button should reserve fixed Korean label space: %s" % str(button.custom_minimum_size))
var top_toolbar := scene.end_turn_button.get_parent() as HBoxContainer
if top_toolbar == null or top_toolbar.name != "TopToolBar":
failures.append("global battle commands should move to the top icon toolbar")
for button in [
scene.end_turn_button,
scene.threat_button,
scene.top_save_button,
scene.top_load_button,
scene.restart_button,
scene.new_campaign_button
]:
if button == null:
failures.append("top tool button missing")
continue
if button.get_parent() != top_toolbar:
failures.append("top tool button should share the top toolbar: %s" % str(button.name))
if not bool(button.get_meta("icon_only", false)) or button.text != "" or button.icon == null:
failures.append("top tool button should be icon-only with tooltip detail: %s text=%s icon=%s" % [str(button.name), button.text, str(button.icon)])
if button.custom_minimum_size.x < BattleSceneScript.TOP_TOOL_BUTTON_SIZE.x or button.custom_minimum_size.y < BattleSceneScript.TOP_TOOL_BUTTON_SIZE.y:
failures.append("top tool button should reserve stable icon space: %s" % str(button.custom_minimum_size))
scene.free()