Compact selected unit HUD with hover badges

This commit is contained in:
2026-06-19 22:15:37 +09:00
parent d7bf2e3de6
commit 6fe0a0fbe7
3 changed files with 283 additions and 16 deletions

View File

@@ -70,6 +70,10 @@ func _check_hud_reuses_status_summary(failures: Array[String]) -> void:
if scene.selected_label.text.contains("상태:"):
failures.append("selected HUD should keep status effects in tooltip/markers, not visible text: %s" % scene.selected_label.text)
_check_contains(failures, "selected HUD status tooltip", scene.selected_label.tooltip_text, "상태: 방비 -2 (2회)")
if scene.hud_unit_badge_row == null or not scene.hud_unit_badge_row.visible:
failures.append("selected HUD should keep status effects discoverable through compact badges")
else:
_check_contains(failures, "selected badge status tooltip", scene.hud_unit_badge_row.tooltip_text, "상태: 방비 -2 (2회)")
_check_contains(failures, "selected HP bar status tooltip", scene.hud_unit_hp_bar.tooltip_text, "상태: 방비 -2 (2회)")
_check_contains(failures, "hover tile tooltip status", scene.cell_info_label.tooltip_text, "상태: 방비 -2 (2회)")
scene.state.clear_selection()

View File

@@ -3058,6 +3058,24 @@ func _check_hud_focus_text(failures: Array[String]) -> void:
failures.append("selected HP bar tooltip should preserve unit detail: %s" % scene.hud_unit_hp_bar.tooltip_text)
if scene.selected_label.text.contains("병력") or scene.selected_label.text.contains("기력"):
failures.append("selected label should not duplicate HP/MP bars: %s" % scene.selected_label.text)
if scene.selected_label.text.contains("군령:"):
failures.append("selected label should move command availability into visual badges: %s" % scene.selected_label.text)
if scene.inventory_label == null or scene.inventory_label.text.contains("군수:") or scene.inventory_label.text.contains("소모") or scene.inventory_label.text.contains("병장"):
failures.append("inventory HUD summary should stay compact and leave details to tooltip: %s" % ("" if scene.inventory_label == null else scene.inventory_label.text))
elif not scene.inventory_label.tooltip_text.contains("군수:"):
failures.append("inventory HUD tooltip should preserve full inventory detail: %s" % scene.inventory_label.tooltip_text)
if scene.hud_unit_badge_row == null or not scene.hud_unit_badge_row.visible:
failures.append("selected unit HUD should expose compact hover badges")
else:
var badge_tooltips := _collect_child_tooltips(scene.hud_unit_badge_row)
if scene.hud_unit_badge_row.get_child_count() < 6:
failures.append("selected unit HUD should show role/facing/action badges, got %d" % scene.hud_unit_badge_row.get_child_count())
if not badge_tooltips.contains("시선 동쪽") or not badge_tooltips.contains("등 뒤"):
failures.append("selected unit facing badge should explain directional defense: %s" % badge_tooltips)
if not badge_tooltips.contains("행군") or not badge_tooltips.contains("타격") or not badge_tooltips.contains("대기"):
failures.append("selected unit action badges should expose available commands through tooltips: %s" % badge_tooltips)
if not _has_descendant_texture(scene.hud_unit_badge_row):
failures.append("selected unit action badges should use icon imagery, not only text")
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)
@@ -3468,6 +3486,36 @@ func _find_descendant_by_name(root: Node, node_name: String) -> Node:
return null
func _collect_child_tooltips(root: Node) -> String:
if root == null:
return ""
var parts: Array[String] = []
_collect_child_tooltips_into(root, parts)
return "\n".join(parts)
func _collect_child_tooltips_into(root: Node, parts: Array[String]) -> void:
if root == null:
return
if root is Control:
var tooltip := str((root as Control).tooltip_text).strip_edges()
if not tooltip.is_empty():
parts.append(tooltip)
for child in root.get_children():
_collect_child_tooltips_into(child, parts)
func _has_descendant_texture(root: Node) -> bool:
if root == null:
return false
if root is TextureRect and (root as TextureRect).texture != null:
return true
for child in root.get_children():
if _has_descendant_texture(child):
return true
return false
func _check_local_command_icon_button(failures: Array[String], button: Button, expected_label: String, expected_icon: String) -> void:
if button == null:
failures.append("local command button missing: %s" % expected_label)