diff options
author | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-27 22:13:52 +0200 |
---|---|---|
committer | ClarkeCode <clarke.john.robert@gmail.com> | 2023-04-27 22:13:52 +0200 |
commit | 0b273743b480874281a8987c72b2f1b666bc289a (patch) | |
tree | 3f5d5a6316ac66407e61c8a56fe732cdf06209e5 /game/src/MusicConductor | |
parent | 98dd680a641a2cbe0f1f93202a5beffdfd35c9f7 (diff) | |
parent | 10053cf259c55ee45803268a844edf1011d8a16b (diff) |
Merge branch 'main' of github.com:OpenVic2Project/OpenVic2 into goods
Diffstat (limited to 'game/src/MusicConductor')
-rw-r--r-- | game/src/MusicConductor/MusicConductor.gd | 2 | ||||
-rw-r--r-- | game/src/MusicConductor/MusicPlayer.gd | 2 | ||||
-rw-r--r-- | game/src/MusicConductor/MusicPlayer.tscn | 54 |
3 files changed, 31 insertions, 27 deletions
diff --git a/game/src/MusicConductor/MusicConductor.gd b/game/src/MusicConductor/MusicConductor.gd index c0cfc46..08fa86a 100644 --- a/game/src/MusicConductor/MusicConductor.gd +++ b/game/src/MusicConductor/MusicConductor.gd @@ -36,7 +36,7 @@ func is_paused() -> bool: func toggle_play_pause() -> void: $AudioStreamPlayer.stream_paused = !$AudioStreamPlayer.stream_paused - + func start_current_song() -> void: $AudioStreamPlayer.stream = _available_songs[_selected_track].song_stream $AudioStreamPlayer.play() diff --git a/game/src/MusicConductor/MusicPlayer.gd b/game/src/MusicConductor/MusicPlayer.gd index baf8a43..b775b84 100644 --- a/game/src/MusicConductor/MusicPlayer.gd +++ b/game/src/MusicConductor/MusicPlayer.gd @@ -44,6 +44,8 @@ func _on_previous_song_button_pressed(): func _on_option_button_item_selected(index): # UIFUN-92 MusicConductor.start_song_by_index(index) + _update_song_name_visual() + _update_play_pause_button() func _on_progress_slider_drag_started(): diff --git a/game/src/MusicConductor/MusicPlayer.tscn b/game/src/MusicConductor/MusicPlayer.tscn index 91b6fd3..80ad641 100644 --- a/game/src/MusicConductor/MusicPlayer.tscn +++ b/game/src/MusicConductor/MusicPlayer.tscn @@ -4,58 +4,60 @@ [node name="MusicPlayer" type="BoxContainer" node_paths=PackedStringArray("_song_selector_button", "_progress_slider", "_previous_song_button", "_play_pause_button", "_next_song_button", "_visbility_button")] editor_description = "UI-104" +offset_right = 150.0 +offset_bottom = 110.0 mouse_filter = 2 +vertical = true script = ExtResource("1_gcm4m") -_song_selector_button = NodePath("Control/SongSelectorButton") -_progress_slider = NodePath("Control/ProgressSlider") -_previous_song_button = NodePath("Control/HBoxContainer/PreviousSongButton") -_play_pause_button = NodePath("Control/HBoxContainer/PlayPauseButton") -_next_song_button = NodePath("Control/HBoxContainer/NextSongButton") -_visbility_button = NodePath("Control/MusicUIVisibilityButton") - -[node name="Control" type="VBoxContainer" parent="."] -custom_minimum_size = Vector2(150, 0) -layout_mode = 2 -mouse_filter = 2 - -[node name="SongSelectorButton" type="OptionButton" parent="Control"] +_song_selector_button = NodePath("SongSelectorButton") +_progress_slider = NodePath("ProgressSlider") +_previous_song_button = NodePath("ButtonList/PreviousSongButton") +_play_pause_button = NodePath("ButtonList/PlayPauseButton") +_next_song_button = NodePath("ButtonList/NextSongButton") +_visbility_button = NodePath("MusicUIVisibilityButton") + +[node name="SongSelectorButton" type="OptionButton" parent="."] editor_description = "UI-107" +custom_minimum_size = Vector2(150, 0) layout_mode = 2 alignment = 1 text_overrun_behavior = 3 fit_to_longest_item = false -[node name="ProgressSlider" type="HSlider" parent="Control"] +[node name="ProgressSlider" type="HSlider" parent="."] +custom_minimum_size = Vector2(150, 0) layout_mode = 2 +size_flags_vertical = 1 -[node name="HBoxContainer" type="HBoxContainer" parent="Control"] +[node name="ButtonList" type="HBoxContainer" parent="."] layout_mode = 2 size_flags_horizontal = 4 mouse_filter = 2 -[node name="PreviousSongButton" type="Button" parent="Control/HBoxContainer"] +[node name="PreviousSongButton" type="Button" parent="ButtonList"] layout_mode = 2 text = "<" -[node name="PlayPauseButton" type="Button" parent="Control/HBoxContainer"] +[node name="PlayPauseButton" type="Button" parent="ButtonList"] custom_minimum_size = Vector2(30, 0) layout_mode = 2 text = "▶" -[node name="NextSongButton" type="Button" parent="Control/HBoxContainer"] +[node name="NextSongButton" type="Button" parent="ButtonList"] layout_mode = 2 text = ">" -[node name="MusicUIVisibilityButton" type="Button" parent="Control"] +[node name="MusicUIVisibilityButton" type="Button" parent="."] editor_description = "UI-106" layout_mode = 2 size_flags_horizontal = 4 +toggle_mode = true text = "⬆" -[connection signal="item_selected" from="Control/SongSelectorButton" to="." method="_on_option_button_item_selected"] -[connection signal="drag_ended" from="Control/ProgressSlider" to="." method="_on_progress_slider_drag_ended"] -[connection signal="drag_started" from="Control/ProgressSlider" to="." method="_on_progress_slider_drag_started"] -[connection signal="pressed" from="Control/HBoxContainer/PreviousSongButton" to="." method="_on_previous_song_button_pressed"] -[connection signal="pressed" from="Control/HBoxContainer/PlayPauseButton" to="." method="_on_play_pause_button_pressed"] -[connection signal="pressed" from="Control/HBoxContainer/NextSongButton" to="." method="_on_next_song_button_pressed"] -[connection signal="pressed" from="Control/MusicUIVisibilityButton" to="." method="_on_music_ui_visibility_button_pressed"] +[connection signal="item_selected" from="SongSelectorButton" to="." method="_on_option_button_item_selected"] +[connection signal="drag_ended" from="ProgressSlider" to="." method="_on_progress_slider_drag_ended"] +[connection signal="drag_started" from="ProgressSlider" to="." method="_on_progress_slider_drag_started"] +[connection signal="pressed" from="ButtonList/PreviousSongButton" to="." method="_on_previous_song_button_pressed"] +[connection signal="pressed" from="ButtonList/PlayPauseButton" to="." method="_on_play_pause_button_pressed"] +[connection signal="pressed" from="ButtonList/NextSongButton" to="." method="_on_next_song_button_pressed"] +[connection signal="pressed" from="MusicUIVisibilityButton" to="." method="_on_music_ui_visibility_button_pressed"] |