EventTypeSelector ​
Inherits: VBoxContainer
Reusable component for selecting and configuring event types (triggers/conditions/actions)
Description ​
REFACTORED VERSION:
- Uses PropertySelectorRegistry for database type mappings (single source of truth)
- Uses dedicated ParameterPopup classes instead of inline popup creation
- Reduced from ~1300 lines to ~700 lines
- Only SPECIAL_SELECTORS dictionary remains for non-database types
- All database formatting delegated to PropertySelectorRegistry
This component provides:
- Category and specific type dropdowns
- RichTextLabel with clickable parameters
- All parameter extraction and popup handling
- Can be embedded in any popup/panel
Usage: var selector = EventTypeSelector.new() add_child(selector) selector.setup("trigger", trigger_types_dict) selector.type_configured.connect(_on_type_configured)
Variables ​
Label | type_label | |
OptionButton | category_dropdown | |
OptionButton | specific_dropdown | |
Label | description_label | |
RichTextLabel | rich_text_label | |
DialogManager | dialog_manager | |
Dictionary | type_dictionary | {} |
String | current_type_category | "" # "trigger", "condition", "action" |
Dictionary | selected_type_data | {} |
Dictionary | param_values | {} |
Dictionary | param_types | {} |
bool | edit_mode | false |
bool | show_dropdowns | true |
Methods ​
void | setup( type_category: String, types_dict: Dictionary = {} ) |
void | setup_for_edit( type_category: String, instance: Resource ) |
Dictionary | get_selected_type_data() |
Dictionary | get_param_values() |
bool | has_selection() |
void | set_dialog_manager( manager: DialogManager ) |
Signals ​
type_configured( type_data: Dictionary, param_values: Dictionary ) ​
param_changed( param_name: String, new_value ) ​
Constants ​
DictionarySPECIAL_SELECTORS ={DictionaryTYPE_PATHS ={
Variable descriptions ​
Label type_label ​
No description yet.
OptionButton category_dropdown ​
No description yet.
OptionButton specific_dropdown ​
No description yet.
Label description_label ​
No description yet.
RichTextLabel rich_text_label ​
No description yet.
DialogManager dialog_manager ​
No description yet.
Dictionary type_dictionary = ​
No description yet.
String current_type_category = "" # "trigger", "condition", "action" ​
No description yet.
Dictionary selected_type_data = ​
No description yet.
Dictionary param_values = ​
No description yet.
Dictionary param_types = ​
No description yet.
bool edit_mode = false ​
No description yet.
bool show_dropdowns = true ​
No description yet.
Method descriptions ​
void setup( type_category: String, types_dict: Dictionary = {} ) ​
Setup for selecting a new type - scans dynamically
void setup_for_edit( type_category: String, instance: Resource ) ​
Setup for editing an existing instance
Dictionary get_selected_type_data() ​
Get current selection data
Dictionary get_param_values() ​
Get current parameter values
bool has_selection() ​
Check if a type is selected
void set_dialog_manager( manager: DialogManager ) ​
Set dialog manager for catalog/dialog selections