2020-07-29 00:16:02 +00:00
|
|
|
extends TextureButton
|
|
|
|
|
2021-11-25 12:48:30 +00:00
|
|
|
var setting_name: String
|
|
|
|
var value_type: String
|
2020-07-29 00:16:02 +00:00
|
|
|
var default_value
|
2021-11-25 12:48:30 +00:00
|
|
|
var node: Node
|
2020-07-29 00:16:02 +00:00
|
|
|
|
|
|
|
|
2020-07-29 00:36:19 +00:00
|
|
|
func _ready() -> void:
|
2021-06-04 18:44:05 +00:00
|
|
|
modulate = Global.modulate_icon_color
|
2020-07-29 00:36:19 +00:00
|
|
|
|
|
|
|
|
2020-07-29 00:16:02 +00:00
|
|
|
func _on_RestoreDefaultButton_pressed() -> void:
|
|
|
|
Global.set(setting_name, default_value)
|
|
|
|
Global.config_cache.set_value("preferences", setting_name, default_value)
|
|
|
|
Global.preferences_dialog.preference_update(setting_name)
|
|
|
|
Global.preferences_dialog.disable_restore_default_button(self, true)
|
|
|
|
node.set(value_type, default_value)
|