mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 03:06:01 +00:00
utilize UnitIsAFK
This commit is contained in:
+5
-7
@@ -1,5 +1,4 @@
|
||||
pfUI:RegisterModule("afkcam", function ()
|
||||
local MARKED_AFK_CAPTURE = SanitizePattern(MARKED_AFK_MESSAGE)
|
||||
local social_chats = {
|
||||
"CHAT_MSG_SAY",
|
||||
"CHAT_MSG_WHISPER",
|
||||
@@ -165,11 +164,10 @@ pfUI:RegisterModule("afkcam", function ()
|
||||
end)
|
||||
|
||||
afkcam:SetScript("OnEvent", function()
|
||||
if event == "CHAT_MSG_SYSTEM" then
|
||||
if (arg1 == _G.MARKED_AFK) or strfind(arg1, MARKED_AFK_CAPTURE) then
|
||||
delay:Show()
|
||||
elseif (arg1 == _G.CLEARED_AFK) then
|
||||
delay:Hide()
|
||||
if event == "PLAYER_FLAGS_CHANGED" then
|
||||
local isAFK = UnitIsAFK('player')
|
||||
delay:SetShown(isAFK)
|
||||
if not isAFK then
|
||||
this:stop()
|
||||
end
|
||||
else
|
||||
@@ -180,7 +178,7 @@ pfUI:RegisterModule("afkcam", function ()
|
||||
end
|
||||
end)
|
||||
|
||||
afkcam:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||
afkcam:RegisterEvent("PLAYER_FLAGS_CHANGED")
|
||||
afkcam:RegisterEvent("PLAYER_REGEN_DISABLED")
|
||||
afkcam:RegisterEvent("PLAYER_LEAVING_WORLD") -- reseting cvars on PLAYER_LOGOUT crashes the client ¯\_(ツ)_/¯
|
||||
end)
|
||||
|
||||
@@ -8,9 +8,9 @@ pfUI:RegisterModule("easteregg", function ()
|
||||
local pvpking = CreateFrame("Frame", "pfPvPKing", UIParent)
|
||||
pvpking:Hide()
|
||||
|
||||
pvpking:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||
pvpking:RegisterEvent("PLAYER_FLAGS_CHANGED")
|
||||
pvpking:SetScript("OnEvent", function()
|
||||
if strfind(arg1, "You are now", 1) and strfind(arg1, "(AFK)", 1) then
|
||||
if UnitIsAFK('player') then
|
||||
_G.CHAT_FLAG_AFK = title .. " "
|
||||
this.time = GetTime()
|
||||
this:Show()
|
||||
@@ -61,14 +61,13 @@ pfUI:RegisterModule("easteregg", function ()
|
||||
end)
|
||||
|
||||
-- trigger fireworks when being AFK
|
||||
fireworks:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||
fireworks:RegisterEvent("PLAYER_FLAGS_CHANGED")
|
||||
fireworks:SetScript("OnEvent", function()
|
||||
if strfind(arg1, _G.MARKED_AFK) or strfind(arg1, _G.MARKED_AFK_MESSAGE) then
|
||||
local isAFK = UnitIsAFK('player')
|
||||
if isAFK then
|
||||
this:SetAlpha(0)
|
||||
this:Show()
|
||||
elseif strfind(arg1, _G.CLEARED_AFK) then
|
||||
this:Hide()
|
||||
end
|
||||
this:SetShown(isAFK)
|
||||
end)
|
||||
|
||||
-- basic explosion animation
|
||||
|
||||
Reference in New Issue
Block a user