1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00
Pixelorama/src/Preferences/RestoreDefaultButton.gd
Emmanouil Papadeas 3ef73eacea Expose GLES driver to the preferences
Users can now change from GLES2 to GLES3 and vice versa. The change requires a restart of Pixelorama to take effect. Does not have any effect if Pixelorama is being run from the Godot editor. I suppose we should add logic that detects if GLES3 is even supported in the first place in that device before allowing it as an option, but at least I enabled GLES2 fallback in the project settings, so it *should* fall back to GLES2.
2022-11-29 19:58:24 +02:00

21 lines
573 B
GDScript

extends TextureButton
var setting_name: String
var value_type: String
var default_value
var require_restart := false
var node: Node
func _ready() -> void:
modulate = Global.modulate_icon_color
func _on_RestoreDefaultButton_pressed() -> void:
Global.set(setting_name, default_value)
if not require_restart:
Global.config_cache.set_value("preferences", setting_name, default_value)
Global.preferences_dialog.preference_update(setting_name, require_restart)
Global.preferences_dialog.disable_restore_default_button(self, true)
node.set(value_type, default_value)