feat: Add StageDialogStyler for enhanced dialog management

- Introduced StageDialogStyler class to render child-facing dialogs as shared in-stage cards.
- Preserved native AcceptDialog/ConfirmationDialog signals for stage workflows.
- Implemented methods for applying styles, managing visibility, and handling button actions.
- Added support for dynamic theming and responsive design based on viewport size.
- Created utility functions for styling buttons and managing dialog content.
This commit is contained in:
2026-10-23 01:16:22 -04:00
parent c6f3930dcb
commit 0a5ef0a61e
10 changed files with 1724 additions and 238 deletions
+20 -11
View File
@@ -6,24 +6,31 @@ const SCHEMA_VERSION: String = "2.0"
const DEFAULT_PATH: String = "res://sandbox_theme.json"
const CONFIRMATION_DEFAULTS: Dictionary = {
"scenery_erase_size": [520, 208],
"padding": 18,
"body_gap": 10,
"padding": 22,
"body_gap": 12,
"footer_gap": 12,
"corner_radius": 16,
"corner_radius": 18,
"border_width": 2,
"title_font_size": 26,
"title_font_size": 28,
"message_font_size": 20,
"button_font_size": 20,
"button_height": 48,
"button_height": 52,
"button_min_width": 112,
"card_width": 560,
"button_radius": 12,
"button_border_width": 2,
"remove_button_width": 170,
"keep_button_width": 132,
"keep_button_width": 160,
"surface_color": "#202633FA",
"border_color": "#22C6FF",
"accent_color": "#22C6FF",
"border_color": "#667386",
"secondary_surface": "#293242",
"secondary_border": "#718096",
"focus_color": "#8BD9FF",
"backdrop_color": "#080D15B8",
"accent_color": "#8BD9FF",
"action_color": "#087DBA",
"danger_color": "#FF626B",
"danger_color": "#E66B75",
"danger_surface": "#44262D",
"danger_hover_surface": "#3B252C",
"danger_pressed_surface": "#4A252D"
}
@@ -35,7 +42,7 @@ const DEFAULT_CONFIG: Dictionary = {
"mode_colors": {"edit": "#22C6FF", "direct": "#FFB300", "play": "#33DD77", "guide": "#22C6FF"},
"effects": {"impact_wobble": {"duration": 0.48, "maximum_angle_degrees": 7.0, "sideways_offset": 4.0}},
"grid": {"snap_size": 15.0},
"chrome": {"style_defaults": {}, "top_bar": {"height": 64}, "status_bar": {"height": 38}, "mode_switcher": {"segment_min_width": 124}, "mode_frame": {"border_width": 3}, "mode_badge": {"corner_radius": 12, "padding": 10}, "timestamp_badge": {"corner_radius": 10, "padding": 8, "bg_color": "#171B24F2"}, "tooltip": {"bg_color": "#101010E6", "border_width": 1}, "dialogs": {"queue_size":[680,520], "rule_size":[720,560], "action_size":[560,390], "confirm_size":[620,300], "font_size":22, "message_font_size":26}},
"chrome": {"style_defaults": {}, "top_bar": {"height": 64}, "status_bar": {"height": 38}, "mode_switcher": {"segment_min_width": 124}, "mode_frame": {"border_width": 3}, "mode_badge": {"corner_radius": 12, "padding": 10}, "timestamp_badge": {"corner_radius": 10, "padding": 8, "bg_color": "#171B24F2"}, "tooltip": {"bg_color": "#101010E6", "border_width": 1}, "dialogs": {"queue_size":[680,520], "rule_size":[720,560], "action_size":[560,390], "confirm_size":[560,300], "font_size":22, "message_font_size":20}},
"popups": {"style_defaults": {"bg_color": "#202633FA", "border_color": "#FFFFFF33", "corner_radius": 12, "padding": 12}, "action_menu": {"font_size": 24}, "dialog": {"surface_color_size":[560,640], "surface_color_preview_size":[420,140], "surface_color_picker_min_size":[320,340], "action_min_target_size":48}, "asset_selector": {"backdrop_alpha": 0.55, "cell_size":[190,220], "thumbnail_size":[156,156], "surface_preview_size":[420,132], "look_cue_size":[80,42], "setup_gap":8, "setup_title_size":30, "setup_heading_size":26, "setup_choice_font_size":22, "setup_choice_height":68, "setup_choice_corner_radius":22, "setup_choice_border_width":2, "tab_font_size":22, "tab_height":60, "filter_chip_font_size":20, "filter_chip_height":48, "filter_chip_gap":8, "setup_button_font_size":20, "button_border_width":2, "footer_gap":16, "surface_corner_radius":14, "look_corner_radius":8, "corner_radius":16, "compact_swatch_size":42, "color_group_gap":8, "action_color":"#087DBA", "separator_color":"#AAB2C0A0"}},
"palette": {"style_defaults": {}, "dock_width": 116, "card_size": [96, 94], "icon_size": 30, "drag_threshold": 8, "selected_border_width": 3},
"stage_panels": {
@@ -136,7 +143,9 @@ func _apply_phase19_defaults() -> void:
func _apply_confirmation_defaults() -> void:
var popups: Dictionary = _config.get("popups", {}).duplicate(true)
popups["confirmation"] = CONFIRMATION_DEFAULTS.duplicate(true)
var configured: Variant = popups.get("confirmation", {})
var overrides: Dictionary = configured as Dictionary if configured is Dictionary else {}
popups["confirmation"] = _deep_merge(CONFIRMATION_DEFAULTS, overrides)
_config["popups"] = popups
func raw_config() -> Dictionary: