@@ -12,7 +12,7 @@ BUI.Curved={
12
12
-- CurvedShiftAnimation
13
13
}
14
14
}
15
- local ch ,cm ,cs ,cw ,ch1 ,cm1 ,cs1 ,cw1 ,rh ,rh1
15
+ local ch ,cm ,cs ,ct , cw ,ch1 ,cm1 ,cs1 , ct1 ,cw1 ,rh ,rh1
16
16
local disable_hit_anim
17
17
local coords = {
18
18
-- Simple
@@ -91,30 +91,37 @@ local function UI_Init()
91
91
[1 ] = BUI .UI .Texture (" BUI_Curved_HealthTop1" , ui , {w1 ,h * delta }, {BOTTOMLEFT ,(delta == 1 and BOTTOMLEFT or LEFT ),0 ,0 }, texture , false , {1 ,0 }, coord ),
92
92
[2 ] = BUI .UI .Texture (" BUI_Curved_HealthTop2" , ui , {w1 ,h * delta }, {BOTTOMLEFT ,(delta == 1 and BOTTOMLEFT or LEFT ),0 ,0 }, texture , false , {0 ,1 }, coord ),
93
93
[3 ] = BUI .UI .Texture (" BUI_Curved_HealthTop3" , ui , {w1 ,h * delta }, {BOTTOMLEFT ,(delta == 1 and BOTTOMLEFT or LEFT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
94
+ [4 ] = BUI .UI .Texture (" BUI_Curved_HealthTop4" , ui , {w1 ,h * delta }, {BOTTOMLEFT ,(delta == 1 and BOTTOMLEFT or LEFT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
94
95
coord = coord
95
96
}
96
97
ui .health .top [1 ]:SetGradientColors (2 ,ch [1 ],ch [2 ],ch [3 ],ch [4 ],ch1 [1 ],ch1 [2 ],ch1 [3 ],ch1 [4 ])
97
98
ui .health .top [2 ]:SetColor (ch [1 ],ch [2 ],ch [3 ],.4 )
98
99
ui .health .top [3 ]:SetGradientColors (2 ,cw [1 ],cw [2 ],cw [3 ],cw [4 ],cw1 [1 ],cw1 [2 ],cw1 [3 ],cw1 [4 ])
99
100
ui .health .top [3 ]:SetAlpha (.4 )
101
+ ui .health .top [4 ]:SetGradientColors (2 ,ct [1 ],ct [2 ],ct [3 ],ct [4 ],ct1 [1 ],ct1 [2 ],ct1 [3 ],ct1 [4 ])
102
+ ui .health .top [4 ]:SetAlpha (ct [4 ])
100
103
local coord = coords [c ][3 ]
101
104
if coord then
102
105
local delta = math.abs (coord [3 ]- coord [4 ])
103
106
ui .health .bot = {
104
107
[1 ] = BUI .UI .Texture (" BUI_Curved_HealthBot1" , ui , {w1 ,h * delta }, {TOPLEFT ,(delta == 1 and TOPLEFT or LEFT ),0 ,0 }, texture , false , {1 ,0 }, coord ),
105
108
[2 ] = BUI .UI .Texture (" BUI_Curved_HealthBot2" , ui , {w1 ,h * delta }, {TOPLEFT ,(delta == 1 and TOPLEFT or LEFT ),0 ,0 }, texture , false , {0 ,1 }, coord ),
106
109
[3 ] = BUI .UI .Texture (" BUI_Curved_HealthBot3" , ui , {w1 ,h * delta }, {TOPLEFT ,(delta == 1 and TOPLEFT or LEFT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
110
+ [4 ] = BUI .UI .Texture (" BUI_Curved_HealthBot4" , ui , {w1 ,h * delta }, {TOPLEFT ,(delta == 1 and TOPLEFT or LEFT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
107
111
coord = coord
108
112
}
109
113
ui .health .bot [1 ]:SetGradientColors (2 ,ch1 [1 ],ch1 [2 ],ch1 [3 ],ch1 [4 ],ch [1 ],ch [2 ],ch [3 ],ch [4 ])
110
114
ui .health .bot [2 ]:SetColor (ch [1 ],ch [2 ],ch [3 ],.4 )
111
115
ui .health .bot [3 ]:SetGradientColors (2 ,cw1 [1 ],cw1 [2 ],cw1 [3 ],cw1 [4 ],cw [1 ],cw [2 ],cw [3 ],cw [4 ])
112
116
ui .health .bot [3 ]:SetAlpha (.4 )
117
+ ui .health .bot [4 ]:SetGradientColors (2 ,ct1 [1 ],ct1 [2 ],ct1 [3 ],ct1 [4 ],ct [1 ],ct [2 ],ct [3 ],ct [4 ])
118
+ ui .health .bot [4 ]:SetAlpha (ct [4 ])
113
119
else
114
120
ui .health .bot = nil
115
121
if BUI_Curved_HealthBot1 then BUI_Curved_HealthBot1 :SetHidden (true ) end
116
122
if BUI_Curved_HealthBot2 then BUI_Curved_HealthBot2 :SetHidden (true ) end
117
123
if BUI_Curved_HealthBot3 then BUI_Curved_HealthBot3 :SetHidden (true ) end
124
+ if BUI_Curved_HealthBot4 then BUI_Curved_HealthBot4 :SetHidden (true ) end
118
125
end
119
126
Attributes .player .health .frame = ui .health
120
127
@@ -144,30 +151,37 @@ local function UI_Init()
144
151
[1 ] = BUI .UI .Texture (" BUI_Curved_TargetBot1" , target , {w1 ,h * delta }, {BOTTOMRIGHT ,(delta == 1 and BOTTOMRIGHT or RIGHT ),0 ,0 }, texture , false , {1 ,0 }, coord ),
145
152
[2 ] = BUI .UI .Texture (" BUI_Curved_TargetBot2" , target , {w1 ,h * delta }, {BOTTOMRIGHT ,(delta == 1 and BOTTOMRIGHT or RIGHT ),0 ,0 }, texture , false , {0 ,1 }, coord ),
146
153
[3 ] = BUI .UI .Texture (" BUI_Curved_TargetBot3" , target , {w1 ,h * delta }, {BOTTOMRIGHT ,(delta == 1 and BOTTOMRIGHT or RIGHT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
154
+ [4 ] = BUI .UI .Texture (" BUI_Curved_TargetBot4" , target , {w1 ,h * delta }, {BOTTOMRIGHT ,(delta == 1 and BOTTOMRIGHT or RIGHT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
147
155
coord = coord
148
156
}
149
157
ui .target .bot [1 ]:SetGradientColors (2 ,ch [1 ],ch [2 ],ch [3 ],ch [4 ],ch1 [1 ],ch1 [2 ],ch1 [3 ],ch1 [4 ])
150
158
ui .target .bot [2 ]:SetColor (ch [1 ],ch [2 ],ch [3 ],.4 )
151
159
ui .target .bot [3 ]:SetGradientColors (2 ,cw [1 ],cw [2 ],cw [3 ],cw [4 ],cw1 [1 ],cw1 [2 ],cw1 [3 ],cw1 [4 ])
152
160
ui .target .bot [3 ]:SetAlpha (.4 )
161
+ ui .target .bot [4 ]:SetGradientColors (2 ,ct [1 ],ct [2 ],ct [3 ],ct [4 ],ct1 [1 ],ct1 [2 ],ct1 [3 ],ct1 [4 ])
162
+ ui .target .bot [4 ]:SetAlpha (ct [4 ])
153
163
local coord = coords [c ][10 ]
154
164
if coord then
155
165
local delta = math.abs (coord [3 ]- coord [4 ])
156
166
ui .target .top = {
157
167
[1 ] = BUI .UI .Texture (" BUI_Curved_TargetTop1" , target , {w1 ,h * delta }, {TOPRIGHT ,(delta == 1 and TOPRIGHT or RIGHT ),0 ,0 }, texture , false , {1 ,0 }, coord ),
158
168
[2 ] = BUI .UI .Texture (" BUI_Curved_TargetTop2" , target , {w1 ,h * delta }, {TOPRIGHT ,(delta == 1 and TOPRIGHT or RIGHT ),0 ,0 }, texture , false , {0 ,1 }, coord ),
159
169
[3 ] = BUI .UI .Texture (" BUI_Curved_TargetTop3" , target , {w1 ,h * delta }, {TOPRIGHT ,(delta == 1 and TOPRIGHT or RIGHT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
170
+ [4 ] = BUI .UI .Texture (" BUI_Curved_TargetTop4" , target , {w1 ,h * delta }, {TOPRIGHT ,(delta == 1 and TOPRIGHT or RIGHT ),0 ,0 }, texture , true , {1 ,1 }, coord ),
160
171
coord = coord
161
172
}
162
173
ui .target .top [1 ]:SetGradientColors (2 ,ch1 [1 ],ch1 [2 ],ch1 [3 ],ch1 [4 ],ch [1 ],ch [2 ],ch [3 ],ch [4 ])
163
174
ui .target .top [2 ]:SetColor (ch [1 ],ch [2 ],ch [3 ],.4 )
164
175
ui .target .top [3 ]:SetGradientColors (2 ,cw1 [1 ],cw1 [2 ],cw1 [3 ],cw1 [4 ],cw [1 ],cw [2 ],cw [3 ],cw [4 ])
165
176
ui .target .top [3 ]:SetAlpha (.4 )
177
+ ui .target .top [4 ]:SetGradientColors (2 ,ct1 [1 ],ct1 [2 ],ct1 [3 ],ct1 [4 ],ct [1 ],ct [2 ],ct [3 ],ct [4 ])
178
+ ui .target .top [4 ]:SetAlpha (ct [4 ])
166
179
else
167
180
ui .target .top = nil
168
181
if BUI_Curved_TargetTop1 then BUI_Curved_TargetTop1 :SetHidden (true ) end
169
182
if BUI_Curved_TargetTop2 then BUI_Curved_TargetTop2 :SetHidden (true ) end
170
183
if BUI_Curved_TargetTop3 then BUI_Curved_TargetTop3 :SetHidden (true ) end
184
+ if BUI_Curved_TargetTop4 then BUI_Curved_TargetTop4 :SetHidden (true ) end
171
185
end
172
186
Attributes .reticleover .health .frame = ui .target
173
187
@@ -432,7 +446,7 @@ local function FramesFadeCheck(pct)
432
446
end
433
447
end
434
448
435
- function BUI .Curved .Attribute (unitTag , attribute , powerValue , powerMax , pct , shieldValue )
449
+ function BUI .Curved .Attribute (unitTag , attribute , powerValue , powerMax , pct , shieldValue , traumaValue )
436
450
local frame = Attributes [unitTag ] and Attributes [unitTag ][attribute ] and Attributes [unitTag ][attribute ].frame
437
451
if not frame then return end
438
452
@@ -455,23 +469,43 @@ function BUI.Curved.Attribute(unitTag, attribute, powerValue, powerMax, pct, shi
455
469
456
470
ChangeAttribute (frame ,pct )
457
471
if frame .cur then
458
- local shield = ((attribute == " health" and shieldValue and shieldValue > 0 ) and " [" .. BUI .DisplayNumber (shieldValue / 1000 ).. " k]" or " " )
459
- frame .cur :SetText (BUI .DisplayNumber (powerValue / 1000 , 1 ).. " k" .. shield )
472
+ local preText = ((shieldValue > 0 or traumaValue > 0 ) and " [" or " " )
473
+ local postText = ((shieldValue > 0 or traumaValue > 0 ) and " ]" or " " )
474
+ local shield = ((attribute == " health" and shieldValue and shieldValue > 0 ) and BUI .DisplayNumber (shieldValue / 1000 ).. " k" or " " )
475
+ local trauma = ((attribute == " health" and traumaValue and traumaValue > 0 ) and " -" .. BUI .DisplayNumber (traumaValue / 1000 ).. " k" or " " )
476
+ frame .cur :SetText (BUI .DisplayNumber (powerValue / 1000 , 1 ).. " k" .. preText .. shield .. trauma .. postText )
460
477
end
461
478
if frame .pct then frame .pct :SetText (pct * 100 .. " %" ) end
462
479
end
463
480
464
- function BUI .Curved .Shield (unitTag ,value ,pct ,health )
465
- local frame = Attributes [unitTag ] and Attributes [unitTag ].health and Attributes [unitTag ].health .frame
481
+ function BUI .Curved .Shield (unitTag ,value ,pct ,health , traumaValue )
482
+ local frame = Attributes [unitTag ] and Attributes [unitTag ].health and Attributes [unitTag ].health .frame
466
483
if frame then
467
484
if frame .cur then
468
- local shield = (value > 0 and " [" .. BUI .DisplayNumber (value / 1000 ).. " k]" or " " )
469
- frame .cur :SetText (BUI .DisplayNumber (health / 1000 , 1 ).. " k" .. shield )
485
+ local preText = ((value > 0 or traumaValue > 0 ) and " [" or " " )
486
+ local postText = ((value > 0 or traumaValue > 0 ) and " ]" or " " )
487
+ local shield = (value > 0 and BUI .DisplayNumber (value / 1000 ).. " k" or " " )
488
+ local trauma = (traumaValue > 0 and " -" .. BUI .DisplayNumber (traumaValue / 1000 ).. " k" or " " )
489
+ frame .cur :SetText (BUI .DisplayNumber (health / 1000 , 1 ).. " k" .. preText .. shield .. trauma .. postText )
470
490
end
471
491
ChangeAttribute (frame ,pct ,3 )
472
492
end
473
493
end
474
494
495
+ function BUI .Curved .Trauma (unitTag ,value ,pct ,health ,shieldValue )
496
+ local frame = Attributes [unitTag ] and Attributes [unitTag ].health and Attributes [unitTag ].health .frame
497
+ if frame then
498
+ if frame .cur then
499
+ local preText = ((value > 0 or shieldValue > 0 ) and " [" or " " )
500
+ local postText = ((value > 0 or shieldValue > 0 ) and " ]" or " " )
501
+ local shield = (shieldValue > 0 and BUI .DisplayNumber (shieldValue / 1000 ).. " k" or " " )
502
+ local trauma = (value > 0 and " -" .. BUI .DisplayNumber (value / 1000 ).. " k" or " " )
503
+ frame .cur :SetText (BUI .DisplayNumber (health / 1000 , 1 ).. " k" .. preText .. shield .. trauma .. postText )
504
+ end
505
+ ChangeAttribute (frame ,pct ,4 )
506
+ end
507
+ end
508
+
475
509
function BUI .Curved .Target (show )
476
510
if show then
477
511
local powerValue , powerMax = GetUnitPower (' reticleover' , POWERTYPE_HEALTH )
@@ -560,8 +594,8 @@ function BUI.Curved.Initialize() --Initialisation
560
594
return
561
595
end
562
596
theme_color = BUI .Vars .Theme == 6 and {1 ,204 / 255 ,248 / 255 ,1 } or BUI .Vars .Theme == 7 and BUI .Vars .AdvancedThemeColor or BUI .Vars .CustomEdgeColor
563
- ch ,cm ,cs ,cw = BUI .Vars .FrameHealthColor ,BUI .Vars .FrameMagickaColor ,BUI .Vars .FrameStaminaColor ,BUI .Vars .FrameShieldColor
564
- ch1 ,cm1 ,cs1 ,cw1 = BUI .Vars .FrameHealthColor1 ,BUI .Vars .FrameMagickaColor1 ,BUI .Vars .FrameStaminaColor1 ,BUI .Vars .FrameShieldColor1
597
+ ch ,cm ,cs ,cw , ct = BUI .Vars .FrameHealthColor ,BUI .Vars .FrameMagickaColor ,BUI .Vars .FrameStaminaColor ,BUI .Vars .FrameShieldColor , BUI . Vars . FrameTraumaColor
598
+ ch1 ,cm1 ,cs1 ,cw1 , ct1 = BUI .Vars .FrameHealthColor1 ,BUI .Vars .FrameMagickaColor1 ,BUI .Vars .FrameStaminaColor1 ,BUI .Vars .FrameShieldColor1 , BUI . Vars . FrameTraumaColor1
565
599
rh ,rh1 = {1 - ch [1 ],1 - ch [2 ],1 - ch [3 ],1 - ch [4 ]},{1 - ch1 [1 ],1 - ch1 [2 ],1 - ch1 [3 ],1 - ch1 [4 ]}
566
600
disable_hit_anim =not BUI .Vars .CurvedHitAnimation
567
601
UI_Init ()
0 commit comments