diff options
Diffstat (limited to 'game/src/OptionMenu/SettingNodes/SettingOptionButton.gd')
-rw-r--r-- | game/src/OptionMenu/SettingNodes/SettingOptionButton.gd | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd b/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd new file mode 100644 index 0000000..46fc825 --- /dev/null +++ b/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd @@ -0,0 +1,22 @@ +extends OptionButton +class_name SettingOptionButton + +@export +var section_name : String = "Setting" + +@export +var setting_name : String = "SettingOptionMenu" + +@export +var default_value : int = 0 + +func load_setting(file : ConfigFile): + selected = file.get_value(section_name, setting_name, default_value) + item_selected.emit(selected) + +func save_setting(file : ConfigFile): + file.set_value(section_name, setting_name, selected) + +func reset_setting(): + selected = default_value + item_selected.emit(selected) |