aboutsummaryrefslogtreecommitdiff
path: root/game/src/OptionMenu/SettingNodes/SettingOptionButton.gd
blob: 46fc825bd4796d900b30d0e83a7029c4db37d566 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)