diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-12-23 05:01:51 +0100 |
---|---|---|
committer | George L. Albany <Megacake1234@gmail.com> | 2023-12-24 04:52:36 +0100 |
commit | b6413251a866c76538869b84ed1c9b9852f7c507 (patch) | |
tree | 1b99c935438692bb2ebadeac412b990c82089b65 /game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd | |
parent | 50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff) |
Apply type hints to menu scripts
Diffstat (limited to 'game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd')
-rw-r--r-- | game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd b/game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd index 079dd4d..a972ed6 100644 --- a/game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd +++ b/game/src/Game/Menu/OptionMenu/SettingNodes/SettingOptionButton.gd @@ -21,13 +21,13 @@ var default_selected : int = -1: func _valid_index(index : int) -> bool: return 0 <= index and index < item_count -func _get_value_for_file(select_value : int): +func _get_value_for_file(select_value : int) -> Variant: if _valid_index(select_value): return select_value else: return null -func _set_value_from_file(load_value) -> void: +func _set_value_from_file(load_value : Variant) -> void: match typeof(load_value): TYPE_INT: if _valid_index(load_value): @@ -50,11 +50,11 @@ func _set_value_from_file(load_value) -> void: func _setup_button() -> void: pass -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) - item_selected.connect(func(index : int): option_selected.emit(index, true)) + item_selected.connect(func(index : int) -> void: option_selected.emit(index, true)) _setup_button() if not _valid_index(default_selected) or selected == -1: var msg := "Failed to generate any valid %s %s options." % [setting_name, section_name] |