Polish board unit labels with generated surfaces

This commit is contained in:
2026-06-20 06:06:21 +09:00
parent 869700a5ff
commit 03c77e64f3
3 changed files with 54 additions and 7 deletions

View File

@@ -3326,6 +3326,19 @@ func _check_hud_focus_text(failures: Array[String]) -> void:
facing_points_inside = false
if not facing_points_inside:
failures.append("Unit facing marker should stay anchored inside its tile: %s" % str(facing_marker_points))
if scene._unit_board_panel_key() != "hud_jade":
failures.append("Board unit nameplate and HP bar should use generated jade panel art")
if scene._load_art_texture("res://art/ui/panels/panel_%s.png" % scene._unit_board_panel_key()) == null:
failures.append("Board unit nameplate and HP bar should load generated panel texture")
var board_unit_rect: Rect2 = scene._visual_rect_for_unit(cao_cao)
var nameplate_rect: Rect2 = scene._unit_nameplate_rect(board_unit_rect)
var hp_bar_rect: Rect2 = scene._unit_hp_bar_rect(board_unit_rect)
if not facing_tile_rect.encloses(nameplate_rect):
failures.append("Unit nameplate should stay inside its tile: %s within %s" % [str(nameplate_rect), str(facing_tile_rect)])
if not facing_tile_rect.encloses(hp_bar_rect):
failures.append("Unit HP bar should stay inside its tile: %s within %s" % [str(hp_bar_rect), str(facing_tile_rect)])
if nameplate_rect.intersects(hp_bar_rect):
failures.append("Unit nameplate should not collide with HP bar: %s / %s" % [str(nameplate_rect), str(hp_bar_rect)])
_check_unit_class_family(failures, scene, "cao_cao", "tactic")
_check_unit_class_family(failures, scene, "xiahou_dun", "cavalry")
_check_unit_class_family(failures, scene, "yellow_turban_2", "infantry")