Refine side unit overview list
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user