diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-27 12:05:45 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-27 12:05:45 -0500 |
commit | 1656242563d14fa564bab8d4bc40054ab8998553 (patch) | |
tree | 872589408ac7aef54b1959dc53b946fbed9dfcaa /res/scripts | |
parent | e644f5c0d769989bd3b0665312c6949d76f5e388 (diff) | |
download | tanetane-1656242563d14fa564bab8d4bc40054ab8998553.tar.gz tanetane-1656242563d14fa564bab8d4bc40054ab8998553.tar.bz2 tanetane-1656242563d14fa564bab8d4bc40054ab8998553.zip |
Added background music (defined on a per-map basis)
Diffstat (limited to 'res/scripts')
-rw-r--r-- | res/scripts/common.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 2a51419..a5e7873 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
@@ -260,7 +260,13 @@ function ChangeMap(map, warp, options) | |||
260 | FadeToBlack(150) | 260 | FadeToBlack(150) |
261 | end | 261 | end |
262 | loadMap(map) | 262 | loadMap(map) |
263 | character():transplantParty(playerId, getWarpPoint(warp), direction) | 263 | character():transplantParty(playerId, getMap():getWarpPoint(warp), direction) |
264 | |||
265 | if (mixer():isPlayingMusic() and not getMap():hasMusic()) then | ||
266 | mixer():fadeoutMusic(150) | ||
267 | elseif (getMap():hasMusic() and (not mixer():isPlayingMusic() or not mixer():getPlayingTrack() == getMap():getMusic())) then | ||
268 | mixer():playMusic(getMap():getMusic(), 150) | ||
269 | end | ||
264 | 270 | ||
265 | coroutine.yield() | 271 | coroutine.yield() |
266 | if (options & ChangeMapOptions.DO_NOT_FADE == 0) then | 272 | if (options & ChangeMapOptions.DO_NOT_FADE == 0) then |