@@ -3,6 +3,7 @@ local BL = E:GetModule('Blizzard')
3
3
local NP = E :GetModule (' NamePlates' )
4
4
5
5
local _G = _G
6
+ local next = next
6
7
local pairs = pairs
7
8
local strmatch = strmatch
8
9
local CreateFrame = CreateFrame
@@ -23,6 +24,14 @@ function BL:UIWidgetTemplateStatusBar()
23
24
return -- we don't want to handle these widgets
24
25
end
25
26
27
+ bar .BGLeft :SetAlpha (0 )
28
+ bar .BGRight :SetAlpha (0 )
29
+ bar .BGCenter :SetAlpha (0 )
30
+ bar .BorderLeft :SetAlpha (0 )
31
+ bar .BorderRight :SetAlpha (0 )
32
+ bar .BorderCenter :SetAlpha (0 )
33
+ bar .Spark :SetAlpha (0 )
34
+
26
35
if not bar .backdrop then
27
36
bar :CreateBackdrop (' Transparent' )
28
37
@@ -38,55 +47,76 @@ function BL:UIWidgetTemplateStatusBar()
38
47
if bar .Label then -- percent text
39
48
bar .Label :FontTemplate (nil , nil , ' SHADOW' )
40
49
end
41
-
42
- bar .BGLeft :SetAlpha (0 )
43
- bar .BGRight :SetAlpha (0 )
44
- bar .BGCenter :SetAlpha (0 )
45
- bar .BorderLeft :SetAlpha (0 )
46
- bar .BorderRight :SetAlpha (0 )
47
- bar .BorderCenter :SetAlpha (0 )
48
- bar .Spark :SetAlpha (0 )
49
50
end
50
51
end
51
52
52
- local function PVPCaptureBar ( self )
53
+ function BL : CaptureBar_PVP ( )
53
54
self .LeftLine :SetAlpha (0 )
54
55
self .RightLine :SetAlpha (0 )
55
56
self .BarBackground :SetAlpha (0 )
57
+ self .SparkNeutral :SetAlpha (0 )
58
+
56
59
self .Glow1 :SetAlpha (0 )
57
60
self .Glow2 :SetAlpha (0 )
58
61
self .Glow3 :SetAlpha (0 )
59
-
60
- self .LeftBar :SetTexture (E .media .normTex )
61
- self .RightBar :SetTexture (E .media .normTex )
62
- self .NeutralBar :SetTexture (E .media .normTex )
62
+ self .GlowPulseAnim :Stop ()
63
63
64
64
self .LeftBar :SetVertexColor (0.2 , 0.6 , 1.0 )
65
65
self .RightBar :SetVertexColor (0.9 , 0.2 , 0.2 )
66
66
self .NeutralBar :SetVertexColor (0.8 , 0.8 , 0.8 )
67
67
68
- if not self .backdrop then
69
- local x = E .PixelMode and 1 or 2
68
+ self .LeftBar :SetTexture (E .media .normTex )
69
+ self .RightBar :SetTexture (E .media .normTex )
70
+ self .NeutralBar :SetTexture (E .media .normTex )
70
71
72
+ if not self .backdrop then
71
73
self :CreateBackdrop ()
74
+
75
+ local x = E .PixelMode and 1 or 2
72
76
self .backdrop :Point (' TOPLEFT' , self .LeftBar , - x , x )
73
77
self .backdrop :Point (' BOTTOMRIGHT' , self .RightBar , x , - x )
78
+ else
79
+ self .backdrop :SetFrameLevel (self :GetFrameLevel () - 1 )
74
80
end
75
81
end
76
82
77
- local function EmberCourtCaptureBar () end
83
+ function BL :CaptureBar_EmberCourt () end
84
+
78
85
local captureBarSkins = {
79
- [2 ] = PVPCaptureBar ,
80
- [252 ] = EmberCourtCaptureBar
86
+ [2 ] = BL . CaptureBar_PVP ,
87
+ [252 ] = BL . CaptureBar_EmberCourt
81
88
}
82
89
83
- function BL :UIWidgetTemplateCaptureBar (_ , widget )
84
- if self :IsForbidden () or not widget then return end
90
+ function BL :WidgetCaptureBar_Update (_ , container )
91
+ if self :IsForbidden () or not container then return end
85
92
86
- local skinFunc = captureBarSkins [widget .widgetSetID ]
93
+ local skinFunc = captureBarSkins [container .widgetSetID ]
87
94
if skinFunc then skinFunc (self ) end
88
95
end
89
96
97
+ function BL :WidgetCaptureBar_ProcessWidget (widgetID , widgetType )
98
+ if not self or not self .widgetFrames then return end
99
+
100
+ if widgetID then
101
+ local bar = self .widgetFrames [widgetID ]
102
+ if bar then
103
+ BL .WidgetCaptureBar_Update (bar , nil , self )
104
+ end
105
+ else
106
+ for _ , bar in next , self .widgetFrames do
107
+ BL .WidgetCaptureBar_Update (bar , nil , self )
108
+ end
109
+ end
110
+ end
111
+
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
+
90
120
local function UpdatePosition (frame , _ , anchor )
91
121
local holder = frame .containerHolder
92
122
if holder and anchor ~= holder then
116
146
function BL :HandleWidgets ()
117
147
BL :BuildWidgetHolder (' TopCenterContainerHolder' , ' TopCenterContainerMover' , ' CENTER' , L [" TopCenterWidget" ], _G .UIWidgetTopCenterContainerFrame , ' TOP' , E .UIParent , ' TOP' , 0 , - 30 , 125 , 20 , ' ALL,WIDGETS' )
118
148
BL :BuildWidgetHolder (' BelowMinimapContainerHolder' , ' BelowMinimapContainerMover' , ' CENTER' , L [" BelowMinimapWidget" ], _G .UIWidgetBelowMinimapContainerFrame , ' TOPRIGHT' , _G .Minimap , ' BOTTOMRIGHT' , 0 , - 16 , 150 , 30 , ' ALL,WIDGETS' )
119
-
120
149
BL :BuildWidgetHolder (nil , ' GMMover' , ' TOP' , L [" GM Ticket Frame" ], _G .TicketStatusFrame , ' TOPLEFT' , E .UIParent , ' TOPLEFT' , 250 , - 5 , nil , nil , ' ALL,GENERAL' )
121
150
122
151
if E .Retail then
@@ -131,13 +160,18 @@ function BL:HandleWidgets()
131
160
end
132
161
133
162
if not E .Retail then
134
- _G .DurabilityFrame :SetFrameStrata (' HIGH' )
135
163
local duraWidth , duraHeight = _G .DurabilityFrame :GetSize ()
164
+ _G .DurabilityFrame :SetFrameStrata (' HIGH' )
165
+
136
166
BL :BuildWidgetHolder (' DurabilityFrameHolder' , ' DurabilityFrameMover' , ' CENTER' , L [" Durability Frame" ], _G .DurabilityFrame , ' TOPRIGHT' , E .UIParent , ' TOPRIGHT' , - 135 , - 300 , duraWidth , duraHeight , ' ALL,GENERAL' )
137
167
BL :UpdateDurabilityScale ()
138
168
end
139
169
140
170
-- Credits ShestakUI
141
171
hooksecurefunc (_G .UIWidgetTemplateStatusBarMixin , ' Setup' , BL .UIWidgetTemplateStatusBar )
142
- hooksecurefunc (_G .UIWidgetTemplateCaptureBarMixin , ' Setup' , BL .UIWidgetTemplateCaptureBar )
172
+
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
143
177
end
0 commit comments