mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
y u no call back :(
This commit is contained in:
@@ -103,11 +103,6 @@ class FixtureJukebox : Electric, PlaysMusic {
|
||||
|
||||
override fun updateImpl(delta: Float) {
|
||||
super.updateImpl(delta)
|
||||
|
||||
// supress the normal background music playback
|
||||
if (musicIsPlaying && !flagDespawn) {
|
||||
(INGAME.musicStreamer as TerrarumMusicStreamer).stopMusic(this, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -135,10 +130,8 @@ class FixtureJukebox : Electric, PlaysMusic {
|
||||
}
|
||||
|
||||
musicNowPlaying = MusicContainer(title, musicFile.file()) {
|
||||
returnToInitialState()
|
||||
printdbg(this, "Stop music $title - $artist")
|
||||
|
||||
// can't call stopDiscPlayback() because of the recursion
|
||||
(INGAME.musicStreamer as TerrarumMusicStreamer).stopMusic(this, pauseLen = (INGAME.musicStreamer as TerrarumMusicStreamer).getRandomMusicInterval())
|
||||
}
|
||||
|
||||
discCurrentlyPlaying = index
|
||||
@@ -149,24 +142,18 @@ class FixtureJukebox : Electric, PlaysMusic {
|
||||
}*/
|
||||
|
||||
MusicService.playMusicalFixture(
|
||||
// action: () -> Unit
|
||||
{
|
||||
/* action: () -> Unit */ {
|
||||
startAudio(musicNowPlaying!!) { loadEffector(it) }
|
||||
},
|
||||
// musicFinished: () -> Boolean
|
||||
{
|
||||
/* musicFinished: () -> Boolean */ {
|
||||
!musicIsPlaying
|
||||
},
|
||||
// onSuccess: () -> Unit
|
||||
{
|
||||
/* onSuccess: () -> Unit */ {
|
||||
|
||||
},
|
||||
// onFailure: (Throwable) -> Unit
|
||||
{
|
||||
|
||||
},
|
||||
// onFinally: () -> Unit
|
||||
returnToInitialState
|
||||
/* onFailure: (Throwable) -> Unit */ {
|
||||
returnToInitialState
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -185,8 +172,10 @@ class FixtureJukebox : Electric, PlaysMusic {
|
||||
*/
|
||||
fun stopGracefully() {
|
||||
stopDiscPlayback()
|
||||
(INGAME.musicStreamer as TerrarumMusicStreamer).stopMusic(this, pauseLen = (INGAME.musicStreamer as TerrarumMusicStreamer).getRandomMusicInterval())
|
||||
|
||||
try {
|
||||
MusicService.enterIntermission()
|
||||
}
|
||||
catch (_: Throwable) {}
|
||||
}
|
||||
|
||||
override fun drawBody(frameDelta: Float, batch: SpriteBatch) {
|
||||
|
||||
@@ -92,11 +92,6 @@ class FixtureMusicalTurntable : Electric, PlaysMusic {
|
||||
|
||||
override fun updateImpl(delta: Float) {
|
||||
super.updateImpl(delta)
|
||||
|
||||
// supress the normal background music playback
|
||||
if (musicIsPlaying && !flagDespawn) {
|
||||
(INGAME.musicStreamer as TerrarumMusicStreamer).stopMusic(this, true)
|
||||
}
|
||||
}
|
||||
|
||||
fun playDisc() {
|
||||
@@ -118,10 +113,8 @@ class FixtureMusicalTurntable : Electric, PlaysMusic {
|
||||
}
|
||||
|
||||
musicNowPlaying = MusicContainer(title, musicFile.file()) {
|
||||
returnToInitialState()
|
||||
App.printdbg(this, "Stop music $title - $artist")
|
||||
|
||||
// can't call stopDiscPlayback() because of the recursion
|
||||
(INGAME.musicStreamer as TerrarumMusicStreamer).stopMusic(this, pauseLen = (INGAME.musicStreamer as TerrarumMusicStreamer).getRandomMusicInterval())
|
||||
}
|
||||
|
||||
|
||||
@@ -131,24 +124,19 @@ class FixtureMusicalTurntable : Electric, PlaysMusic {
|
||||
}*/
|
||||
|
||||
MusicService.playMusicalFixture(
|
||||
// action: () -> Unit
|
||||
{
|
||||
/* action: () -> Unit */ {
|
||||
App.printdbg(this, "call startAudio(${musicNowPlaying?.name})")
|
||||
startAudio(musicNowPlaying!!) { loadEffector(it) }
|
||||
},
|
||||
// musicFinished: () -> Boolean
|
||||
{
|
||||
/* musicFinished: () -> Boolean */ {
|
||||
!musicIsPlaying
|
||||
},
|
||||
// onSuccess: () -> Unit
|
||||
{
|
||||
/* onSuccess: () -> Unit */ {
|
||||
|
||||
},
|
||||
// onFailure: (Throwable) -> Unit
|
||||
{
|
||||
|
||||
},
|
||||
// onFinally: () -> Unit
|
||||
returnToInitialState
|
||||
/* onFailure: (Throwable) -> Unit */ {
|
||||
returnToInitialState
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -162,8 +150,10 @@ class FixtureMusicalTurntable : Electric, PlaysMusic {
|
||||
*/
|
||||
fun stopGracefully() {
|
||||
stopDiscPlayback()
|
||||
(INGAME.musicStreamer as TerrarumMusicStreamer).stopMusic(this, pauseLen = (INGAME.musicStreamer as TerrarumMusicStreamer).getRandomMusicInterval())
|
||||
|
||||
try {
|
||||
MusicService.enterIntermission()
|
||||
}
|
||||
catch (_: Throwable) {}
|
||||
}
|
||||
|
||||
private fun stopDiscPlayback() {
|
||||
|
||||
Reference in New Issue
Block a user