Skip to content

Commit e54236f

Browse files
committed
added cooldown margin / padding / border
1 parent a123032 commit e54236f

File tree

5 files changed

+230
-28
lines changed

5 files changed

+230
-28
lines changed

Gladius/Gladius.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,15 +1705,9 @@ function Gladius:Test()
17051705

17061706
--set fake absorb value
17071707
if( db.absorbBar ) then
1708-
button.absorb.overAbsorbGlow:Show()
1709-
button.absorb.totalAbsorb:Show()
1710-
button.absorb.totalAbsorbOverlay:Show()
17111708
button.absorb.totalAbsorb:SetWidth(100-(i^2))
17121709
button.absorb.totalAbsorbOverlay:SetWidth(100-(i^2))
17131710
else
1714-
button.absorb.overAbsorbGlow:Hide()
1715-
button.absorb.totalAbsorb:Hide()
1716-
button.absorb.totalAbsorbOverlay:Hide()
17171711
button.absorb.totalAbsorb:SetWidth(0)
17181712
button.absorb.totalAbsorbOverlay:SetWidth(0)
17191713
end

Gladius/frame.lua

Lines changed: 117 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local LSM = LibStub("LibSharedMedia-3.0")
55
local L = LibStub("AceLocale-3.0"):GetLocale("Gladius", true)
66

77

8+
89
local function DisableTexTiling(texture)
910
texture:SetHorizTile(false)
1011
texture:SetVertTile(false)
@@ -222,6 +223,15 @@ function Gladius:CreateButton(i)
222223
healthBar:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT")
223224
healthBar:SetMinMaxValues(0, 100)
224225

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+
225235
healthBar.bg = healthBar:CreateTexture(nil, "BACKGROUND")
226236
healthBar.bg:ClearAllPoints()
227237
healthBar.bg:SetAllPoints(healthBar)
@@ -282,6 +292,15 @@ function Gladius:CreateButton(i)
282292
manaBar.bg:SetAllPoints(manaBar)
283293
manaBar.bg:SetAlpha(0.3)
284294

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+
285304
--Cast bar
286305
local castBar = CreateFrame("StatusBar", "GladiusCastBar"..i, button)
287306
castBar:SetMinMaxValues(0, 100)
@@ -293,10 +312,25 @@ function Gladius:CreateButton(i)
293312
castBar.bg:ClearAllPoints()
294313
castBar.bg:SetAllPoints(castBar)
295314

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+
296323
castBar.icon = castBar:CreateTexture(nil)
297324
castBar.icon:ClearAllPoints()
298-
castBar.icon:SetPoint("RIGHT", castBar, "LEFT")
325+
castBar.icon:SetPoint("RIGHT", castBar, "LEFT",1,0)
299326
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+
})
300334

301335
castBar.spark = castBar:CreateTexture(nil, "OVERLAY")
302336
castBar.spark:SetTexture([[Interface\AddOns\Gladius\media\CastBar\ui-castingbar-spark2]])
@@ -353,6 +387,13 @@ function Gladius:CreateButton(i)
353387
icon.cooldown = _G[icon:GetName().."Cooldown"]
354388
icon.cooldown:SetReverse(false)
355389
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+
})
356397
spellCooldownFrame["icon"..x] = icon
357398
end
358399

@@ -849,6 +890,15 @@ function Gladius:UpdateFrame()
849890
button.health:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT", healthBottom, 0)
850891
button.health:SetStatusBarTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture))
851892
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
852902
DisableTexTiling(button.health:GetStatusBarTexture())
853903
DisableTexTiling(button.health.bg)
854904
if db.smoothBar then
@@ -902,9 +952,18 @@ function Gladius:UpdateFrame()
902952
button.mana:ClearAllPoints()
903953
button.mana:SetHeight(db.manaBarHeight)
904954
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
906956
button.mana:SetStatusBarTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture))
907957
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
908967
DisableTexTiling(button.mana:GetStatusBarTexture())
909968
DisableTexTiling(button.mana.bg)
910969
if db.smoothBar then
@@ -965,10 +1024,10 @@ function Gladius:UpdateFrame()
9651024
end
9661025
if (db.powerBar) then
9671026
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)
9691028
else
9701029
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)
9721031
end
9731032
button.castBar:SetHeight(db.castBarHeight)
9741033

