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

TypeNameDefault
Variantvalue

Methods

ReturnsMethod
Variant_get_value() virtual required
void_set_disabled(disabled: bool) virtual required
void_set_indeterminate(indeterminate: bool) virtual required
void_set_value_no_signal(new_value) virtual required
voidset_disabled(disabled: bool)
voidset_indeterminate(indeterminate: bool)
voidset_value_no_signal(new_value)

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.

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.

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.

Method descriptions

_get_value()

func _get_value() -> Variant

Override to answer the value the control shows; value reads it.

_set_disabled()

func _set_disabled(disabled: bool) -> void

Override to make the control read-only while disabled; set_disabled() calls it.

_set_indeterminate()

func _set_indeterminate(indeterminate: bool) -> void

Override to show that the selected things disagree; set_indeterminate() calls it.

_set_value_no_signal()

func _set_value_no_signal(new_value) -> void

Override to show value without emitting value_changed; set_value_no_signal() and value call it.

set_disabled()

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()

func set_indeterminate(indeterminate: bool) -> void

Several things are selected and they do not agree, so there is no one value to show.

set_value_no_signal()

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.

Hammerite 2.0 · built from 6d57ab2d, 2026-10-17