diff --git a/scripts/scenes/battle_scene.gd b/scripts/scenes/battle_scene.gd index 2ac10be..1fc22d8 100644 --- a/scripts/scenes/battle_scene.gd +++ b/scripts/scenes/battle_scene.gd @@ -222,10 +222,10 @@ const HUD_UNIT_PORTRAIT_SEAL_SIZE := Vector2(26, 26) const HUD_UNIT_PORTRAIT_CLASS_PANEL_SIZE := Vector2(30, 30) const HUD_UNIT_PORTRAIT_CLASS_ICON_SIZE := Vector2(24, 24) const HUD_UNIT_RESOURCE_ICON_SIZE := Vector2(16, 16) -const SIDE_UNIT_OVERVIEW_PANEL_SIZE := Vector2(420, 166) -const SIDE_UNIT_OVERVIEW_ROW_SIZE := Vector2(396, 28) -const SIDE_UNIT_OVERVIEW_SCROLL_SIZE := Vector2(396, 86) -const SIDE_UNIT_OVERVIEW_HP_BAR_SIZE := Vector2(92, 8) +const SIDE_UNIT_OVERVIEW_PANEL_SIZE := Vector2(420, 250) +const SIDE_UNIT_OVERVIEW_ROW_SIZE := Vector2(396, 32) +const SIDE_UNIT_OVERVIEW_SCROLL_SIZE := Vector2(396, 168) +const SIDE_UNIT_OVERVIEW_HP_BAR_SIZE := Vector2(118, 7) const TOP_HUD_CHIP_ICON_SIZE := Vector2(30, 30) const SIDE_INFO_CHIP_ICON_SIZE := Vector2(26, 26) const HUD_COMMAND_GRID_SIZE := Vector2(272, 44) @@ -10864,7 +10864,7 @@ func _make_side_unit_overview_row(unit: Dictionary) -> HBoxContainer: row_button.name = "SideUnitOverviewName" row_button.text = _format_side_unit_overview_row_text(unit) row_button.tooltip_text = tooltip_text - row_button.custom_minimum_size = Vector2(168, SIDE_UNIT_OVERVIEW_ROW_SIZE.y) + row_button.custom_minimum_size = Vector2(184, SIDE_UNIT_OVERVIEW_ROW_SIZE.y) row_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL row_button.icon = _load_unit_class_icon_texture(unit) row_button.expand_icon = false @@ -10879,6 +10879,27 @@ func _make_side_unit_overview_row(unit: Dictionary) -> HBoxContainer: var hp := int(unit.get("hp", 0)) var max_hp := maxi(1, int(unit.get("max_hp", 1))) var hp_ratio := clampf(float(hp) / float(max_hp), 0.0, 1.0) + + var hp_column := VBoxContainer.new() + hp_column.name = "SideUnitOverviewHpColumn" + hp_column.custom_minimum_size = Vector2(126, SIDE_UNIT_OVERVIEW_ROW_SIZE.y) + hp_column.size_flags_vertical = Control.SIZE_SHRINK_CENTER + hp_column.add_theme_constant_override("separation", 2) + hp_column.tooltip_text = "병력 %d/%d\n%s" % [hp, max_hp, tooltip_text] + _connect_side_unit_overview_click_target(hp_column, unit_id) + row.add_child(hp_column) + + var hp_label := Label.new() + hp_label.name = "SideUnitOverviewHpText" + hp_label.text = "병력 %d/%d" % [hp, max_hp] + hp_label.custom_minimum_size = Vector2(126, 13) + hp_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + hp_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + hp_label.tooltip_text = hp_column.tooltip_text + _apply_label_style(hp_label, UI_PARCHMENT_TEXT, 10) + _connect_side_unit_overview_click_target(hp_label, unit_id) + hp_column.add_child(hp_label) + var hp_bar := ProgressBar.new() hp_bar.name = "SideUnitOverviewHp" hp_bar.custom_minimum_size = SIDE_UNIT_OVERVIEW_HP_BAR_SIZE @@ -10891,7 +10912,7 @@ func _make_side_unit_overview_row(unit: Dictionary) -> HBoxContainer: hp_bar.add_theme_stylebox_override("background", _make_panel_style(Color(0.050, 0.029, 0.018, 0.96), UI_LACQUER_EDGE, 1, 0, 0, 0)) hp_bar.add_theme_stylebox_override("fill", _make_panel_style(_unit_hp_color(hp_ratio), Color(0.82, 0.72, 0.50, 1.0), 1, 0, 0, 0)) _connect_side_unit_overview_click_target(hp_bar, unit_id) - row.add_child(hp_bar) + hp_column.add_child(hp_bar) var status_label := Label.new() status_label.name = "SideUnitOverviewState" diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index c0b270e..5c4275a 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -3589,6 +3589,9 @@ func _check_hud_focus_text(failures: Array[String]) -> void: _check_side_overview_click_target(failures, ally_overview_row, "ally overview row") _check_side_overview_click_target(failures, _find_descendant_by_name(ally_overview_row, "SideUnitOverviewHp") as Control, "ally overview hp") _check_side_overview_click_target(failures, _find_descendant_by_name(ally_overview_row, "SideUnitOverviewState") as Control, "ally overview state") + var ally_hp_text := _find_descendant_by_name(ally_overview_row, "SideUnitOverviewHpText") as Label + if ally_hp_text == null or not ally_hp_text.text.contains("병력"): + failures.append("ally overview rows should show readable troop strength beside the HP bar") if scene.side_unit_overview_status_label == null or not scene.side_unit_overview_status_label.text.contains("명령"): failures.append("ally overview status should summarize ready and completed units: %s" % ("" if scene.side_unit_overview_status_label == null else scene.side_unit_overview_status_label.text)) if scene.side_unit_overview_ally_button == null or scene.side_unit_overview_enemy_button == null: @@ -3620,6 +3623,9 @@ func _check_hud_focus_text(failures: Array[String]) -> void: _check_side_overview_click_target(failures, enemy_overview_row, "enemy overview row") _check_side_overview_click_target(failures, _find_descendant_by_name(enemy_overview_row, "SideUnitOverviewHp") as Control, "enemy overview hp") _check_side_overview_click_target(failures, _find_descendant_by_name(enemy_overview_row, "SideUnitOverviewState") as Control, "enemy overview state") + var enemy_hp_text := _find_descendant_by_name(enemy_overview_row, "SideUnitOverviewHpText") as Label + if enemy_hp_text == null or not enemy_hp_text.text.contains("병력"): + failures.append("enemy overview rows should show readable troop strength beside the HP bar") scene._on_side_unit_overview_row_pressed("yellow_turban_1") if scene.state.selected_unit_id != "": failures.append("enemy overview row click should focus without selecting enemy units: %s" % scene.state.selected_unit_id)