mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 18:14:06 +09:00
musicplayer: album change
This commit is contained in:
@@ -422,6 +422,17 @@ class MusicPlayer(private val ingame: TerrarumIngame) : UICanvas() {
|
|||||||
val index = albumlistScroll + mouseOnList!!
|
val index = albumlistScroll + mouseOnList!!
|
||||||
val list = albumsList//.map { albumPropCache[it] }
|
val list = albumsList//.map { albumPropCache[it] }
|
||||||
|
|
||||||
|
if (index < list.size) {
|
||||||
|
// if selected album is not the same album currently playing, queue that album immediately
|
||||||
|
// (navigating into the selected album involves too much complication :p)
|
||||||
|
if (ingame.musicGovernor.playlistSource != albumsList[index].canonicalPath) {
|
||||||
|
// fade out
|
||||||
|
AudioMixer.requestFadeOut(AudioMixer.musicTrack, AudioMixer.DEFAULT_FADEOUT_LEN / 3f) {
|
||||||
|
loadNewAlbum(albumsList[index])
|
||||||
|
ingame.musicGovernor.startMusic() // required for "intermittent" mode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// unlatch the click latch
|
// unlatch the click latch
|
||||||
else if (!Terrarum.mouseDown) {
|
else if (!Terrarum.mouseDown) {
|
||||||
|
|||||||
Reference in New Issue
Block a user