mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
read sound effects from RAM
This commit is contained in:
@@ -51,7 +51,7 @@ class TerrarumMusicGovernor : MusicGovernor() {
|
||||
printdbg(this, "MusicTitle: ${muscon.name}")
|
||||
|
||||
muscon.songFinishedHook = {
|
||||
if (it == App.audioMixer.musicTrack.currentTrack?.gdxMusic) {
|
||||
if (App.audioMixer.musicTrack.currentTrack == it) {
|
||||
stopMusic(this, true, getRandomMusicInterval())
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ class TerrarumMusicGovernor : MusicGovernor() {
|
||||
stopMusic0(App.audioMixer.musicTrack.currentTrack)
|
||||
}
|
||||
|
||||
songs.forEach { it.gdxMusic.tryDispose() }
|
||||
songs.forEach { it.tryDispose() }
|
||||
registerSongsFromDir(musicDir, fileToName)
|
||||
|
||||
this.shuffled = shuffled
|
||||
@@ -174,13 +174,13 @@ class TerrarumMusicGovernor : MusicGovernor() {
|
||||
|
||||
init {
|
||||
songs.forEach {
|
||||
App.disposables.add(it.gdxMusic)
|
||||
App.disposables.add(it)
|
||||
}
|
||||
ambients.forEach { (k, v) ->
|
||||
printdbg(this, "Ambients: $k -> $v")
|
||||
|
||||
v.forEach {
|
||||
App.disposables.add(it.gdxMusic)
|
||||
App.disposables.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,17 +34,17 @@ open class ActorPrimedBomb(
|
||||
private var explosionCalled = false
|
||||
|
||||
@Transient private val boomSound = MusicContainer(
|
||||
"boom", ModMgr.getFile("basegame", "audio/effects/explosion/bang_bomb.ogg")
|
||||
"boom", ModMgr.getFile("basegame", "audio/effects/explosion/bang_bomb.ogg"), toRAM = true
|
||||
) {
|
||||
this.flagDespawn()
|
||||
}
|
||||
@Transient private val fuseSound = MusicContainer(
|
||||
"fuse", ModMgr.getFile("basegame", "audio/effects/explosion/fuse.ogg")
|
||||
"fuse", ModMgr.getFile("basegame", "audio/effects/explosion/fuse.ogg"), toRAM = true
|
||||
) {
|
||||
this.flagDespawn()
|
||||
}
|
||||
@Transient private val fuseSoundCont = MusicContainer(
|
||||
"fuse_continue", ModMgr.getFile("basegame", "audio/effects/explosion/fuse_continue.ogg")
|
||||
"fuse_continue", ModMgr.getFile("basegame", "audio/effects/explosion/fuse_continue.ogg"), toRAM = true
|
||||
) {
|
||||
this.flagDespawn()
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class FixtureJukebox : Electric, PlaysMusic {
|
||||
musicNowPlaying = MusicContainer(title, musicFile.file()) {
|
||||
unloadEffector(musicNowPlaying)
|
||||
discCurrentlyPlaying = null
|
||||
musicNowPlaying?.gdxMusic?.tryDispose()
|
||||
musicNowPlaying?.tryDispose()
|
||||
musicNowPlaying = null
|
||||
|
||||
printdbg(this, "Stop music $title - $artist")
|
||||
|
||||
@@ -115,7 +115,7 @@ class FixtureMusicalTurntable : Electric, PlaysMusic {
|
||||
|
||||
musicNowPlaying = MusicContainer(title, musicFile.file()) {
|
||||
unloadEffector(musicNowPlaying)
|
||||
musicNowPlaying?.gdxMusic?.tryDispose()
|
||||
musicNowPlaying?.tryDispose()
|
||||
musicNowPlaying = null
|
||||
|
||||
App.printdbg(this, "Stop music $title - $artist")
|
||||
|
||||
@@ -267,6 +267,7 @@ object PickaxeCore {
|
||||
private val soundCue = MusicContainer(
|
||||
"pickaxe_sound_cue",
|
||||
ModMgr.getFile("basegame", "audio/effects/accessibility/pickaxe_valuable.ogg"),
|
||||
toRAM = true
|
||||
).also {
|
||||
App.disposables.add(it)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user