Back to Home

ESO Lua File v101044

internalingame/sounds/soundevents.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
local g_soundHandlers = {
    [EVENT_CROWN_UPDATE] = function(crownAmount, difference)
        if difference < 0 then
            return SOUNDS.MARKET_CROWNS_SPENT
        end
    end,
    [EVENT_CROWN_GEM_UPDATE] = function(crownGemAmount, difference, reason)
        if difference < 0 then
            return SOUNDS.MARKET_CROWN_GEMS_SPENT
        end
    end,
}
    return g_soundHandlers
end
local function OnSoundEvent(eventCode, ...)
    if g_soundHandlers[eventCode] then
        local soundId = g_soundHandlers[eventCode](...)
        if soundId then
            PlaySound(soundId)
        end
    end
end
function ZO_SoundEvent(eventId, ...)
    OnSoundEvent(eventId, ...)
end
    for event in pairs(g_soundHandlers) do
        EVENT_MANAGER:RegisterForEvent("ZO_SoundEvents", event, OnSoundEvent)
    end
end