Back to Home

ESO Lua File v100018

ingame/spamwarning/spamwarning.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local SPAM_WARNING_PERIOD_SECONDS = 600
local g_lastSpamWarnings = {}
function OnSpamWarningReceived(eventCode, spamType)
    local currentTime = GetFrameTimeSeconds()
    local spamTypeTime = g_lastSpamWarnings[spamType]
    if spamTypeTime == nil or currentTime - spamTypeTime > SPAM_WARNING_PERIOD_SECONDS then
        ZO_Dialogs_ShowPlatformDialog("SPAM_WARNING")
        g_lastSpamWarnings[spamType] = currentTime
    end
end
EVENT_MANAGER:RegisterForEvent("SpamWarning", EVENT_SPAM_WARNING, OnSpamWarningReceived)