Skip to content

Commit

Permalink
Fixed an issue which made the frames break when SortGroup or similar …
Browse files Browse the repository at this point in the history
…AddOns were active
  • Loading branch information
muleyo committed Dec 13, 2022
1 parent 000d50d commit 76aee2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
32 changes: 13 additions & 19 deletions Core.lua
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
2 changes: 1 addition & 1 deletion PartyRaidFrameResize.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100002
## Author: muleyo
## Version: 1.0.1
## Version: 1.0.2
## Title: |cff009cffParty RaidFrame Resize|r
## Notes: Allows the user to resize the Party Raidframe and exceed the width/height slider limits
## SavedVariables: PFRDB
Expand Down

0 comments on commit 76aee2b

Please sign in to comment.