Add visual post-move picker rows
This commit is contained in:
@@ -832,6 +832,7 @@ func _check_scene_post_move_tactic_picker_flow(failures: Array[String]) -> void:
|
||||
if scene.tactic_menu != null and scene.tactic_menu.visible:
|
||||
failures.append("post-move tactic shortcut should not use the side tactic menu")
|
||||
_check_post_move_picker_option_tooltips_present(failures, scene, "post-move tactic picker")
|
||||
_check_post_move_picker_option_visuals(failures, scene, "post-move tactic picker")
|
||||
|
||||
var escape := InputEventKey.new()
|
||||
escape.keycode = KEY_ESCAPE
|
||||
@@ -941,6 +942,7 @@ func _check_scene_post_move_item_picker_flow(failures: Array[String]) -> void:
|
||||
if scene.item_menu != null and scene.item_menu.visible:
|
||||
failures.append("post-move item shortcut should not use the side item menu")
|
||||
_check_post_move_picker_option_tooltips_present(failures, scene, "post-move item picker")
|
||||
_check_post_move_picker_option_visuals(failures, scene, "post-move item picker")
|
||||
|
||||
scene._on_post_move_item_option_pressed("bean")
|
||||
if scene.selected_item_id != "bean":
|
||||
@@ -1027,6 +1029,28 @@ func _check_post_move_picker_option_tooltips_present(failures: Array[String], sc
|
||||
failures.append("%s option should explain its function through hover tooltip" % label)
|
||||
|
||||
|
||||
func _check_post_move_picker_option_visuals(failures: Array[String], scene, label: String) -> void:
|
||||
if scene.post_move_picker_list == null:
|
||||
failures.append("%s should expose a visual picker option list" % label)
|
||||
return
|
||||
var saw_button := false
|
||||
for child in scene.post_move_picker_list.get_children():
|
||||
if not child is Button:
|
||||
continue
|
||||
saw_button = true
|
||||
var button := child as Button
|
||||
if button.icon == null or str(button.get_meta("picker_icon", "")).strip_edges().is_empty():
|
||||
failures.append("%s option should carry an immediate generated icon" % label)
|
||||
if button.custom_minimum_size.x < BattleSceneScript.POST_MOVE_PICKER_OPTION_SIZE.x or button.custom_minimum_size.y < BattleSceneScript.POST_MOVE_PICKER_OPTION_SIZE.y:
|
||||
failures.append("%s option should reserve stable visual row space: %s" % [label, str(button.custom_minimum_size)])
|
||||
if not button.text.contains("\n"):
|
||||
failures.append("%s option should use compact two-line visual text: %s" % [label, button.text])
|
||||
if button.get_theme_constant("icon_max_width") < BattleSceneScript.POST_MOVE_PICKER_OPTION_ICON_MAX_WIDTH:
|
||||
failures.append("%s option should reserve readable icon width" % label)
|
||||
if not saw_button:
|
||||
failures.append("%s should create at least one visual option button" % label)
|
||||
|
||||
|
||||
func _check_fitted_label_font(failures: Array[String], label: Label, base_size: int, min_size: int, label_name: String) -> void:
|
||||
var font_size := label.get_theme_font_size("font_size")
|
||||
if font_size < min_size or font_size > base_size:
|
||||
|
||||
Reference in New Issue
Block a user