@@ -985,11 +1044,29 @@ function Gladius:UpdateFrame()
9851044
button.castBar:SetStatusBarColor(db.castBarColor.r,db.castBarColor.g,db.castBarColor.b,db.castBarColor.a)
9861045
button.castBar.bg:SetTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture))
9871046
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
9881056
DisableTexTiling(button.castBar:GetStatusBarTexture())
9891057
DisableTexTiling(button.castBar.bg)
9901058

9911059
button.castBar.icon:SetHeight(db.castBarHeight)
9921060
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
9931070
button.castBar.bg:ClearAllPoints()
9941071
button.castBar.bg:SetPoint("RIGHT",button.castBar,"RIGHT")
9951072
button.castBar.bg:SetWidth(button.castBar:GetWidth()+db.castBarHeight)
@@ -1015,7 +1092,14 @@ function Gladius:UpdateFrame()
10151092

10161093
--font sizes and color
10171094
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
10181100
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)
10191103
button.manaText:SetFont(LSM:Fetch(LSM.MediaType.FONT, db.manaFont), db.manaFontSize)
10201104
button.classText:SetFont(LSM:Fetch(LSM.MediaType.FONT, db.manaFont), db.manaFontSize)
10211105
button.castBar.spellText:SetFont(LSM:Fetch(LSM.MediaType.FONT, db.castBarFont), db.castBarFontSize, db.castBarTextOutline)
@@ -1327,33 +1411,27 @@ function Gladius:UpdateFrame()
13271411
button.spellCooldownFrame:SetWidth(db.barHeight+extraBarHeight)
13281412

13291413
-- 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
13361414
for i=1,14 do
13371415
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))
13401418
icon:ClearAllPoints()
13411419

13421420
if(db.cooldownPos == "RIGHT") then
13431421
if(i==1) then
13441422
icon:SetPoint("TOPLEFT",button.spellCooldownFrame)
13451423
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)
13471425
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)
13491427
end
13501428
else
13511429
if(i==1) then
13521430
icon:SetPoint("TOPRIGHT",button.spellCooldownFrame)
13531431
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)
13551433
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)
13571435
end
13581436
end
13591437

@@ -1367,9 +1445,19 @@ function Gladius:UpdateFrame()
13671445
icon:SetAlpha(1)
13681446
icon.texture:SetTexture("Interface\\Icons\\Spell_Holy_PainSupression")
13691447
if db.hideCooldownBorder then
1370-
StyleActionButton(icon, true, iconPadding)
1448+
StyleActionButton(icon, true, db.cooldownIconPadding)
13711449
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()
13731461
end
13741462

13751463
if (not self.frame.testing) then
@@ -1580,6 +1668,17 @@ function Gladius:UpdateFrame()
15801668
button.trinket:SetAlpha(alpha)
15811669
end
15821670

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+
15831682
end
15841683

15851684
Gladius:UpdateAttributes("arena"..i)

