aboutsummaryrefslogtreecommitdiff
path: root/client/global.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/global.gd')
-rw-r--r--client/global.gd20
1 files changed, 5 insertions, 15 deletions
diff --git a/client/global.gd b/client/global.gd
index 2a98f287..9c6e75c4 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -19,16 +19,6 @@ extends Node
signal settings_changed()
-# Each setting contains a dictionary with the following keys:
-# "type": The type of the setting. Can be "toggle", "line", "range", "dropdown", or "dropdown_preset"
-# "value": The value of the setting. When using "dropdown", this contains an int
-# as the index for the respecitve element in the "options" array.
-# (Optional: Only when type "dropdown_preset") "apply": A dictionary to override all other settings.
-# (Optional: Only when type "range") "min" and "max": The min and max values.
-# "description": The setting name displayed in the settings menu.
-# (Optional: Only when type "dropdown") "options": An array which contains all
-# possible values.
-
var default_profile := {
"username": "Giovanni",
"character": 0,
@@ -39,7 +29,7 @@ var languages := [tr("System default"), "en", "de"]
var default_settings := {
"language": DropdownSetting.new(tr("Language"), 0, languages),
- "fullscreen": ToggleSetting.new(tr("Fullscreen"), false),
+ "fullscreen": DropdownSetting.new(tr("Fullscreen"), 0, [tr("Keep"), tr("Always"), tr("Never")]),
"touch_controls": ToggleSetting.new(tr("Enable touch screen conrols"), DisplayServer.is_touchscreen_available()),
"interpolate_camera_rotation": ToggleSetting.new(tr("Interpolate the camera rotation"), true),
"invert_camera": ToggleSetting.new(tr("Invert camera movement"), false),
@@ -118,10 +108,10 @@ func update_language():
TranslationServer.set_locale(OS.get_locale_language())
func update_fullscreen():
- if get_setting("fullscreen"):
- DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
- elif DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
- DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
+ match get_setting("fullscreen"):
+ 0: pass
+ 1: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
+ 2: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
func save_profile():
save_dict("user://profile", profile)