Skip to main content

EditorSproutyDialogsVariableGroup

Inherits: Container

Description

Component that represents a group of variables in the variable editor panel. It allows the user to set the group name and color, and contains variable items. Groups can be nested and support drag-and-drop functionality.

Properties

TypeNameDefault
Nodeparent_groupnull
boolnew_itemtrue
EditorUndoRedoManagerundo_redonull

Methods

Return TypeMethod
Stringget_item_path()
Stringget_item_name()
voidset_item_name(new_name: String)
Colorget_color()
voidset_color(new_color: Color)
Arrayget_items()
voidadd_item(item: Node)
voidshow_items()
voidupdate_path_tooltip()
voidmark_as_modified(was_modified: bool)
voidclear_modified_state()
voidshow_drop_highlight(above: bool)

Signals

signal modified(modified: bool)

Emitted when the group is modified.


signal group_renamed(old_name: String, new_name: String)

Emitted when the group is renamed.


signal remove_pressed

Emitted when the remove button is pressed.


Property Descriptions

var parent_group : Node = null

Parent group of this group. Can be another EditorSproutyDialogsVariableGroup or the main container.


var new_item : bool = true

Flag to indicate that the group has just been created.


var undo_redo : EditorUndoRedoManager

UndoRedo manager for handling undo/redo operations.


Method Descriptions

func get_item_path() -> String

Return the group path in the variables tree. For nested groups, returns the full path (e.g., "ParentGroup/ChildGroup").


func get_item_name() -> String

Returns the group name.


func set_item_name(new_name: String) -> void

Set the group name and update the path tooltip.


func get_color() -> Color

Returns the group color.


func set_color(new_color: Color) -> void

Set the group color which affects the border and visual appearance.


func get_items() -> Array

Returns all items in the group (both variable items and nested groups).


func add_item(item: Node) -> void

Add an item to the group. The item can be a EditorSproutyDialogsVariableItem or another EditorSproutyDialogsVariableGroup.


func show_items() -> void

Show all the items in the group.


func update_path_tooltip() -> void

Update the tooltip with the current group path. Also updates tooltips for all child items.


func mark_as_modified(was_modified: bool) -> void

Mark the group as modified. Shows a visual indicator when modified.


func clear_modified_state() -> void

Clear the modified state of the group and all its items.


func show_drop_highlight(above: bool) -> void

Show the drop highlight for drag-and-drop operations. The highlight appears above or below based on the parameter.