Skip to main content

EditorSproutyDialogsDictionaryField

Inherits: VBoxContainer

Description

This component is used to create a field for display a dictionary. It allows the user to add, remove and modify items in the dictionary.

Methods

Return TypeMethod
Dictionaryget_dictionary()
Arrayget_keys()
Dictionaryget_items_values()
Dictionaryget_items_types()
voidset_dictionary(items: Dictionary)
voidclear_dictionary()

Signals

signal modified

Emitted when the dictionary is modified.


signal dictionary_changed(dictionary: Dictionary)

Emitted when the dictionary is changed.


signal item_changed(item: Dictionary)

Emitted when an item in the dictionary is changed.


signal item_added(item: Dictionary)

Emitted when a new item is added to the dictionary.


signal item_removed(item: Dictionary)

Emitted when an item is removed from the dictionary.


Method Descriptions

func get_dictionary() -> Dictionary

Return the current dictionary of items data. Each item is a dictionary with the following structure:

{
"key": String,
"type": int,
"value": Variant,
"metadata": Dictionary
}

func get_keys() -> Array

Return the keys of the dictionary items.


func get_items_values() -> Dictionary

Return the values of the dictionary items.


func get_items_types() -> Dictionary

Return the types of the dictionary items.


func set_dictionary(items: Dictionary) -> void

Set the array component with a given dictionary.


func clear_dictionary() -> void

Clear the dictionary items.