PopochiuDialogOption
Inherits: Resource
Description
Represents a single selectable option within a PopochiuDialog.
Options can be shown or hidden, enabled or disabled, and track whether they have been used.
Properties
| Type | Name | Default |
|---|---|---|
| Variant | always_on | false |
| Variant | disabled | false |
| Variant | id | "" |
| Variant | script_name | "" |
| Variant | text | "" |
| Variant | used | false |
| Variant | used_times | 0 |
| Variant | visible | true |
Methods
| Return Type | Method |
|---|---|
| void | _on_selected() virtual |
| void | configure(config: Dictionary) |
| void | set_always_on(v) |
| void | set_id(value: String) |
| void | set_text(v) |
| void | turn_off() |
| void | turn_off_forever() |
| void | turn_on() |
Property Descriptions
always_on
@export var always_on = false
Whether this option should be always rendered as not previously selected.
disabled
@export var disabled = false
Whether this option is disabled. If true, the option won't be rendered.
id
@export var id = ""
- Setter:
set_id
The identifier of the option. Use it when scripting.
script_name
var script_name = ""
Stores the same value of the id property.
text
@export var text = ""
The text to show on screen for the option.
used
var used = false
Whether the option has ever been selected. If true, the option's text will
be shown differently in the options menu to indicate it was already clicked.
used_times
var used_times = 0
The number of times this options has been clicked.
visible
@export var visible = true
The icon to show on screen for the option. Whether this option is visible.
Method Descriptions
_on_selected
func _on_selected() -> void
This is a virtual method. Override it in your subclass.
Called when this option is selected.
configure
func configure(config: Dictionary) -> void
set_always_on
func set_always_on(v)
set_id
func set_id(value: String) -> void
set_text
func set_text(v)
turn_off
func turn_off() -> void
Makes the option invisible.
turn_off_forever
func turn_off_forever() -> void
Disables the option permanently by setting disabled to true.
turn_on
func turn_on() -> void
Makes the option visible. Has no effect if the option is disabled.