stick-the-quick/ui/AbstractConfigMenu.gd

57 lines
1.4 KiB
GDScript3
Raw Normal View History

class_name AbstractConfigMenu extends Control
@onready var _button_ok := (
$'OuterMargin/Content/ActualMenu/Nav/OK' as Button
)
@onready var _button_apply := (
$'OuterMargin/Content/ActualMenu/Nav/Apply' as Button
)
@onready var _button_cancel := (
$'OuterMargin/Content/ActualMenu/Nav/Cancel' as Button
)
@onready var _button_restore_defaults := (
$'OuterMargin/Content/ActualMenu/Nav/RestoreDefaults' as Button
)
func _ready() -> void:
_button_ok.pressed.connect(_on_ok)
_button_apply.pressed.connect(_on_apply)
_button_cancel.pressed.connect(_on_cancel)
_button_restore_defaults.pressed.connect(_on_restore_defaults)
_connect_signals()
_pull_settings()
_button_apply.disabled = true
var args := UI.Args(self)
args[&'on_confirm'] = _push_settings
args[&'on_cancel'] = _revert_changes
func _on_ok() -> void:
_push_settings()
UI.Return(self, true)
func _on_apply() -> void:
_push_settings()
_button_apply.disabled = true
func _on_cancel() -> void:
_revert_changes()
UI.Return(self, false)
func _on_restore_defaults() -> void:
_restore_defaults()
func _connect_signals() -> void:
push_warning("Abstract method called")
func _pull_settings() -> void:
push_warning("Abstract method called")
func _push_settings() -> void:
push_warning("Abstract method called")
func _revert_changes() -> void:
push_warning("Abstract method called")
func _restore_defaults() -> void:
push_warning("Abstract method called")