@@ -5,6 +5,7 @@ local LSM = LibStub("LibSharedMedia-3.0")
5
5
local L = LibStub (" AceLocale-3.0" ):GetLocale (" Gladius" , true )
6
6
7
7
8
+
8
9
local function DisableTexTiling (texture )
9
10
texture :SetHorizTile (false )
10
11
texture :SetVertTile (false )
@@ -222,6 +223,15 @@ function Gladius:CreateButton(i)
222
223
healthBar :SetPoint (" BOTTOMRIGHT" ,button ," BOTTOMRIGHT" )
223
224
healthBar :SetMinMaxValues (0 , 100 )
224
225
226
+ local healthBarBorder = CreateFrame (" Frame" , nil , healthBar )
227
+ healthBarBorder :SetPoint (" CENTER" , healthBar )
228
+ healthBarBorder :SetBackdrop ({
229
+ edgeFile = [[ Interface\Addons\Gladius\media\border\white16x16]] ,
230
+ edgeSize = 1 ,
231
+ insets = {left = 1 , right = 1 , top = 1 , bottom = 1 },
232
+ })
233
+ healthBar .border = healthBarBorder
234
+
225
235
healthBar .bg = healthBar :CreateTexture (nil , " BACKGROUND" )
226
236
healthBar .bg :ClearAllPoints ()
227
237
healthBar .bg :SetAllPoints (healthBar )
@@ -282,6 +292,15 @@ function Gladius:CreateButton(i)
282
292
manaBar .bg :SetAllPoints (manaBar )
283
293
manaBar .bg :SetAlpha (0.3 )
284
294
295
+ local manaBarBorder = CreateFrame (" Frame" , nil , manaBar )
296
+ manaBarBorder :SetPoint (" CENTER" , manaBar )
297
+ manaBarBorder :SetBackdrop ({
298
+ edgeFile = [[ Interface\Addons\Gladius\media\border\white16x16]] ,
299
+ edgeSize = 1 ,
300
+ insets = {left = 1 , right = 1 , top = 1 , bottom = 1 },
301
+ })
302
+ manaBar .border = manaBarBorder
303
+
285
304
-- Cast bar
286
305
local castBar = CreateFrame (" StatusBar" , " GladiusCastBar" .. i , button )
287
306
castBar :SetMinMaxValues (0 , 100 )
@@ -293,10 +312,25 @@ function Gladius:CreateButton(i)
293
312
castBar .bg :ClearAllPoints ()
294
313
castBar .bg :SetAllPoints (castBar )
295
314
315
+ castBar .border = CreateFrame (" Frame" , nil , castBar )
316
+ castBar .border :SetPoint (" CENTER" , castBar )
317
+ castBar .border :SetBackdrop ({
318
+ edgeFile = [[ Interface\Addons\Gladius\media\border\white16x16]] ,
319
+ edgeSize = 1 ,
320
+ insets = {left = 1 , right = 1 , top = 1 , bottom = 1 },
321
+ })
322
+
296
323
castBar .icon = castBar :CreateTexture (nil )
297
324
castBar .icon :ClearAllPoints ()
298
- castBar .icon :SetPoint (" RIGHT" , castBar , " LEFT" )
325
+ castBar .icon :SetPoint (" RIGHT" , castBar , " LEFT" , 1 , 0 )
299
326
castBar .icon :SetTexCoord (0.1 ,0.9 ,0.1 ,0.9 )
327
+ castBar .icon .border = CreateFrame (" Frame" , nil , castBar )
328
+ castBar .icon .border :SetPoint (" CENTER" , castBar .icon )
329
+ castBar .icon .border :SetBackdrop ({
330
+ edgeFile = [[ Interface\Addons\Gladius\media\border\white16x16]] ,
331
+ edgeSize = 1 ,
332
+ insets = {left = 1 , right = 1 , top = 1 , bottom = 1 },
333
+ })
300
334
301
335
castBar .spark = castBar :CreateTexture (nil , " OVERLAY" )
302
336
castBar .spark :SetTexture ([[ Interface\AddOns\Gladius\media\CastBar\ui-castingbar-spark2]] )
@@ -353,6 +387,13 @@ function Gladius:CreateButton(i)
353
387
icon .cooldown = _G [icon :GetName ().. " Cooldown" ]
354
388
icon .cooldown :SetReverse (false )
355
389
icon .cooldown :SetDrawEdge (true )
390
+ icon .border = CreateFrame (" Frame" , nil , icon )
391
+ icon .border :SetPoint (" CENTER" , icon )
392
+ icon .border :SetBackdrop ({
393
+ edgeFile = [[ Interface\Addons\Gladius\media\border\white16x16]] ,
394
+ edgeSize = 1 ,
395
+ insets = {left = 1 , right = 1 , top = 1 , bottom = 1 },
396
+ })
356
397
spellCooldownFrame [" icon" .. x ] = icon
357
398
end
358
399
@@ -849,6 +890,15 @@ function Gladius:UpdateFrame()
849
890
button .health :SetPoint (" BOTTOMRIGHT" ,button ," BOTTOMRIGHT" , healthBottom , 0 )
850
891
button .health :SetStatusBarTexture (LSM :Fetch (LSM .MediaType .STATUSBAR , db .barTexture ))
851
892
button .health .bg :SetTexture (LSM :Fetch (LSM .MediaType .STATUSBAR , db .barTexture ))
893
+ if (db .frameBorder ) then
894
+ button .health .border :Show ()
895
+ button .health .border :SetWidth (button .health :GetWidth ()+ 2 )
896
+ button .health .border :SetHeight (button .health :GetHeight ()+ 2 )
897
+ button .health .border :SetBackdropColor (0 , 0 , 0 , 0 )
898
+ button .health .border :SetBackdropBorderColor (0 , 0 , 0 , 1 )
899
+ else
900
+ button .health .border :Hide ()
901
+ end
852
902
DisableTexTiling (button .health :GetStatusBarTexture ())
853
903
DisableTexTiling (button .health .bg )
854
904
if db .smoothBar then
@@ -902,9 +952,18 @@ function Gladius:UpdateFrame()
902
952
button .mana :ClearAllPoints ()
903
953
button .mana :SetHeight (db .manaBarHeight )
904
954
button .mana :SetWidth (button .health :GetWidth ()+ targetIconSize - gridIcon )
905
- button .mana :SetPoint (" TOPLEFT" ,button .health ," BOTTOMLEFT" ,0 ,- 1 )
955
+ button .mana :SetPoint (" TOPLEFT" ,button .health ," BOTTOMLEFT" ,0 ,- 1 ) -- 0,-1
906
956
button .mana :SetStatusBarTexture (LSM :Fetch (LSM .MediaType .STATUSBAR , db .barTexture ))
907
957
button .mana .bg :SetTexture (LSM :Fetch (LSM .MediaType .STATUSBAR , db .barTexture ))
958
+ if (db .frameBorder ) then
959
+ button .mana .border :Show ()
960
+ button .mana .border :SetWidth (button .mana :GetWidth ()+ 2 )
961
+ button .mana .border :SetHeight (button .mana :GetHeight ()+ 2 )
962
+ button .mana .border :SetBackdropColor (0 , 0 , 0 , 0 )
963
+ button .mana .border :SetBackdropBorderColor (0 , 0 , 0 , 1 )
964
+ else
965
+ button .mana .border :Hide ()
966
+ end
908
967
DisableTexTiling (button .mana :GetStatusBarTexture ())
909
968
DisableTexTiling (button .mana .bg )
910
969
if db .smoothBar then
@@ -965,10 +1024,10 @@ function Gladius:UpdateFrame()
965
1024
end
966
1025
if (db .powerBar ) then
967
1026
local parent = db .castBarPos == " CENTER" and button .mana or button
968
- button .castBar :SetPoint (" TOPLEFT" ,parent , db .castBarPos == " CENTER" and " BOTTOMLEFT" or " TOP" .. db .castBarPos ,castBarX ,0 )
1027
+ button .castBar :SetPoint (" TOPLEFT" ,parent , db .castBarPos == " CENTER" and " BOTTOMLEFT" or " TOP" .. db .castBarPos ,castBarX , 0 )
969
1028
else
970
1029
local parent = db .castBarPos == " CENTER" and button .health or button
971
- button .castBar :SetPoint (" TOPLEFT" ,parent ,db .castBarPos == " CENTER" and " BOTTOMLEFT" or " TOP" .. db .castBarPos ,castBarX ,0 )
1030
+ button .castBar :SetPoint (" TOPLEFT" ,parent ,db .castBarPos == " CENTER" and " BOTTOMLEFT" or " TOP" .. db .castBarPos ,castBarX , 0 )
972
1031
end
973
1032
button .castBar :SetHeight (db .castBarHeight )
974
1033
@@ -985,11 +1044,29 @@ function Gladius:UpdateFrame()
985
1044
button .castBar :SetStatusBarColor (db .castBarColor .r ,db .castBarColor .g ,db .castBarColor .b ,db .castBarColor .a )
986
1045
button .castBar .bg :SetTexture (LSM :Fetch (LSM .MediaType .STATUSBAR , db .barTexture ))
987
1046
button .castBar .bg :SetVertexColor (db .castBarBgColor .r ,db .castBarBgColor .g ,db .castBarBgColor .b ,db .castBarBgColor .a )
1047
+ if (db .frameBorder ) then
1048
+ button .castBar .border :Show ()
1049
+ button .castBar .border :SetWidth (button .castBar :GetWidth ())
1050
+ button .castBar .border :SetHeight (button .castBar :GetHeight ())
1051
+ button .castBar .border :SetBackdropColor (0 , 0 , 0 , 0 )
1052
+ button .castBar .border :SetBackdropBorderColor (0 , 0 , 0 , 1 )
1053
+ else
1054
+ button .castBar .border :Hide ()
1055
+ end
988
1056
DisableTexTiling (button .castBar :GetStatusBarTexture ())
989
1057
DisableTexTiling (button .castBar .bg )
990
1058
991
1059
button .castBar .icon :SetHeight (db .castBarHeight )
992
1060
button .castBar .icon :SetWidth (db .castBarHeight )
1061
+ if (db .frameBorder ) then
1062
+ button .castBar .icon .border :Show ()
1063
+ button .castBar .icon .border :SetWidth (button .castBar .icon :GetWidth ())
1064
+ button .castBar .icon .border :SetHeight (button .castBar .icon :GetHeight ())
1065
+ button .castBar .icon .border :SetBackdropColor (0 , 0 , 0 , 0 )
1066
+ button .castBar .icon .border :SetBackdropBorderColor (0 , 0 , 0 , 1 )
1067
+ else
1068
+ button .castBar .icon .border :Hide ()
1069
+ end
993
1070
button .castBar .bg :ClearAllPoints ()
994
1071
button .castBar .bg :SetPoint (" RIGHT" ,button .castBar ," RIGHT" )
995
1072
button .castBar .bg :SetWidth (button .castBar :GetWidth ()+ db .castBarHeight )
@@ -1015,7 +1092,14 @@ function Gladius:UpdateFrame()
1015
1092
1016
1093
-- font sizes and color
1017
1094
button .text :SetFont (LSM :Fetch (LSM .MediaType .FONT , db .healthFont ), db .healthFontSize )
1095
+ if (not db .showName ) then
1096
+ button .text :Hide ()
1097
+ else
1098
+ button .text :Show ()
1099
+ end
1018
1100
button .healthText :SetFont (LSM :Fetch (LSM .MediaType .FONT , db .healthFont ), db .healthFontSize )
1101
+ button .healthText :ClearAllPoints ()
1102
+ button .healthText :SetPoint (db .healthTextAnchorPoint ,db .healthTextOffsetX ,db .healthTextOffsetY )
1019
1103
button .manaText :SetFont (LSM :Fetch (LSM .MediaType .FONT , db .manaFont ), db .manaFontSize )
1020
1104
button .classText :SetFont (LSM :Fetch (LSM .MediaType .FONT , db .manaFont ), db .manaFontSize )
1021
1105
button .castBar .spellText :SetFont (LSM :Fetch (LSM .MediaType .FONT , db .castBarFont ), db .castBarFontSize , db .castBarTextOutline )
@@ -1327,33 +1411,27 @@ function Gladius:UpdateFrame()
1327
1411
button .spellCooldownFrame :SetWidth (db .barHeight + extraBarHeight )
1328
1412
1329
1413
-- Update each cooldown icon
1330
- local iconPadding = 0
1331
- if db .cooldownIconPadding then
1332
- iconPadding = db .cooldownIconPadding
1333
- else
1334
- iconPadding = 2 -- default
1335
- end
1336
1414
for i = 1 ,14 do
1337
1415
local icon = button .spellCooldownFrame [" icon" .. i ]
1338
- icon :SetHeight (button .spellCooldownFrame :GetHeight ()/ 2 )
1339
- icon :SetWidth (button .spellCooldownFrame :GetWidth ()/ 2 )
1416
+ icon :SetHeight (button .spellCooldownFrame :GetHeight ()/ 2 - ( db . cooldownIconMargin / 2 ) )
1417
+ icon :SetWidth (button .spellCooldownFrame :GetWidth ()/ 2 - ( db . cooldownIconMargin / 2 ) )
1340
1418
icon :ClearAllPoints ()
1341
1419
1342
1420
if (db .cooldownPos == " RIGHT" ) then
1343
1421
if (i == 1 ) then
1344
1422
icon :SetPoint (" TOPLEFT" ,button .spellCooldownFrame )
1345
1423
elseif (i == 2 ) then
1346
- icon :SetPoint (" TOP" ,button .spellCooldownFrame [" icon" .. i - 1 ]," BOTTOM" ,0 ,- iconPadding )
1424
+ icon :SetPoint (" TOP" ,button .spellCooldownFrame [" icon" .. i - 1 ]," BOTTOM" ,0 ,- db . cooldownIconMargin )
1347
1425
elseif (i >= 3 ) then
1348
- icon :SetPoint (" LEFT" ,button .spellCooldownFrame [" icon" .. i - 2 ]," RIGHT" ,iconPadding ,0 )
1426
+ icon :SetPoint (" LEFT" ,button .spellCooldownFrame [" icon" .. i - 2 ]," RIGHT" ,db . cooldownIconMargin ,0 )
1349
1427
end
1350
1428
else
1351
1429
if (i == 1 ) then
1352
1430
icon :SetPoint (" TOPRIGHT" ,button .spellCooldownFrame )
1353
1431
elseif (i == 2 ) then
1354
- icon :SetPoint (" TOP" ,button .spellCooldownFrame [" icon" .. i - 1 ]," BOTTOM" ,0 ,- iconPadding )
1432
+ icon :SetPoint (" TOP" ,button .spellCooldownFrame [" icon" .. i - 1 ]," BOTTOM" ,0 ,- db . cooldownIconMargin )
1355
1433
elseif (i >= 3 ) then
1356
- icon :SetPoint (" RIGHT" ,button .spellCooldownFrame [" icon" .. i - 2 ]," LEFT" ,- iconPadding ,0 )
1434
+ icon :SetPoint (" RIGHT" ,button .spellCooldownFrame [" icon" .. i - 2 ]," LEFT" ,- db . cooldownIconMargin ,0 )
1357
1435
end
1358
1436
end
1359
1437
@@ -1367,9 +1445,19 @@ function Gladius:UpdateFrame()
1367
1445
icon :SetAlpha (1 )
1368
1446
icon .texture :SetTexture (" Interface\\ Icons\\ Spell_Holy_PainSupression" )
1369
1447
if db .hideCooldownBorder then
1370
- StyleActionButton (icon , true , iconPadding )
1448
+ StyleActionButton (icon , true , db . cooldownIconPadding )
1371
1449
else
1372
- StyleActionButton (icon , false , iconPadding )
1450
+ StyleActionButton (icon , false , db .cooldownIconPadding )
1451
+ end
1452
+
1453
+ if (db .frameBorder ) then
1454
+ icon .border :Show ()
1455
+ icon .border :SetWidth (icon :GetWidth ()+ 2 )
1456
+ icon .border :SetHeight (icon :GetHeight ()+ 2 )
1457
+ icon .border :SetBackdropColor (0 , 0 , 0 , 0 )
1458
+ icon .border :SetBackdropBorderColor (0 , 0 , 0 , 1 )
1459
+ else
1460
+ icon .border :Hide ()
1373
1461
end
1374
1462
1375
1463
if (not self .frame .testing ) then
@@ -1580,6 +1668,17 @@ function Gladius:UpdateFrame()
1580
1668
button .trinket :SetAlpha (alpha )
1581
1669
end
1582
1670
1671
+ -- set fake absorb value
1672
+ if ( db .absorbBar ) then
1673
+ button .absorb .overAbsorbGlow :Show ()
1674
+ button .absorb .totalAbsorb :Show ()
1675
+ button .absorb .totalAbsorbOverlay :Show ()
1676
+ else
1677
+ button .absorb .overAbsorbGlow :Hide ()
1678
+ button .absorb .totalAbsorb :Hide ()
1679
+ button .absorb .totalAbsorbOverlay :Hide ()
1680
+ end
1681
+
1583
1682
end
1584
1683
1585
1684
Gladius :UpdateAttributes (" arena" .. i )
0 commit comments