I got tired of not getting my eePanels around my party frames so i searched around a bit got at last a working code. But as you maybe see im totally new to coding and i was wondering if you guys could find any errors in it because i planned release it. Ive mostly used the addon inside DruktharUI.
Code:
PitBullFrameFixxer = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0")
local PitBullFrameFixxer = PitBullFrameFixxer
function PitBullFrameFixxer:OnInitialize()
self:RegisterEvent("PARTY_MEMBERS_CHANGED")
self:RegisterEvent("RAID ROSTER UPDATE", "PARTY_MEMBERS_CHANGED")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
end
function PitBullFrameFixxer:PLAYER_ENTERING_WORLD()
eePanel9:SetFrameLevel(0)
self:PARTY_MEMBERS_CHANGED()
end
function PitBullFrameFixxer:PARTY_MEMBERS_CHANGED()
if GetNumPartyMembers() < 1 then
eePanel13:Hide()
eePanel14:Hide()
eePanel15:Hide()
eePanel16:Hide()
elseif GetNumPartyMembers() == 1 then
eePanel13:Show()
eePanel14:Hide()
eePanel15:Hide()
eePanel16:Hide()
elseif GetNumPartyMembers() == 2 then
eePanel13:Show()
eePanel14:Show()
eePanel15:Hide()
eePanel16:Hide()
elseif GetNumPartyMembers() == 3 then
eePanel13:Show()
eePanel14:Show()
eePanel15:Show()
eePanel16:Hide()
elseif GetNumPartyMembers() == 4 then
eePanel13:Show()
eePanel14:Show()
eePanel15:Show()
eePanel16:Show()
end
end