- Introduced `EmojiQuickGrid`, `FontPresetPicker`, and `PresetSizeToggle` classes for emoji selection, font presets, and size toggles respectively. - Implemented configuration methods for each component to handle dynamic content and theming. - Created tests for the new components to ensure functionality and integration with the existing UI. - Added a comprehensive architecture specification for Phase 7 UI Polish detailing scope, implementation, and validation strategies. - Updated existing theme handling to support new UI elements and ensure consistent styling across the application.
18 lines
1.1 KiB
GDScript
18 lines
1.1 KiB
GDScript
extends SceneTree
|
|
|
|
const COLOR_SWATCH := preload("res://scripts/ui/color_swatch_selector.gd")
|
|
const SIZE_TOGGLE := preload("res://scripts/ui/preset_size_toggle.gd")
|
|
const FONT_PICKER := preload("res://scripts/ui/font_preset_picker.gd")
|
|
const EMOJI_GRID := preload("res://scripts/ui/emoji_quick_grid.gd")
|
|
var _failures: int = 0
|
|
|
|
func _init() -> void:
|
|
var swatch = COLOR_SWATCH.new(); swatch.configure([Color.RED], Color.RED); _check(swatch.get_selected() == Color.RED, "swatch selection")
|
|
var sizes = SIZE_TOGGLE.new(); sizes.configure([{"id":"small","label":"Small","value":20}], "small"); _check(sizes.get_selected_value() == 20, "size value")
|
|
var fonts = FONT_PICKER.new(); fonts.configure([{"id":"ui","label":"UI"}], "ui"); _check(fonts.get_selected_id() == "ui", "font id")
|
|
var emoji = EMOJI_GRID.new(); emoji.configure(["😀"], 1); _check(emoji.get_child_count() == 1, "emoji controls")
|
|
print("PASS" if _failures == 0 else "FAIL: %d" % _failures); quit(0 if _failures == 0 else 1)
|
|
|
|
func _check(condition: bool, message: String) -> void:
|
|
if not condition: _failures += 1; push_error("Phase 7 widgets: " + message)
|