Skip to content

UnifiedResourceDialog ​

Inherits: AcceptDialog

Unified dialog for creating and editing resources with dynamic UI generation Similar to EventTypeSelector but for creating/editing resources like Rewards and Requirements

Description ​

Uses property name mapping to determine which UI control to create Automatically scans directories for resource types Builds UI dynamically based on exported properties

Variables ​

OptionButtonresource_type_option
VBoxContainerdynamic_container
Resourcecurrent_resource
boolis_editingfalse
Dictionaryparam_values{} # Property name -> current value
Stringcurrent_type_key""
Stringcurrent_class_name""
Dictionarycurrent_type_info{} # Store current type info for single-type mode
DialogManagerdialog_manager
Stringresource_category"" # "reward" or "requirement"
Array[Dictionary]scanned_types[]

Methods ​

voidsetup_managers( p_dialog_manager: DialogManager )
voidsetup( category: String )
voidsetup_single_type( resource_script: Script, display_name: String = "" )
voidedit_resource( resource: Resource, is_single_type: bool = false )

Signals ​

resource_configured( resource: Resource ) ​

Constants ​

  • Dictionary TYPE_PATHS = {
  • Dictionary PROJECT_PATHS = { - Where a project keeps its own types of a category (the addon folder is overwritten by updates, these never are). Missing folders are fine
  • Dictionary PROPERTY_SELECTORS = {

Variable descriptions ​

OptionButton resource_type_option ​

No description yet.

VBoxContainer dynamic_container ​

No description yet.

Resource current_resource ​

No description yet.

bool is_editing = false ​

No description yet.

Dictionary param_values = # Property name -> current value ​

No description yet.

String current_type_key = "" ​

No description yet.

String current_class_name = "" ​

No description yet.

Dictionary current_type_info = # Store current type info for single-type mode ​

No description yet.

DialogManager dialog_manager ​

No description yet.

String resource_category = "" # "reward" or "requirement" ​

No description yet.

Array[Dictionary] scanned_types = [] ​

No description yet.

Method descriptions ​

void setup_managers( p_dialog_manager: DialogManager ) ​

No description yet.

void setup( category: String ) ​

Setup for creating a new resource of a specific category (reward/requirement)

void setup_single_type( resource_script: Script, display_name: String = "" ) ​

Setup for creating a new resource of a specific single type (e.g., CombatReaction, EncounterReaction) This is for resources that don't have multiple types to choose from

void edit_resource( resource: Resource, is_single_type: bool = false ) ​

Setup for editing an existing resource