Skip to main content

EditorSproutyDialogsDictionaryFieldItem

Inherits: HBoxContainer

Description

This component is an item field from the dictionary field. It allows the user to modify the item key, value type and value.

Methods

Return TypeMethod
Dictionaryget_item_data()
Variantget_value()
Variantget_type()
Dictionaryget_metadata()
Stringget_key()
voidset_key(key: String)
voidset_value(value: Variant, type: int, metadata: Dictionary)
voidset_type(type: int, metadata: Dictionary)

Signals

signal modified

Emitted when the item is modified.


signal item_changed(item: Dictionary)

Emitted when the item is changed.


signal item_removed(index: int)

Emitted when the remove button is pressed.


signal key_modified(key: String)

Emitted when the item key is modified.


Method Descriptions

func get_item_data() -> Dictionary

Returns the item data as a dictionary with the following structure:

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

func get_value() -> Variant

Returns the current value of the item.


func get_type() -> Variant

Returns the current type of the item.


func get_metadata() -> Dictionary

Returns the current metadata of the item type.


func get_key() -> String

Returns the current key of the item.


func set_key(key: String) -> void

Set the current key of the item.


func set_value(value: Variant, type: int, metadata: Dictionary) -> void

Set the current value of the item along with its type and metadata.


func set_type(type: int, metadata: Dictionary) -> void

Set the variable type and metadata for the item.