Back to Home

ESO Lua File v100036

ingame/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
38
39
local g_soundHandlers = {
    [EVENT_JUSTICE_GOLD_REMOVED] = function()
        return SOUNDS.JUSTICE_GOLD_REMOVED
    end,
    [EVENT_JUSTICE_STOLEN_ITEMS_REMOVED] = function()
        return SOUNDS.JUSTICE_ITEM_REMOVED
    end,
    [EVENT_MEDAL_AWARDED] = function()
        return SOUNDS.BATTLEGROUND_MEDAL_RECEIVED
    end,
}
    return g_soundHandlers
end
local function OnSoundEvent(eventId, ...)
    if g_soundHandlers[eventId] then
        local soundId = g_soundHandlers[eventId](...)
        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