//===========================================================================
// 1.31.1 Blizzard.j
//===========================================================================
function SetAmbientDaySound takes string inLabel returns nothing
local real ToD
// Stop old sound, if necessary
if (bj_dayAmbientSound != null) then
call StopSound(bj_dayAmbientSound, true, true)
endif
// Create new sound
set bj_dayAmbientSound = CreateMIDISound(inLabel, 20, 20)
// Start the sound if necessary, based on current time
set ToD = GetTimeOfDay()
if (ToD >= bj_TOD_DAWN and ToD < bj_TOD_DUSK) then
call StartSound(bj_dayAmbientSound)
endif
endfunction
//===========================================================================
function SetAmbientNightSound takes string inLabel returns nothing
local real ToD
// Stop old sound, if necessary
if (bj_nightAmbientSound != null) then
call StopSound(bj_nightAmbientSound, true, true)
endif
// Create new sound
set bj_nightAmbientSound = CreateMIDISound(inLabel, 20, 20)
// Start the sound if necessary, based on current time
set ToD = GetTimeOfDay()
if (ToD < bj_TOD_DAWN or ToD >= bj_TOD_DUSK) then
call StartSound(bj_nightAmbientSound)
endif
endfunction