aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Autoload
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-08-12 18:56:14 +0200
committer Hop311 <hop3114@gmail.com>2023-08-12 18:56:14 +0200
commitfe74604d96d1d28b811ebe45d1d06356cf79bc6f (patch)
treef57c608c657681666c29e28bf1283833767cb7ea /game/src/Game/Autoload
parent4c43951e70aaa2e7265d3b3f3c4964c048b9328d (diff)
string_view changes + general cleanup
Diffstat (limited to 'game/src/Game/Autoload')
-rw-r--r--game/src/Game/Autoload/GuiScale.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/game/src/Game/Autoload/GuiScale.gd b/game/src/Game/Autoload/GuiScale.gd
index afd73df..d364ff5 100644
--- a/game/src/Game/Autoload/GuiScale.gd
+++ b/game/src/Game/Autoload/GuiScale.gd
@@ -26,7 +26,7 @@ func _ready():
func has_guiscale(guiscale_value : float) -> bool:
return guiscale_value in _guiscales
-
+
func add_guiscale(guiscale_value: float, guiscale_name: StringName=&"") -> bool:
if has_guiscale(guiscale_value): return true
var scale_dict := { value = guiscale_value }
@@ -39,24 +39,24 @@ func add_guiscale(guiscale_value: float, guiscale_name: StringName=&"") -> bool:
return false
_guiscales[guiscale_value] = scale_dict
return true
-
+
#returns floats
func get_guiscale_value_list() -> Array:
var list := _guiscales.keys()
list.sort_custom(func(a, b): return a > b)
return list
-
+
func get_guiscale_display_name(guiscale_value : float) -> StringName:
return _guiscales.get(guiscale_value, {display_name = &"unknown gui scale"}).display_name
func get_current_guiscale() -> float:
return get_tree().root.content_scale_factor
-
+
func set_guiscale(guiscale:float) -> void:
print("New GUI scale: %f" % guiscale)
if not has_guiscale(guiscale):
push_warning("Setting GUI Scale to non-standard value %sx" % [guiscale])
get_tree().root.content_scale_factor = guiscale
-
+
func reset_guiscale() -> void:
set_guiscale(get_current_guiscale())