31 lines
1.1 KiB
GDScript
31 lines
1.1 KiB
GDScript
extends Node
|
|
|
|
func _ready():
|
|
print("[Settings#_ready]")
|
|
_translation()
|
|
_apply_settings_language()
|
|
_apply_settings_gyroscope()
|
|
_apply_settings_sound_ambient()
|
|
|
|
## PRIVATE
|
|
func _translation():
|
|
$VBoxContainer/Langue/HBoxContainer/Label.text = tr("SETTINGS_LABEL_LANGUE")
|
|
$VBoxContainer/gyroscope/HBoxContainer/Label.text = tr("SETTINGS_LABEL_GYROSCOPE")
|
|
|
|
func _apply_settings_language():
|
|
$VBoxContainer/Langue/HBoxContainer/data.set_text(Global.get_setting_language())
|
|
|
|
func _apply_settings_gyroscope():
|
|
$VBoxContainer/gyroscope/HBoxContainer/data.set_pressed(Global.get_setting_gyrosocpe())
|
|
|
|
func _apply_settings_sound_ambient():
|
|
$VBoxContainer/ambient_sound/HBoxContainer/data.set_pressed(Global.get_setting_ambient_sound())
|
|
|
|
func _on_gyroscope_pressed():
|
|
print("[Settings#_on_gyroscope_pressed] change value to database ...........")
|
|
Global.set_setting_gyroscope(int($VBoxContainer/gyroscope/HBoxContainer/data.pressed))
|
|
|
|
func _on_ambient_sound_pressed():
|
|
print("[Settings#_on_ambient_sound_pressed] change value to database ...........")
|
|
Global.set_setting_ambient_sound(int($VBoxContainer/ambient_sound/HBoxContainer/data.pressed))
|