mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-23 08:06:55 +00:00
easteregg: make xmas less intrusive
This commit is contained in:
+22
-3
@@ -2,10 +2,29 @@ pfUI:RegisterModule("easteregg", function ()
|
||||
if date("%m%d") == "1224" or date("%m%d") == "1225" then
|
||||
-- merry x-mas!
|
||||
local title = (UnitFactionGroup("player") == "Horde") and PVP_RANK_18_0 or PVP_RANK_18_1
|
||||
local oldflag = _G.CHAT_FLAG_AFK
|
||||
|
||||
_G.CHAT_FLAG_AFK = title .. " "
|
||||
_G.MARKED_AFK = "|cff33ffccpf|cffffffffUI|r wishes you a merry christmas, |cff33ffcc" .. title .. "|r."
|
||||
_G.MARKED_AFK_MESSAGE = "|cff33ffccpf|cffffffffUI|r wishes you a merry christmas, |cff33ffcc" .. title .. "|r: %s"
|
||||
local pvpking = CreateFrame("Frame", "pfPvPKing", UIParent)
|
||||
pvpking:Hide()
|
||||
|
||||
pvpking:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||
pvpking:SetScript("OnEvent", function()
|
||||
if strfind(arg1, _G.MARKED_AFK) or strfind(arg1, _G.MARKED_AFK_MESSAGE) then
|
||||
_G.CHAT_FLAG_AFK = title .. " "
|
||||
this.time = GetTime()
|
||||
this:Show()
|
||||
end
|
||||
end)
|
||||
|
||||
pvpking:SetScript("OnUpdate", function()
|
||||
if this.time + 1 < GetTime() then
|
||||
_G.CHAT_FLAG_AFK = oldflag
|
||||
this:Hide()
|
||||
end
|
||||
end)
|
||||
|
||||
_G.MARKED_AFK = "|cff33ffccShagu|cffffffff wishes you a merry christmas. You are now |cff33ffcc" .. title .. "|cffffffff. Thanks for using |cff33ffccpf|cffffffffUI|cffffffff!|r"
|
||||
_G.MARKED_AFK_MESSAGE = "|cff33ffccShagu|cffffffff wishes you a merry christmas. You are now |cff33ffcc" .. title .. "|cffffffff. Thanks for using |cff33ffccpf|cffffffffUI|cffffffff!|r: %s"
|
||||
_G.CLEARED_AFK = "You are no longer |cff33ffcc" .. title .. "|r."
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user