From fe74604d96d1d28b811ebe45d1d06356cf79bc6f Mon Sep 17 00:00:00 2001 From: Hop311 Date: Sat, 12 Aug 2023 17:56:14 +0100 Subject: string_view changes + general cleanup --- game/src/Game/Autoload/GuiScale.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'game/src/Game/Autoload/GuiScale.gd') 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()) -- cgit v1.2.3-56-ga3b1