aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/MusicConductor/MusicPlayer.gd
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-12-24 19:23:18 +0100
committer GitHub <noreply@github.com>2023-12-24 19:23:18 +0100
commitd26c990d9a5596a3ef3b32ba1cb0f99950cd6d34 (patch)
tree1b99c935438692bb2ebadeac412b990c82089b65 /game/src/Game/MusicConductor/MusicPlayer.gd
parent50b0b935b0bf0724f40b5140aca85d1830a8b1b3 (diff)
parentb6413251a866c76538869b84ed1c9b9852f7c507 (diff)
Merge pull request #178 from Spartan322/add-menu-type-hints
Diffstat (limited to 'game/src/Game/MusicConductor/MusicPlayer.gd')
-rw-r--r--game/src/Game/MusicConductor/MusicPlayer.gd20
1 files changed, 10 insertions, 10 deletions
diff --git a/game/src/Game/MusicConductor/MusicPlayer.gd b/game/src/Game/MusicConductor/MusicPlayer.gd
index e83ab9b..949f423 100644
--- a/game/src/Game/MusicConductor/MusicPlayer.gd
+++ b/game/src/Game/MusicConductor/MusicPlayer.gd
@@ -9,7 +9,7 @@ extends Control
var _is_user_dragging_progress_slider : bool = false
-func _ready():
+func _ready() -> void:
for songName 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())
@@ -22,35 +22,35 @@ func _on_song_set(track_id : int) -> void:
_song_selector_button.selected = track_id
_update_play_pause_button()
-func _process(_delta):
+func _process(_delta : float) -> void:
if !_is_user_dragging_progress_slider:
_progress_slider.value = MusicConductor.get_current_song_progress_percentage()
-func _update_play_pause_button(_arg1 = null, _arg2 = null):
+func _update_play_pause_button(_arg1 : Variant = null, _arg2 : Variant = null) -> void:
_play_pause_button.text = "◼" if MusicConductor.is_paused() else "▶"
-func _on_play_pause_button_pressed():
+func _on_play_pause_button_pressed() -> void:
MusicConductor.toggle_play_pause()
# REQUIREMENTS
# * UIFUN-93
-func _on_next_song_button_pressed():
+func _on_next_song_button_pressed() -> void:
MusicConductor.select_next_song()
# REQUIREMENTS
# * UIFUN-94
-func _on_previous_song_button_pressed():
+func _on_previous_song_button_pressed() -> void:
MusicConductor.select_previous_song()
# REQUIREMENTS
# * UIFUN-95
-func _on_option_button_item_selected(index):
+func _on_option_button_item_selected(index : int) -> void:
MusicConductor.start_song_by_index(index)
-func _on_progress_slider_drag_started():
+func _on_progress_slider_drag_started() -> void:
_is_user_dragging_progress_slider = true
-func _on_progress_slider_drag_ended(_value_changed):
+func _on_progress_slider_drag_ended(_value_changed : bool) -> void:
MusicConductor.scrub_song_by_percentage(_progress_slider.value)
_is_user_dragging_progress_slider = false
@@ -65,5 +65,5 @@ func _set_music_player_visible(is_player_visible : bool) -> void:
# REQUIREMENTS
# * UIFUN-91
-func _on_music_ui_visibility_button_pressed():
+func _on_music_ui_visibility_button_pressed() -> void:
_set_music_player_visible(not MusicConductor.is_music_player_visible)