@tool
extends CheckBox
## Checkbox which updates its label based on check state.

@export var true_text := "UI_ON":
	set(value):
		true_text = value
		_refresh()

@export var false_text := "UI_OFF":
	set(value):
		false_text = value
		_refresh()


func _ready() -> void:
	_refresh()


func _set_text(value: bool) -> void:
	text = true_text if value else false_text


func _refresh() -> void:
	_set_text(button_pressed)


func _on_toggled(toggled_on: bool) -> void:
	_set_text(toggled_on)
