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/GuiScaleSelector.gd | |
parent | 50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff) |
Apply type hints to menu scripts
Diffstat (limited to 'game/src/Game/Menu/OptionMenu/GuiScaleSelector.gd')
-rw-r--r-- | game/src/Game/Menu/OptionMenu/GuiScaleSelector.gd | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/game/src/Game/Menu/OptionMenu/GuiScaleSelector.gd b/game/src/Game/Menu/OptionMenu/GuiScaleSelector.gd index 42be5e0..3be8c2c 100644 --- a/game/src/Game/Menu/OptionMenu/GuiScaleSelector.gd +++ b/game/src/Game/Menu/OptionMenu/GuiScaleSelector.gd @@ -17,7 +17,7 @@ func _sync_guiscales(to_select : float = GuiScale.get_current_guiscale()) -> voi clear() default_selected = -1 selected = -1 - for guiscale_value in GuiScale.get_guiscale_value_list(): + for guiscale_value : float in GuiScale.get_guiscale_value_list(): add_item(GuiScale.get_guiscale_display_name(guiscale_value)) set_item_metadata(item_count - 1, guiscale_value) @@ -33,7 +33,7 @@ func _sync_guiscales(to_select : float = GuiScale.get_current_guiscale()) -> voi if selected == -1: selected = default_selected -func _setup_button(): +func _setup_button() -> void: if default_value <= 0: default_value = ProjectSettings.get_setting("display/window/stretch/scale") GuiScale.add_guiscale(default_value, &"default") @@ -45,7 +45,7 @@ func _get_value_for_file(select_value : int): else: return null -func _set_value_from_file(load_value): +func _set_value_from_file(load_value : Variant) -> void: if typeof(load_value) == TYPE_FLOAT: var target_guiscale : float = load_value selected = _find_guiscale_index_by_value(target_guiscale) @@ -56,7 +56,7 @@ func _set_value_from_file(load_value): push_error("Setting value '%s' invalid for setting [%s] %s" % [load_value, section_name, setting_name]) selected = default_selected -func _on_option_selected(index : int, by_user : bool): +func _on_option_selected(index : int, by_user : bool) -> void: if _valid_index(index): GuiScale.set_guiscale(get_item_metadata(index)) else: |