Skip to content

Commit 3472808

Browse files
committed
Revert "Experiment: progress text in a badge"
This reverts commit 4261158.
1 parent 9dd08a5 commit 3472808

2 files changed

Lines changed: 7 additions & 36 deletions

File tree

‎CSCoder_QuestIndicator.lua‎

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ local DEFAULTS = {
3333
progressColor = "white", -- "white", "gold", "green", "kind" (same colour as the icon) or "progress" (red to green)
3434
progressFormat = "slash", -- "slash" 8/12, "spaced" 8 / 12, "both" 8/12 (67%), "percent" 67%, "left" 4 left
3535
progressShadow = false, -- drop shadow behind the text
36-
progressBadge = true, -- the text sits in a badge (dark pill, gold border) -- experiment
3736
progressX = 36, -- its X
3837
progressY = 0, -- its Y
3938
bounce = true, -- floating up/down animation
@@ -108,9 +107,6 @@ local KIND_TINT = { daily = { 0.55, 0.8, 1 }, group = { 1, 0.5, 0.45 } }
108107
local TEXT_FONTS = { friz = "Fonts\\FRIZQT__.TTF", arial = "Fonts\\ARIALN.TTF", skurri = "Fonts\\skurri.ttf", morpheus = "Fonts\\MORPHEUS.TTF" }
109108
local TEXT_FONT_ORDER = { "friz", "arial", "skurri", "morpheus" }
110109
local PROGRESS_FORMATS = { "slash", "spaced", "both", "percent", "left" }
111-
local BADGE_BACKDROP = { bgFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
112-
tile = true, tileSize = 16, edgeSize = 10, insets = { left = 2, right = 2, top = 2, bottom = 2 } }
113-
local BADGE_PAD_X, BADGE_PAD_Y = 8, 5
114110

115111
local TEXT_OUTLINES = { none = "", thin = "OUTLINE", thick = "THICKOUTLINE" }
116112
local TEXT_COLORS = { white = { 1, 1, 1 }, gold = { 1, 0.82, 0 }, green = { 0.3, 1, 0.3 } }
@@ -362,8 +358,7 @@ local function PlaceText(f, wave)
362358
text:ClearAllPoints()
363359
label:ClearAllPoints()
364360
if db.progressAttach then
365-
-- In a badge the text is centred in the pill; plain, it starts right at the icon.
366-
label:SetPoint(db.progressBadge and "CENTER" or "LEFT")
361+
label:SetPoint("LEFT")
367362
text:SetPoint("LEFT", f, "RIGHT", ATTACH_GAP, lift)
368363
else
369364
label:SetPoint("CENTER")
@@ -417,16 +412,6 @@ local function StyleIcon(f)
417412
color = color or TEXT_COLORS.white
418413
label:SetTextColor(color[1], color[2], color[3])
419414
label:SetText(shown)
420-
-- Badge: a dark pill sized to the text, with a gold border.
421-
if db.progressBadge and text.SetBackdrop then
422-
text:SetBackdrop(BADGE_BACKDROP)
423-
text:SetBackdropColor(0.05, 0.04, 0.02, 0.85)
424-
text:SetBackdropBorderColor(1, 0.82, 0, 0.9)
425-
text:SetSize((label:GetStringWidth() or 30) + BADGE_PAD_X * 2, (label:GetStringHeight() or 12) + BADGE_PAD_Y * 2)
426-
else
427-
if text.SetBackdrop then text:SetBackdrop(nil) end
428-
text:SetSize(60, 20)
429-
end
430415
text:SetScale(1 / scale)
431416
PlaceText(f, 0)
432417
end
@@ -492,8 +477,7 @@ local function CreateIcon()
492477
icon:SetAllPoints()
493478
f.icon = icon
494479

495-
-- Backdrop template so the progress text can sit in a badge (dark pill, gold border).
496-
local text = CreateFrame("Frame", nil, f, BackdropTemplateMixin and "BackdropTemplate" or nil)
480+
local text = CreateFrame("Frame", nil, f)
497481
text:SetSize(60, 20)
498482
text.label = text:CreateFontString(nil, "OVERLAY")
499483
text.label:SetPoint("CENTER")
@@ -1560,7 +1544,7 @@ local DISPLAY_KEYS = { "active", "enabled", "objects", "anchor", "scale", "offse
15601544
"objectAnchor", "objectScale", "objectOffsetX", "objectOffset" }
15611545
local ICON_KEYS = { "style", "bounce", "bounceHeight", "bounceSpeed", "glow", "glowAlpha" }
15621546
local PROGRESS_KEYS = { "progress", "progressAttach", "progressFloat", "progressSize", "progressFont",
1563-
"progressOutline", "progressColor", "progressFormat", "progressShadow", "progressBadge", "progressX", "progressY" }
1547+
"progressOutline", "progressColor", "progressFormat", "progressShadow", "progressX", "progressY" }
15641548
local BEHAVIOR_KEYS = { "colorByType", "combat", "minimap", "minimapAngle", "sound", "soundChoice" }
15651549

