mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
panel: properly update guild info
This commit is contained in:
+15
-7
@@ -296,14 +296,22 @@ pfUI:RegisterModule("panel", function()
|
|||||||
widget:RegisterEvent("PLAYER_GUILD_UPDATE")
|
widget:RegisterEvent("PLAYER_GUILD_UPDATE")
|
||||||
widget.Click = function() ToggleFriendsFrame(3) end
|
widget.Click = function() ToggleFriendsFrame(3) end
|
||||||
widget:SetScript("OnEvent", function()
|
widget:SetScript("OnEvent", function()
|
||||||
GuildRoster()
|
local count = 0
|
||||||
local online = GetNumGuildMembers()
|
for i = 1, GetNumGuildMembers() do
|
||||||
local all = GetNumGuildMembers(true)
|
local _, _, _, _, _, _, _, _, online = GetGuildRosterInfo(i)
|
||||||
if not GetGuildInfo("player") then
|
if online then count = count + 1 end
|
||||||
pfUI.panel:OutputPanel("guild", GUILD .. ": " .. NOT_APPLICABLE, nil, widget.Click)
|
|
||||||
else
|
|
||||||
pfUI.panel:OutputPanel("guild", GUILD .. ": " .. online, nil, widget.Click)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if GetGuildInfo("player") then
|
||||||
|
pfUI.panel:OutputPanel("guild", GUILD .. ": " .. count, nil, widget.Click)
|
||||||
|
else
|
||||||
|
pfUI.panel:OutputPanel("guild", GUILD .. ": " .. NOT_APPLICABLE, nil, widget.Click)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
widget:SetScript("OnUpdate",function()
|
||||||
|
if ( this.tick or 10) > GetTime() then return else this.tick = GetTime() + 10 end
|
||||||
|
GuildRoster()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user