HammeritePropertyControl
Editor. Inherits HBoxContainer
One property's editing control, as the property panel expects to find it.
HammeritePropertyItem is the built-in implementation: a field chosen by the value's type, which is the right answer whenever the type is the interesting thing about the value. It is not always. An id has to name something that exists, and a type cannot say what; the set of legal values may not even be known until the panel is opened, because it is a directory or the map itself. So a game registers its own through HammeriteMapEditor.register_property_editor() and gets a control of its own in the row, provided it answers this much. The factory is called as factory(value, map, entity) each time the panel builds the row, and returns a new control; value is null when the selected entities disagree, and a null return falls back to the built-in control.
Properties
| Type | Name | Default |
|---|---|---|
Variant | value |
Methods
| Returns | Method |
|---|---|
Variant | get_value() abstract |
void | set_value(new_value) |
void | set_value_no_signal(new_value) abstract |
void | set_disabled(disabled: bool) abstract |
void | set_indeterminate(indeterminate: bool) abstract |
Signals
value_changed
signal value_changed(new_value)
The author edited the value. The panel writes new_value to every selected entity, and each emission is its own undo entry. set_value() emits it; set_value_no_signal() must not.
Property descriptions
value
var value: Variant
The value shown, through get_value() and set_value(): assigning it emits value_changed.
Method descriptions
get_value()
abstract func get_value() -> Variant
The value shown now. Keep its type that of the value the control was made with: the panel rebuilds the row when the type it reads back differs from the one it is about to write.
set_value()
func set_value(new_value) -> void
Show new_value and emit value_changed with it, as an author's edit would: through set_value_no_signal(), so a control writes only that. A debug build says so when what is read back afterwards is of another type than before, which has the panel rebuild the row.
set_value_no_signal()
abstract func set_value_no_signal(new_value) -> void
Set without emitting value_changed. The panel writing back what it has just read is not an edit, and treating it as one is an undo entry per selection.
set_disabled()
abstract func set_disabled(disabled: bool) -> void
Make the control read-only while disabled. Called on every refresh of the panel, with false as often as true.
set_indeterminate()
abstract func set_indeterminate(indeterminate: bool) -> void
Several things are selected and they do not agree, so there is no one value to show.