15661550
local function ResetKeys(keys)
@@ -1662,13 +1646,12 @@ local function BuildProgressTab(tab)
16621646
Gate(ProgressOn, AddDropdown(tab, "TEXT_COLOR", { "white", "gold", "green", "kind", "progress" },
16631647
function(value) return L["COLOR_" .. value] end, Choice("progressColor"), SetChoice("progressColor"),
16641648
COL2 + 4, TOP - 162, COLUMN_DROPDOWN))
1665-
GateCheck(ProgressOn, AddCheck(tab, "TEXT_SHADOW", "TEXT_SHADOW_TIP", "progressShadow", COL1, TOP - 214))
1666-
GateCheck(ProgressOn, AddCheck(tab, "PROGRESS_BADGE", "PROGRESS_BADGE_TIP", "progressBadge", COL2, TOP - 214))
1649+
GateCheck(ProgressOn, AddCheck(tab, "TEXT_SHADOW", "TEXT_SHADOW_TIP", "progressShadow", COL1, TOP - 196))
16671650

16681651
-- Attached, the text is glued to the icon: X/Y only apply when it stands on its own.
16691652
local function FreeTextOn() return ProgressOn() and not db.progressAttach end
1670-
Gate(FreeTextOn, AddSlider(tab, "POS_X", "progressX", -POSITION_RANGE, POSITION_RANGE, 1, COL1 + 4, TOP - 270, "%d"))
1671-
Gate(FreeTextOn, AddSlider(tab, "POS_Y", "progressY", -POSITION_RANGE, POSITION_RANGE, 1, COL2 + 4, TOP - 270, "%d"))
1653+
Gate(FreeTextOn, AddSlider(tab, "POS_X", "progressX", -POSITION_RANGE, POSITION_RANGE, 1, COL1 + 4, TOP - 252, "%d"))
1654+
Gate(FreeTextOn, AddSlider(tab, "POS_Y", "progressY", -POSITION_RANGE, POSITION_RANGE, 1, COL2 + 4, TOP - 252, "%d"))
16721655
end
16731656

16741657
local function BuildIconTab(tab)
@@ -1830,7 +1813,7 @@ end
18301813
local SETTINGS_SECTIONS = {
18311814
{ key = "TAB_DISPLAY", build = BuildDisplayTab, height = 258 },
18321815
{ key = "TAB_ICON", build = BuildIconTab, height = 184 },
1833-
{ key = "TAB_PROGRESS", build = BuildProgressTab, height = 310 },
1816+
{ key = "TAB_PROGRESS", build = BuildProgressTab, height = 292 },
18341817
{ key = "TAB_BEHAVIOR", build = BuildBehaviorTab, height = 152 },
18351818
}
18361819
local SECTION_GAP = 18

‎Locales.lua‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -758,18 +758,6 @@ for code, keys in pairs(textFormat) do
758758
for k, v in pairs(keys) do locales[code][k] = v end
759759
end
760760

761-
-- Progress badge.
762-
local badgeText = {
763-
enUS = { "Show in a badge", "The count inside a dark pill with a gold border." },
764-
ptBR = { "Mostrar num badge", "A contagem dentro de uma pílula escura com borda dourada." },
765-
esES = { "Mostrar en una insignia", "El contador dentro de una píldora oscura con borde dorado." },
766-
deDE = { "Als Abzeichen anzeigen", "Der Zähler in einer dunklen Pille mit goldenem Rand." },
767-
frFR = { "Afficher dans un badge", "Le compteur dans une pastille sombre au bord doré." },
768-
itIT = { "Mostra in un badge", "Il contatore in una pillola scura con bordo dorato." },
769-
}
770-
for code, texts in pairs(badgeText) do
771-
locales[code].PROGRESS_BADGE, locales[code].PROGRESS_BADGE_TIP = texts[1], texts[2]
772-
end
773761
-- Icon anchor: which side of the nameplate the icon sits on.
774762
local anchorText = {
775763
enUS = { ICON_ANCHOR = "Anchor", ANCHOR_top = "Top", ANCHOR_bottom = "Bottom", ANCHOR_left = "Left", ANCHOR_right = "Right" },

0 commit comments

Comments
 (0)