1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 15:39:49 +00:00
Pixelorama/src/Preferences/RestoreDefaultButton.gd

19 lines
501 B
GDScript3
Raw Normal View History

extends TextureButton
var setting_name: String
var value_type: String
var default_value
var node: Node
func _ready() -> void:
modulate = Global.modulate_icon_color
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)