2021-05-13 20:01:51 +02:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
|
print("[Settings#_ready]")
|
|
|
|
|
_translation()
|
2021-05-23 21:21:10 +02:00
|
|
|
_apply_settings_language()
|
|
|
|
|
_apply_settings_gyroscope()
|
|
|
|
|
_apply_settings_sound_ambiant()
|
2021-05-13 20:01:51 +02:00
|
|
|
|
|
|
|
|
## PRIVATE
|
|
|
|
|
func _translation():
|
2021-05-14 22:27:40 +02:00
|
|
|
$VBoxContainer/Langue/HBoxContainer/Label.text = tr("SETTINGS_LABEL_LANGUE")
|
|
|
|
|
$VBoxContainer/gyroscope/HBoxContainer/Label.text = tr("SETTINGS_LABEL_GYROSCOPE")
|
2021-05-13 20:01:51 +02:00
|
|
|
|
2021-05-23 21:21:10 +02:00
|
|
|
func _apply_settings_language():
|
|
|
|
|
$VBoxContainer/Langue/HBoxContainer/data.set_text(Global.get_setting_language())
|
2021-05-13 20:01:51 +02:00
|
|
|
|
2021-05-23 21:21:10 +02:00
|
|
|
func _apply_settings_gyroscope():
|
|
|
|
|
$VBoxContainer/gyroscope/HBoxContainer/data.set_pressed(Global.get_setting_gyrosocpe())
|
2021-05-13 20:01:51 +02:00
|
|
|
|
2021-05-23 21:21:10 +02:00
|
|
|
func _apply_settings_sound_ambiant():
|
|
|
|
|
$VBoxContainer/ambiant_sound/HBoxContainer/data.set_pressed(Global.get_setting_ambiant_sound())
|
2021-05-13 20:01:51 +02:00
|
|
|
|
|
|
|
|
func _on_gyroscope_pressed():
|
2021-05-23 21:21:10 +02:00
|
|
|
print("[Settings#_on_gyroscope_pressed] change value to database ...........")
|
|
|
|
|
Global.set_setting_gyroscope(int($VBoxContainer/gyroscope/HBoxContainer/data.pressed))
|
|
|
|
|
|
|
|
|
|
func _on_ambiant_sound_pressed():
|
|
|
|
|
print("[Settings#_on_ambiant_sound_pressed] change value to database ...........")
|
|
|
|
|
Global.set_setting_ambiant_sound(int($VBoxContainer/ambiant_sound/HBoxContainer/data.pressed))
|