Skip to content

Commit afd22a2

Browse files
committed
fix pvp widget bar, part 2
1 parent d979707 commit afd22a2

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

ElvUI/Core/Modules/Blizzard/WidgetsUI.lua

+21-23
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ function BL:UIWidgetTemplateStatusBar()
5050
end
5151
end
5252

53-
function BL:CaptureBar_PVP()
53+
function BL:BelowMinimap_CaptureBar()
5454
self.LeftLine:SetAlpha(0)
5555
self.RightLine:SetAlpha(0)
5656
self.BarBackground:SetAlpha(0)
5757
self.SparkNeutral:SetAlpha(0)
5858

59+
self.GlowPulseAnim:Stop()
5960
self.Glow1:SetAlpha(0)
6061
self.Glow2:SetAlpha(0)
6162
self.Glow3:SetAlpha(0)
62-
self.GlowPulseAnim:Stop()
6363

6464
self.LeftBar:SetVertexColor(0.2, 0.6, 1.0)
6565
self.RightBar:SetVertexColor(0.9, 0.2, 0.2)
@@ -80,43 +80,41 @@ function BL:CaptureBar_PVP()
8080
end
8181
end
8282

83-
function BL:CaptureBar_EmberCourt() end
83+
function BL:BelowMinimap_EmberCourt() end
8484

8585
local captureBarSkins = {
86-
[2] = BL.CaptureBar_PVP,
87-
[252] = BL.CaptureBar_EmberCourt
86+
[2] = BL.BelowMinimap_CaptureBar,
87+
[252] = BL.BelowMinimap_EmberCourt
8888
}
8989

90-
function BL:WidgetCaptureBar_Update(_, container)
90+
function BL:BelowMinimap_UpdateBar(_, container)
9191
if self:IsForbidden() or not container then return end
9292

9393
local skinFunc = captureBarSkins[container.widgetSetID]
9494
if skinFunc then skinFunc(self) end
9595
end
9696

97-
function BL:WidgetCaptureBar_ProcessWidget(widgetID, widgetType)
97+
function BL:UIWidgetTemplateCaptureBar(widgetInfo, container)
98+
if container == _G.UIWidgetBelowMinimapContainerFrame then return end -- handled by ProcessWidget
99+
100+
BL.BelowMinimap_UpdateBar(self, widgetInfo, container)
101+
end
102+
103+
function BL:BelowMinimap_ProcessWidget(widgetID)
98104
if not self or not self.widgetFrames then return end
99105

100106
if widgetID then
101107
local bar = self.widgetFrames[widgetID]
102-
if bar then
103-
BL.WidgetCaptureBar_Update(bar, nil, self)
108+
if bar then -- excuse me?
109+
BL.BelowMinimap_UpdateBar(bar, nil, self)
104110
end
105-
else
111+
else -- we reloading?
106112
for _, bar in next, self.widgetFrames do
107-
BL.WidgetCaptureBar_Update(bar, nil, self)
113+
BL.BelowMinimap_UpdateBar(bar, nil, self)
108114
end
109115
end
110116
end
111117

112-
function BL:WidgetCaptureBar_ApplyEffectToFrame(widgetInfo, widgetContainer, frame)
113-
BL.WidgetCaptureBar_Update(self, widgetInfo, widgetContainer, frame)
114-
end
115-
116-
function BL:WidgetCaptureBar_Setup(widgetInfo, widgetContainer)
117-
BL.WidgetCaptureBar_Update(self, widgetInfo, widgetContainer)
118-
end
119-
120118
local function UpdatePosition(frame, _, anchor)
121119
local holder = frame.containerHolder
122120
if holder and anchor ~= holder then
@@ -169,9 +167,9 @@ function BL:HandleWidgets()
169167

170168
-- Credits ShestakUI
171169
hooksecurefunc(_G.UIWidgetTemplateStatusBarMixin, 'Setup', BL.UIWidgetTemplateStatusBar)
170+
hooksecurefunc(_G.UIWidgetTemplateCaptureBarMixin, 'Setup', BL.UIWidgetTemplateCaptureBar)
172171

173-
--hooksecurefunc(_G.UIWidgetTemplateCaptureBarMixin, 'Setup', BL.WidgetCaptureBar_Setup)
174-
--hooksecurefunc(_G.UIWidgetTemplateCaptureBarMixin, 'ApplyEffectToFrame', BL.WidgetCaptureBar_ApplyEffectToFrame)
175-
hooksecurefunc(_G.UIWidgetBelowMinimapContainerFrame, 'ProcessWidget', BL.WidgetCaptureBar_ProcessWidget)
176-
BL.WidgetCaptureBar_ProcessWidget(_G.UIWidgetBelowMinimapContainerFrame) -- finds any pre-existing capture bars
172+
-- Below Minimap Widgets
173+
hooksecurefunc(_G.UIWidgetBelowMinimapContainerFrame, 'ProcessWidget', BL.BelowMinimap_ProcessWidget)
174+
BL.BelowMinimap_ProcessWidget(_G.UIWidgetBelowMinimapContainerFrame) -- finds any pre-existing capture bars
177175
end

0 commit comments

Comments
 (0)