-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue which made the frames break when SortGroup or similar …
…AddOns were active
- Loading branch information
Showing
2 changed files
with
14 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
PFR_Core = PFR:NewModule("PFR_Core") | ||
|
||
function PFR_Core:OnEnable() | ||
function PFR:Update() | ||
for i = 1, 5 do | ||
_G["CompactPartyFrameMember" .. i]:SetWidth(PFR_DB.width) | ||
_G["CompactPartyFrameMember" .. i]:SetHeight(PFR_DB.height) | ||
_G["CompactPartyFrameMember" .. i .. "StatusText"]:ClearAllPoints() | ||
_G["CompactPartyFrameMember" .. i .. "StatusText"]:SetPoint("CENTER", _G["CompactPartyFrameMember" .. i], "CENTER") | ||
_G["CompactPartyFrameMember" .. i .. "CenterStatusIcon"]:ClearAllPoints() | ||
_G["CompactPartyFrameMember" .. i .. "CenterStatusIcon"]:SetPoint("CENTER", _G["CompactPartyFrameMember" .. i], "CENTER") | ||
function PFR:Update(self) | ||
if self:IsForbidden() then return end | ||
local name = self:GetName() | ||
|
||
if name and name:match("CompactPartyFrame") then | ||
self:SetWidth(PFR_DB.width) | ||
self:SetHeight(PFR_DB.height) | ||
self.statusText:ClearAllPoints() | ||
self.statusText:SetPoint("CENTER", self, "CENTER") | ||
self.centerStatusIcon:ClearAllPoints() | ||
self.centerStatusIcon:SetPoint("CENTER", self, "CENTER") | ||
end | ||
end | ||
|
||
-- Register Events | ||
PFR:RegisterEvent("ADDON_LOADED", "Update") | ||
PFR:RegisterEvent("PLAYER_LOGIN", "Update") | ||
PFR:RegisterEvent("VARIABLES_LOADED", "Update") | ||
PFR:RegisterEvent("PLAYER_ENTERING_WORLD", "Update") | ||
PFR:RegisterEvent("GROUP_ROSTER_UPDATE", "Update") | ||
PFR:RegisterEvent("COMPACT_UNIT_FRAME_PROFILES_LOADED", "Update") | ||
|
||
-- Call function on exiting EditMode | ||
hooksecurefunc(C_EditMode, "OnEditModeExit", function() | ||
PFR:Update() | ||
hooksecurefunc("CompactUnitFrame_UpdateAll", function(self) | ||
PFR:Update(self) | ||
end) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters