aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/MusicConductor
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/MusicConductor
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/MusicConductor')
-rw-r--r--game/src/Game/MusicConductor/MusicConductor.gd6
-rw-r--r--game/src/Game/MusicConductor/MusicPlayer.gd2
2 files changed, 4 insertions, 4 deletions
diff --git a/game/src/Game/MusicConductor/MusicConductor.gd b/game/src/Game/MusicConductor/MusicConductor.gd
index abfc52f..b4b660a 100644
--- a/game/src/Game/MusicConductor/MusicConductor.gd
+++ b/game/src/Game/MusicConductor/MusicConductor.gd
@@ -23,9 +23,9 @@ var is_music_player_visible : bool = true
var _has_startup_happened : bool = false
-func get_all_song_names() -> Array[String]:
- var songNames : Array[String] = []
- for si in _available_songs:
+func get_all_song_names() -> PackedStringArray:
+ var songNames : PackedStringArray = []
+ for si : SongInfo in _available_songs:
songNames.append(si.song_name)
return songNames
diff --git a/game/src/Game/MusicConductor/MusicPlayer.gd b/game/src/Game/MusicConductor/MusicPlayer.gd
index 949f423..17285dc 100644
--- a/game/src/Game/MusicConductor/MusicPlayer.gd
+++ b/game/src/Game/MusicConductor/MusicPlayer.gd
@@ -10,7 +10,7 @@ extends Control
var _is_user_dragging_progress_slider : bool = false
func _ready() -> void:
- for songName in MusicConductor.get_all_song_names():
+ for songName : String in MusicConductor.get_all_song_names():
_song_selector_button.add_item(songName, _song_selector_button.item_count)
_on_song_set(MusicConductor.get_current_song_index())
MusicConductor.song_started.connect(_on_song_set)