Gladius/localization/enUS.lua

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ L["If this is not your first run please lock or move the frame to prevent this f
1414
--Frame
1515
L["Gladius - drag to move"] = "Gladius - drag to move"
1616

17+
--Anchoring options
18+
L['Top left'] = "Top left"
19+
L['Top'] = "Top"
20+
L['Top right'] = "Top right"
21+
L['Left'] = "Left"
22+
L['Center'] = "Center"
23+
L['Right'] = "Right"
24+
L['Bottom left'] = "Bottom left"
25+
L['Bottom'] = "Bottom"
26+
L['Bottom right'] = "Bottom right"
27+
1728
--Options
1829
L["General"] = "General"
1930
L["General settings"] = "General settings"
@@ -50,8 +61,11 @@ L["Show race text on the power bar"] = "Show race text on the power bar"
5061
L["Show class text"] = "Show class text"
5162
L["Show class text on the power bar"] = "Show class text on the power bar"
5263
L["Highlight target"] = "Highlight target"
53-
L["Toggle if the selected target should be highlighted"] = "Toggle if the selected target should be highlighted"
5464
L["Highlight target with a custom border"] = "Highlight target with a custom border"
65+
L["Toggle if the selected target should be highlighted"] = "Toggle if the selected target should be highlighted"
66+
L["Show Frame Border"] = "Show Frame Border"
67+
L["Show Frame Border"] = "Show Frame Border"
68+
L["Show a thin black border around element to help contrast it with the game"] = "Show a thin black border around element to help contrast it with the game"
5569
L["Toggle if the selected target should be highlighted with a border"] = "Toggle if the selected target should be highlighted with a border"
5670
L["Highlight target border color"] = "Highlight target border color"
5771
L["Highlight border will be inside the healthbar"] = "Highlight border will be inside the healthbar"
@@ -97,6 +111,12 @@ L["Use game default runic power color"] = "Use game default runic power color"
97111
L["Cast bar color"] = "Cast bar color"
98112
L["Color of the cast bar"] = "Color of the cast bar"
99113
L["Health text size"] = "Health text size"
114+
L["Health text Anchor Point"] = "Health text Anchor Point"
115+
L["Health text justify"] = "Health text justify"
116+
L["Select the alignement of the text"] = "Select the alignement of the text"
117+
L["Health text offset X"] = "Health text offset X"
118+
L["Health text offset Y"] = "Health text offset Y"
119+
L["Select which side of the health text is attached to the unit frame."] = "Select which side of the health text is attached to the unit frame."
100120
L["Size of the health bar text"] = "Size of the health bar text"
101121
L["Health text color"] = "Health text color"
102122
L["Color of the health bar text"] = "Color of the health bar text"
@@ -128,6 +148,7 @@ L["Font of the aura text"] = "Font of the aura text"
128148
L["Cast bar position"] = "Cast bar position"
129149
L["Position of the cast bar"] = "Position of the cast bar"
130150
L["Show absorb bars"] = "Show absorb bars"
151+
L["Smooth bars"] = "Smooth bars"
131152
L["Use smooth bars"] = "Use smooth bars"
132153
L["Smoothing Amount"] = "Smoothing Amount"
133154
L["Controls the speed at which smoothed bars will be updated."] = "Controls the speed at which smoothed bars will be updated."
@@ -148,6 +169,8 @@ L["Show PvP trinket status"] = "Show PvP trinket status"
148169
L["Show PvP trinket status to the right of the enemy name"] = "Show PvP trinket status to the right of the enemy name"
149170
L["Sizes"] = "Sizes"
150171
L["Size settings for the text"] = "Size settings for the text"
172+
L["Positions"] = "Positions"
173+
L["Positions settings"] = "Positions settings"
151174
L["Big icon scale"] = "Big icon scale"
152175
L["Big icon OffsetX"] = "Big icon OffsetX"
153176
L["Big icon OffsetY"] = "Big icon OffsetY"
@@ -255,6 +278,7 @@ L["COOLDOWN USED: %s (%s) used %s - %s sec. cooldown"] = "COOLDOWN USED: %s (%s)
255278
-- Test frames
256279
L["Arena "] = "Arena "
257280

281+
L["Show enemy name"] = "Show enemy name"
258282
L["Shorten Health/Power text"] = "Shorten Health/Power text"
259283
L["Shorten the formatting of the health and power text to e.g. 20.0/25.3 when the amount is over 9999"] = "Shorten the formatting of the health and power text to e.g. 20.0/25.3 when the amount is over 9999"
260284
L["Show health percentage"] = "Show health percentage"
@@ -380,6 +404,7 @@ L["Cooldown list"] = "Cooldown list"
380404
L["Show cooldown"] = "Show cooldown"
381405
L["Hide Cooldown border"] = "Hide Cooldown border"
382406
L["Cooldown icon padding"] = "Cooldown icon padding"
407+
L["Cooldown icon margin"] = "Cooldown icon margin"
383408
L["Glow when cooldown is active"] = "Glow when cooldown is active"
384409
L["Desaturate used cooldown"] = "Desature used cooldown"
385410
L["Used cooldown opacity"] = "Used cooldown opacity"

Gladius/media/border/white16x16.tga

812 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)