Skip to content

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 ​

Labeltype_label
OptionButtoncategory_dropdown
OptionButtonspecific_dropdown
Labeldescription_label
RichTextLabelrich_text_label
DialogManagerdialog_manager
Dictionarytype_dictionary{}
Stringcurrent_type_category"" # "trigger", "condition", "action"
Dictionaryselected_type_data{}
Dictionaryparam_values{}
Dictionaryparam_types{}
booledit_modefalse
boolshow_dropdownstrue

Methods ​

voidsetup( type_category: String, types_dict: Dictionary = {} )
voidsetup_for_edit( type_category: String, instance: Resource )
Dictionaryget_selected_type_data()
Dictionaryget_param_values()
boolhas_selection()
voidset_dialog_manager( manager: DialogManager )

Signals ​

type_configured( type_data: Dictionary, param_values: Dictionary ) ​

param_changed( param_name: String, new_value ) ​

Constants ​

  • Dictionary SPECIAL_SELECTORS = {
  • Dictionary TYPE_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