diff options
author | hop311 <hop3114@gmail.com> | 2024-03-03 17:39:08 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-03-03 17:39:08 +0100 |
commit | e2077a0d93be8b2dd48f1ee680809420f1f690d7 (patch) | |
tree | bacc8f4094eff5514a94b3852e9cec9c28391669 /game/src/Game/Menu/OptionMenu/ResolutionSelector.gd | |
parent | 9ee1940ac3d15aa4c0a87b84d1c4ab8958184f63 (diff) |
Add types to GDScript for-loop variablesfor-loop-types
Diffstat (limited to 'game/src/Game/Menu/OptionMenu/ResolutionSelector.gd')
-rw-r--r-- | game/src/Game/Menu/OptionMenu/ResolutionSelector.gd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/game/src/Game/Menu/OptionMenu/ResolutionSelector.gd b/game/src/Game/Menu/OptionMenu/ResolutionSelector.gd index 1a21211..dfaae37 100644 --- a/game/src/Game/Menu/OptionMenu/ResolutionSelector.gd +++ b/game/src/Game/Menu/OptionMenu/ResolutionSelector.gd @@ -6,7 +6,7 @@ extends SettingRevertButton @export var default_value : Vector2i = Resolution.error_resolution func _find_resolution_index_by_value(value : Vector2i) -> int: - for item_index in item_count: + for item_index : int in item_count: if get_item_metadata(item_index) == value: return item_index return -1 @@ -16,7 +16,7 @@ func _sync_resolutions() -> void: default_selected = -1 selected = -1 var current_resolution := Resolution.get_current_resolution() - for resolution_value in Resolution.get_resolution_value_list(): + for resolution_value : Vector2i in Resolution.get_resolution_value_list(): # Placeholder option text awaiting _update_resolution_options_text() add_item(str(resolution_value)) set_item_metadata(item_count - 1, resolution_value) @@ -40,7 +40,7 @@ func _notification(what : int) -> void: _update_resolution_options_text() func _update_resolution_options_text() -> void: - for index in get_item_count(): + for index : int in get_item_count(): var resolution_value : Vector2i = get_item_metadata(index) var format_dict := { "width": resolution_value.x, "height": resolution_value.y } format_dict["name"] = tr("OPTIONS_VIDEO_RESOLUTION_{width}x{height}".format(format_dict)) |