I am currently using the addon KgPanels and having trouble with some coding..
I would like to ONLY show if I am in a party or raid. How would this be done?
I tried using this code (see below) but couldn't get it to work. when i leave the party the panel will hide but When I joined a party again, the panel didn't show until i reset its settings.
local pmems = GetNumPartyMembers()
local rmems = GetNumRaidMembers()
if (pmems < 1 and rmems < 1) or (pmems > 0 and pmems < 6 and rmems < 6) then
self:Hide()
else
self:Show()
end
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I would like to ONLY show if I am in a party or raid. How would this be done?
I tried using this code (see below) but couldn't get it to work. when i leave the party the panel will hide but When I joined a party again, the panel didn't show until i reset its settings.
am i doing anything wrong?
CODE
Adjusting Panels based on Raid or 5 Main party
In each Panel set the OnLoad script
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PARTY_MEMBERS_CHANGED")
self:RegisterEvent("RAID_ROSTER_UPDATE")
Then in each Panel OnEvent script:
local pmems = GetNumPartyMembers()
local rmems = GetNumRaidMembers()
if (pmems < 1 and rmems < 1) or (pmems > 0 and pmems < 6 and rmems < 6) then
self:Hide()
else
self:Show()
end