DynamicDictionaryEditor ​
Inherits: VBoxContainer
Reusable component for editing dictionaries with add/edit/remove functionality Supports items (id -> quantity) and currency (id -> amount) entries
Description ​
Usage Example: var editor = DynamicDictionaryEditor.new() editor.setup(dialog_manager, "items", "item") # For items dictionary editor.setup(dialog_manager, "currency", "currency") # For currency dictionary editor.dictionary_changed.connect(_on_inventory_changed)
Variables ​
DialogManager | dialog_manager | |
String | dictionary_key | "items" |
String | database_type | "item" |
String | entry_name_singular | "Item" |
String | entry_name_plural | "Items" |
Dictionary | current_dictionary | {} |
HBoxContainer | header_row | |
Label | header_label | |
Button | add_button | |
VBoxContainer | entries_container | |
Label | empty_label |
Methods ​
void | setup( p_dialog_manager: DialogManager, p_dictionary_key: String = "items", p_database_type: String = "item" ) |
void | load_dictionary( dictionary: Dictionary ) |
Dictionary | get_dictionary() |
bool | is_valid() |
Array[String] | get_validation_errors() |
Signals ​
dictionary_changed( new_dictionary: Dictionary ) ​
Variable descriptions ​
DialogManager dialog_manager ​
========== CONFIGURATION ==========
String dictionary_key = "items" ​
"items" or "currency"
String database_type = "item" ​
"item" or "currency"
String entry_name_singular = "Item" ​
"Item" or "Currency"
String entry_name_plural = "Items" ​
"Items" or "Currencies"
Dictionary current_dictionary = ​
========== STATE ==========
HBoxContainer header_row ​
========== UI COMPONENTS ==========
Label header_label ​
No description yet.
Button add_button ​
No description yet.
VBoxContainer entries_container ​
No description yet.
Label empty_label ​
No description yet.
Method descriptions ​
void setup( p_dialog_manager: DialogManager, p_dictionary_key: String = "items", p_database_type: String = "item" ) ​
No description yet.
void load_dictionary( dictionary: Dictionary ) ​
========== PUBLIC API ==========
Dictionary get_dictionary() ​
No description yet.
bool is_valid() ​
========== VALIDATION ==========
Array[String] get_validation_errors() ​
No description yet.