aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Menu/OptionMenu/ResolutionSelector.gd
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-03-04 23:51:41 +0100
committer GitHub <noreply@github.com>2024-03-04 23:51:41 +0100
commiteaae420cd2aca224d15f6276624c2fab882c978a (patch)
treebacc8f4094eff5514a94b3852e9cec9c28391669 /game/src/Game/Menu/OptionMenu/ResolutionSelector.gd
parent521f7d3d156f42535fb7574fb36f2726e9d13885 (diff)
parente2077a0d93be8b2dd48f1ee680809420f1f690d7 (diff)
Merge pull request #211 from OpenVicProject/for-loop-types
Add types to GDScript for-loop variables
Diffstat (limited to 'game/src/Game/Menu/OptionMenu/ResolutionSelector.gd')
-rw-r--r--game/src/Game/Menu/OptionMenu/ResolutionSelector.gd6
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))