aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-12-24 19:23:18 +0100
committer GitHub <noreply@github.com>2023-12-24 19:23:18 +0100
commitd26c990d9a5596a3ef3b32ba1cb0f99950cd6d34 (patch)
tree1b99c935438692bb2ebadeac412b990c82089b65 /game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd
parent50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff)
parentb6413251a866c76538869b84ed1c9b9852f7c507 (diff)
Merge pull request #178 from Spartan322/add-menu-type-hints
Diffstat (limited to 'game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd')
-rw-r--r--game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd10
1 files changed, 5 insertions, 5 deletions
diff --git a/game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd b/game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd
index 6fa30ed..a728ba0 100644
--- a/game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd
+++ b/game/src/Game/Menu/OptionMenu/SettingNodes/SettingHSlider.gd
@@ -10,14 +10,14 @@ var setting_name : String = "setting_hslider"
@export
var default_value : float = 0
-func _ready():
+func _ready() -> void:
Events.Options.load_settings.connect(load_setting)
Events.Options.save_settings.connect(save_setting)
Events.Options.reset_settings.connect(reset_setting)
-func load_setting(file : ConfigFile):
+func load_setting(file : ConfigFile) -> void:
if file == null: return
- var load_value = file.get_value(section_name, setting_name, default_value)
+ var load_value : Variant = file.get_value(section_name, setting_name, default_value)
match typeof(load_value):
TYPE_FLOAT, TYPE_INT:
if value == load_value: value_changed.emit(value)
@@ -33,9 +33,9 @@ func load_setting(file : ConfigFile):
push_error("Setting value '%s' invalid for setting [%s] \"%s\"" % [load_value, section_name, setting_name])
value = default_value
-func save_setting(file : ConfigFile):
+func save_setting(file : ConfigFile) -> void:
if file == null: return
file.set_value(section_name, setting_name, value)
-func reset_setting():
+func reset_setting() -> void:
value = default_value