Skip to content

Commit

Permalink
Attempt to fix IsShown() erroring on UpdateInRange
Browse files Browse the repository at this point in the history
  • Loading branch information
brittyazel committed Dec 23, 2023
1 parent cbe70a9 commit d83f1fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ end
--- This function is secure hooked to the CompactUnitFrame_UpdateInRange function.
---@param frame table @The frame to update the alpha on
function EnhancedRaidFrames:UpdateInRange(frame)
if not self.ShouldContinue(frame) then
if not self.ShouldContinue(frame, true) then
return
end

Expand Down
17 changes: 9 additions & 8 deletions Utils/Utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,26 @@ function EnhancedRaidFrames.ShouldContinue(frame, skipVisibilityCheck)
return false
end

-- Check that we have a unit, and only process player, raid, and party units
if not frame.unit or (not frame.unit:find("player", 1, true)
and not frame.unit:find("raid", 1, true)
and not frame.unit:find("party", 1, true)) then
return false
end

-- Check that we have a frame and that it is visible
if not skipVisibilityCheck then
-- Don't do any work if the raid frames aren't shown
if not CompactRaidFrameContainer:IsShown() and CompactPartyFrame and not CompactPartyFrame:IsShown() then
return false
end

if frame and not frame:IsShown() then
-- Don't do any work if the frame isn't shown
if not frame:IsShown() then
return false
end
end

-- Check that we have a unit, and only process player, raid, and party units
if not frame.unit or (not frame.unit:find("player", 1, true)
and not frame.unit:find("raid", 1, true)
and not frame.unit:find("party", 1, true)) then
return false
end

return true
end

Expand Down

0 comments on commit d83f1fe

Please sign in to comment.