Files
stickman/scripts/ui/emoji_quick_grid.gd
ryan 1a2a43c805 Add reusable UI components for Phase 7 UI Polish
- 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.
2026-09-18 09:42:48 -04:00

11 lines
586 B
GDScript

class_name EmojiQuickGrid
extends GridContainer
signal emoji_selected(text: String)
func configure(items: Array[String], columns: int = 8, theme: Variant = null) -> void:
for child: Node in get_children(): child.queue_free()
self.columns = maxi(1, columns)
for text: String in items:
var button := Button.new(); button.text = text; button.custom_minimum_size = Vector2(44,44); button.focus_mode = Control.FOCUS_ALL
if theme != null: button.add_theme_font_override("font", theme.emoji_font())
button.pressed.connect(func() -> void: emoji_selected.emit(text)); add_child(button)