aboutsummaryrefslogtreecommitdiff
path: root/game/src/OptionMenu/SettingNodes/SettingHSlider.gd
diff options
context:
space:
mode:
Diffstat (limited to 'game/src/OptionMenu/SettingNodes/SettingHSlider.gd')
-rw-r--r--game/src/OptionMenu/SettingNodes/SettingHSlider.gd20
1 files changed, 20 insertions, 0 deletions
diff --git a/game/src/OptionMenu/SettingNodes/SettingHSlider.gd b/game/src/OptionMenu/SettingNodes/SettingHSlider.gd
new file mode 100644
index 0000000..da9348f
--- /dev/null
+++ b/game/src/OptionMenu/SettingNodes/SettingHSlider.gd
@@ -0,0 +1,20 @@
+extends HSlider
+class_name SettingHSlider
+
+@export
+var section_name : String = "Setting"
+
+@export
+var setting_name : String = "SettingHSlider"
+
+@export
+var default_value : float = 0
+
+func load_setting(file : ConfigFile):
+ value = file.get_value(section_name, setting_name, default_value)
+
+func save_setting(file : ConfigFile):
+ file.set_value(section_name, setting_name, value)
+
+func reset_setting():
+ value = default_value