mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-03-01 03:30:04 +00:00
Resume map music when exiting combat.
This commit is contained in:
parent
56934116fd
commit
7443487a7d
@ -166,6 +166,7 @@ export byte prevClockColor, prevClockHour, prevClockMinute
|
|||||||
export byte nextSignificantMinute
|
export byte nextSignificantMinute
|
||||||
byte snoozeX0, snoozeX1, snoozeY
|
byte snoozeX0, snoozeX1, snoozeY
|
||||||
word timeEventFunc
|
word timeEventFunc
|
||||||
|
byte mapEmuSound = 0
|
||||||
|
|
||||||
export byte[] S_GAME1_FILENAME = "GAME.1.SAVE"
|
export byte[] S_GAME1_FILENAME = "GAME.1.SAVE"
|
||||||
|
|
||||||
@ -1853,6 +1854,9 @@ end
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
export def soundPlayEmu(numAndFlgs)#0
|
export def soundPlayEmu(numAndFlgs)#0
|
||||||
|
if mapEmuSound == $FF // if in initMap...
|
||||||
|
mapEmuSound = numAndFlgs // ... then record the music for resume after combat
|
||||||
|
fin
|
||||||
^EMUSOUND_PLAY = numAndFlgs
|
^EMUSOUND_PLAY = numAndFlgs
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2102,7 +2106,11 @@ def initMap(x, y, dir)#0
|
|||||||
skyNum = 9 // default
|
skyNum = 9 // default
|
||||||
groundNum = 10 // default
|
groundNum = 10 // default
|
||||||
timeEventFunc = NULL
|
timeEventFunc = NULL
|
||||||
|
mapEmuSound = $FF // special value to mark init
|
||||||
initDisplay(curMapPartition, mapNum, pCurMap, x, y, dir)
|
initDisplay(curMapPartition, mapNum, pCurMap, x, y, dir)
|
||||||
|
if mapEmuSound == $FF // if no music assigned...
|
||||||
|
mapEmuSound = 0 // ...then record that fact.
|
||||||
|
fin
|
||||||
texturesLoaded = TRUE
|
texturesLoaded = TRUE
|
||||||
needRender = FALSE
|
needRender = FALSE
|
||||||
textDrawn = FALSE
|
textDrawn = FALSE
|
||||||
@ -2918,6 +2926,13 @@ def playerDeath()#0
|
|||||||
startGame(FALSE, FALSE) // don't ask, just load
|
startGame(FALSE, FALSE) // don't ask, just load
|
||||||
end
|
end
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
def resumeMapMusic()#0
|
||||||
|
if mapEmuSound > 0 and mapEmuSound <> $FF
|
||||||
|
soundPlayEmu(mapEmuSound)
|
||||||
|
fin
|
||||||
|
end
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
def doCombat(mapCode, backUpOnFlee)#1
|
def doCombat(mapCode, backUpOnFlee)#1
|
||||||
word result
|
word result
|
||||||
@ -2939,6 +2954,7 @@ def doCombat(mapCode, backUpOnFlee)#1
|
|||||||
return 0
|
return 0
|
||||||
fin
|
fin
|
||||||
returnFromEngine(!inScript) // only re-render if outside script
|
returnFromEngine(!inScript) // only re-render if outside script
|
||||||
|
resumeMapMusic
|
||||||
|
|
||||||
// Advance time a little. It's tricky advancing during combat; this is an ok substitute.
|
// Advance time a little. It's tricky advancing during combat; this is an ok substitute.
|
||||||
advTime(CLOCK_ADV_COMBAT_HOURS, CLOCK_ADV_COMBAT_MINS, CLOCK_ADV_COMBAT_SECS)
|
advTime(CLOCK_ADV_COMBAT_HOURS, CLOCK_ADV_COMBAT_MINS, CLOCK_ADV_COMBAT_SECS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user