From 99c99ce56bb3e73e65ff70352d4c9eef3d7f0f86 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Wed, 8 Mar 2023 17:15:15 -0500 Subject: Fix up MusicPlayer for future work Add music import files Rename MusicUIController to MusicPlayer Adjust MusicPlayer node position, offset, and anchors Adjust MusicConductor, MusicPlayer, and SongInfo style to conform with other GDScript files Correct capability for MusicPlayer to desync from the MusicConductor Adjusted MusicPlayer button text to use media player unicode symbols Adjust MusicPlayer to correct mouse filter problems Adjust MusicPlayer to appear more consistent Correct lack of path_join use in SongInfo Correct mouse filter problems in OptionsMenu --- game/src/MusicConductor/MusicUIController.gd | 66 ---------------------------- 1 file changed, 66 deletions(-) delete mode 100644 game/src/MusicConductor/MusicUIController.gd (limited to 'game/src/MusicConductor/MusicUIController.gd') diff --git a/game/src/MusicConductor/MusicUIController.gd b/game/src/MusicConductor/MusicUIController.gd deleted file mode 100644 index f2c9225..0000000 --- a/game/src/MusicConductor/MusicUIController.gd +++ /dev/null @@ -1,66 +0,0 @@ -extends Control - -@export var songSelectorButton : OptionButton -@export var progressSlider : HSlider -@export var prevSongButton : Button -@export var playPauseButton : Button -@export var nextSongButton : Button -@export var widgetVisibilityButton : Button - -var isMusicPlayerVisible : bool = true -var isUserDraggingProgressSlider : bool = false - -# Called when the node enters the scene tree for the first time. -func _ready(): - for songName in MusicConductor.getAllSongNames(): - songSelectorButton.add_item(songName, songSelectorButton.item_count) - updateSongNameVisual() - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(_delta): - if !isUserDraggingProgressSlider: - progressSlider.value = MusicConductor.getCurrentSongProgressPercentage() - -func updateSongNameVisual(): - songSelectorButton.selected = MusicConductor.getCurrentSongIndex() - -func updatePlayPauseButtonVisual(): - playPauseButton.text = "||" if MusicConductor.isPaused() else ">" - -func _on_play_pause_button_pressed(): - MusicConductor.togglePlayPause() - updatePlayPauseButtonVisual() - -func _on_next_song_button_pressed(): - MusicConductor.nextSong() - updateSongNameVisual() - updatePlayPauseButtonVisual() - -func _on_previous_song_button_pressed(): - MusicConductor.prevSong() - updateSongNameVisual() - updatePlayPauseButtonVisual() - -func _on_option_button_item_selected(index): - # UIFUN-92 - MusicConductor.startSongByIndex(index) - - -func _on_progress_slider_drag_started(): - isUserDraggingProgressSlider = true - - -func _on_progress_slider_drag_ended(_value_changed): - MusicConductor.scrubSongByPercentage(progressSlider.value) - isUserDraggingProgressSlider = false - updatePlayPauseButtonVisual() - -func _on_music_ui_visibility_button_pressed(): - isMusicPlayerVisible = !isMusicPlayerVisible - widgetVisibilityButton.text = "Hide Player" if isMusicPlayerVisible else "Show Player" - songSelectorButton.visible = isMusicPlayerVisible - progressSlider.visible = isMusicPlayerVisible - prevSongButton.visible = isMusicPlayerVisible - playPauseButton.visible = isMusicPlayerVisible - nextSongButton.visible = isMusicPlayerVisible -- cgit v1.2.3-56-ga3b1