df057e7f8c229cce3a958479cd53440c20c8afcf
[wowui.git] / RaidFramePowerBars.lua
1 local UnitGroupRolesAssigned = UnitGroupRolesAssigned;
2 local CompactRaidFrameContainer_ApplyToFrames = CompactRaidFrameContainer_ApplyToFrames;
3
4 -- TODO remove 1px border
5 hooksecurefunc("CompactRaidFrameContainer_LayoutFrames", function(frame)
6     if not frame then return end
7     CompactRaidFrameContainer_ApplyToFrames(frame, "normal", function(frame)
8         if not frame or not frame.unit then return end
9         local role = UnitGroupRolesAssigned(frame.unit);
10         local options = DefaultCompactUnitFrameSetupOptions;
11         if options.displayPowerBar and role ~= "HEALER" then
12             -- Fix healthbar size
13             frame.healthBar:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -1, 1);
14             frame.powerBar:Hide();
15             -- Fix borders
16             if options.displayBorder then
17                 frame.horizDivider:Hide();
18             end
19         end
20     end);
21 end);