dont repeat the musiks
This commit is contained in:
parent
0747307cb3
commit
5a4e09d6d1
@ -11,6 +11,15 @@ extends Node3D
|
|||||||
@export var _chat_history_inactive: VBoxContainer
|
@export var _chat_history_inactive: VBoxContainer
|
||||||
@export var _chat_history_scroll_inactive: ScrollContainer
|
@export var _chat_history_scroll_inactive: ScrollContainer
|
||||||
|
|
||||||
|
## Things to yet play, so to not repeat ourselves much.
|
||||||
|
const PLAYLIST: Array[String] = [
|
||||||
|
"res://assets/musics/mod118.ogg",
|
||||||
|
"res://assets/musics/mod147-medley.mp3",
|
||||||
|
"res://assets/musics/mod170-toomanyfuckingdoors.ogg",
|
||||||
|
"res://assets/musics/sho.ogg",
|
||||||
|
]
|
||||||
|
var _playlist_remaining: Array[String]
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print("ingame ready")
|
print("ingame ready")
|
||||||
@ -44,16 +53,12 @@ func _ready() -> void:
|
|||||||
_play_new_track()
|
_play_new_track()
|
||||||
|
|
||||||
# TODO: sync what's played for peers, server controlled
|
# TODO: sync what's played for peers, server controlled
|
||||||
# TODO: keep a list of what wasn't yet played, so that we repeat less
|
|
||||||
func _play_new_track():
|
func _play_new_track():
|
||||||
$Soundtrack.stream = load(
|
if _playlist_remaining.size() == 0:
|
||||||
[
|
_playlist_remaining = PLAYLIST.duplicate()
|
||||||
"res://assets/musics/mod118.ogg",
|
var selection = _playlist_remaining.pick_random()
|
||||||
"res://assets/musics/mod147-medley.mp3",
|
_playlist_remaining.erase(selection)
|
||||||
"res://assets/musics/mod170-toomanyfuckingdoors.ogg",
|
$Soundtrack.stream = load(selection)
|
||||||
"res://assets/musics/sho.ogg",
|
|
||||||
].pick_random()
|
|
||||||
)
|
|
||||||
$Soundtrack.play()
|
$Soundtrack.play()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user