-- * local variables * --
local val = 10 -- amount to raise/lower the volume by...
-- * text started lower volume * --
function onTextStarted(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters then setVolume(eMusicVolume, (getVolume(eMusicVolume) - val)) end
end
-- * text stopped raise volume * --
function onTextStopped(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters then setVolume(eMusicVolume, (getVolume(eMusicVolume) + val)) end
end
-- * the event listeners for text start & stop * --
registerEventHandler("textStarted", "onTextStarted")
registerEventHandler("textStopped", "onTextStopped")
-- * local variables * --
local val = 10 -- amount to raise/lower the volume by...
-- * text started lower volume * --
function onTextStarted(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters and Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) - val)) end
end
-- * text stopped raise volume * --
function onTextStopped(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters and Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) + val)) end
end
-- * the event listeners for text start & stop * --
registerEventHandler("textStarted", "onTextStarted")
registerEventHandler("textStopped", "onTextStopped")
if Conditions["music_muted"].ConditionValue then
Conditions["music_muted"].ConditionValue = false -- set unmuted
setVolume( eMusicVolume, Values["music_vol"].Int ) -- restore music volume
else
Conditions["music_muted"].ConditionValue = true -- set muted
Values["music_vol"].Int = getVolume(eMusicVolume) -- store current music volume
setVolume(eMusicVolume, 0) -- mute music volume
end
-- * local variables * --
local val = 10 -- amount to raise/lower the volume by...
-- * text started lower volume * --
function onTextStarted(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters and not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) - val)) end
end
-- * text stopped raise volume * --
function onTextStopped(text)
if text:getLink(VTextOwner):getId().tableId == eCharacters and not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) + val)) end
end
-- * the event listeners for text start & stop * --
registerEventHandler("textStarted", "onTextStarted")
registerEventHandler("textStopped", "onTextStopped")
-- * local variables * --
local val = 10 -- amount to raise/lower the volume by...
-- * text started lower volume * --
function onTextStarted(text)
if not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) - val)) end
end
-- * text stopped raise volume * --
function onTextStopped(text)
if not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) + val)) end
end
-- * the event listeners for text start & stop * --
registerEventHandler("textStarted", "onTextStarted")
registerEventHandler("textStopped", "onTextStopped")