feat: harmonize Prop and Stickman editor UI
This commit is contained in:
@@ -2,6 +2,7 @@ extends SceneTree
|
||||
|
||||
const STICKMAN_SCENE := preload("res://scenes/main.tscn")
|
||||
const PROP_SCENE := preload("res://scenes/editors/prop/prop_editor.tscn")
|
||||
const STAGE_DIALOG_STYLER := preload("res://scripts/shared/stage_ui/stage_dialog_styler.gd")
|
||||
|
||||
var _checks: int = 0
|
||||
var _failures: int = 0
|
||||
@@ -171,7 +172,7 @@ func _test_stickman_workspace_and_transactions() -> void:
|
||||
check("second shape can be authored", bool(head.call("add_shape", &"line", head.call("drawing_center_world"))))
|
||||
editor.call("_on_file_menu_id_pressed", 2)
|
||||
var unsaved_dialog: ConfirmationDialog = editor.get("_unsaved_dialog") as ConfirmationDialog
|
||||
check("Start Over shows a save/discard/cancel transaction", unsaved_dialog.visible)
|
||||
check("Start Over shows a save/discard/cancel transaction", STAGE_DIALOG_STYLER.is_open(unsaved_dialog))
|
||||
unsaved_dialog.get_cancel_button().emit_signal("pressed")
|
||||
await process_frame
|
||||
check("Cancel leaves dirty content in place", bool(editor.call("has_unsaved_changes")) and (head.get("shapes") as Array).size() == 2)
|
||||
@@ -197,7 +198,50 @@ func _test_prop_reshape_and_chrome() -> void:
|
||||
check("Prop action target meets 44 px minimum", (editor.get("_create_point_button") as Button).custom_minimum_size.y >= 44.0)
|
||||
check("new Prop has an explicit clean save status", str(save_status.text).ends_with("Not saved yet"))
|
||||
check("whole-prop action uses approved discoverable wording", str((editor.get("_whole_prop_resize_button") as Button).text) == "Move, Turn, or Resize Prop")
|
||||
check("material inspector uses child-facing grip language", str((editor.get("_friction_label") as Label).text).begins_with("Surface grip:"))
|
||||
check("material physics tile uses child-facing grip language", str((editor.get("_friction_label") as Label).text) == "Surface grip")
|
||||
var preset_option: PropInspectorDropdown = editor.get("_preset_option") as PropInspectorDropdown
|
||||
check("material choices show colored swatches in field and popup", preset_option.item_count == 5 and preset_option.get_item_icon(0) != null and preset_option.get_item_icon(4) != null and preset_option.icon != null)
|
||||
var material_selected_row: StyleBoxFlat = preset_option.get_popup().get_theme_stylebox("hover") as StyleBoxFlat
|
||||
var material_items_plain: bool = true
|
||||
for index: int in preset_option.item_count:
|
||||
material_items_plain = material_items_plain and not preset_option.get_popup().is_item_checkable(index)
|
||||
check("material popup uses the full-row selection highlight without radio items", material_items_plain and material_selected_row.bg_color.is_equal_approx(Color("#103B4D")) and material_selected_row.border_color.is_equal_approx(Color("#22C6FF")))
|
||||
await process_frame
|
||||
preset_option.show_popup()
|
||||
await process_frame
|
||||
check("opening the material popup focuses its current value and spans the field", preset_option.get_popup().get_focused_item() == preset_option.selected and preset_option.get_popup().size.x >= preset_option.size.x)
|
||||
check("dropdown popup icons reserve a 44 px row target", preset_option.get_popup().get_item_icon(0).get_width() >= 44)
|
||||
preset_option.hide_popup()
|
||||
preset_option.get_popup().emit_signal("id_pressed", 1)
|
||||
check("choosing a material updates the field and editor model", preset_option.selected == 1 and int(editor.get("_material_preset")) == 1)
|
||||
preset_option.get_popup().emit_signal("id_pressed", 0)
|
||||
var primitive_option: PropInspectorDropdown = editor.get("_primitive_option") as PropInspectorDropdown
|
||||
check("2D shape choices show flat icons in field and popup", primitive_option.item_count == 5 and primitive_option.get_item_icon(0) != null and primitive_option.get_item_icon(4) != null and primitive_option.icon != null)
|
||||
var shape_items_plain: bool = true
|
||||
for index: int in primitive_option.item_count:
|
||||
shape_items_plain = shape_items_plain and not primitive_option.get_popup().is_item_checkable(index)
|
||||
check("shape popup does not draw radio selectors", shape_items_plain)
|
||||
primitive_option.show_popup()
|
||||
await process_frame
|
||||
check("shape popup highlights its current 2D choice", primitive_option.get_popup().get_focused_item() == primitive_option.selected)
|
||||
primitive_option.hide_popup()
|
||||
primitive_option.get_popup().emit_signal("id_pressed", 2)
|
||||
check("choosing a 2D shape updates its parameters", primitive_option.selected == 2 and (editor.get("_param_spins") as Dictionary).has("base"))
|
||||
primitive_option.get_popup().emit_signal("id_pressed", 0)
|
||||
var tag_buttons: Dictionary = editor.get("_tag_checks") as Dictionary
|
||||
var nature_button: Button = tag_buttons.get("nature") as Button
|
||||
check("artwork tag chip has a colored icon and a wide touch target", nature_button != null and nature_button.icon != null and nature_button.custom_minimum_size.y >= 48.0)
|
||||
var nature_icon: Texture2D = nature_button.icon
|
||||
nature_button.set_pressed_no_signal(true)
|
||||
nature_button.emit_signal("toggled", true)
|
||||
var selected_tag_style := nature_button.get_theme_stylebox("pressed") as StyleBoxFlat
|
||||
check("tag selection updates its model", (editor.get("_tags") as Array).has("nature"))
|
||||
check("selected tag keeps its original colored icon without a badge", nature_button.icon == nature_icon)
|
||||
check("selected tag style uses a cyan-tinted highlight", selected_tag_style.bg_color.is_equal_approx(Color("#103B4D")))
|
||||
nature_button.set_pressed_no_signal(false)
|
||||
nature_button.emit_signal("toggled", false)
|
||||
check("clearing a tag removes it from the tag model", not (editor.get("_tags") as Array).has("nature"))
|
||||
check("inspector sections use themed cards", editor.get("_material_section") is PanelContainer and editor.get("_add_section") is PanelContainer and editor.get("_tag_section") is PanelContainer)
|
||||
check("anchor layer control uses the approved label", (editor.get("_anchor_z") as SpinBox).get_parent().get_child(0) is Label and str(((editor.get("_anchor_z") as SpinBox).get_parent().get_child(0) as Label).text) == "Held prop layer:")
|
||||
|
||||
canvas.call("add_primitive", "box", Vector2(150.0, 150.0))
|
||||
|
||||
Reference in New Issue
Block a user