extends HBoxContainer signal value_changed(value: Variant) var label := "": set(value): $Label.text = str(value) name = str(value) get(): return $Label.text var value: Variant = "": set(new_value): value = new_value if typeof(new_value) == TYPE_BOOL: $TextEdit.visible = false $CheckBox.visible = true $CheckBox.set_pressed_no_signal(new_value) else: $TextEdit.visible = true $CheckBox.visible = false $TextEdit.text = str(new_value) get(): if typeof(value) == TYPE_BOOL: return $CheckBox.button_pressed else: return $TextEdit.text var disabled := false: set(value): disabled = value $TextEdit.editable = !value $CheckBox.disabled = value func _on_text_edit_text_changed(new_text: String) -> void: value_changed.emit(new_text) func _on_check_box_toggled(_toggled_on: bool) -> void: value_changed.emit($CheckBox.button_pressed)