Skip to content

Commit 26acdd6

Browse files
committed
spec switch icon size option
1 parent 1be7dee commit 26acdd6

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

ElvUI/Core/Defaults/Global.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ G.datatexts = {
8383
MovementSpeed = { Label = '', NoLabel = false, decimalLength = 1 },
8484
QuickJoin = { Label = '', NoLabel = false },
8585
Reputation = { textFormat = 'CUR' },
86-
['Talent/Loot Specialization'] = { displayStyle = 'BOTH', iconOnly = false },
86+
['Talent/Loot Specialization'] = { displayStyle = 'BOTH', iconSize = 16, iconOnly = false },
8787
SpellPower = { school = 0 },
8888
['Spell Crit Chance'] = { school = 0 },
8989
Speed = { Label = '', NoLabel = false, decimalLength = 1 },

ElvUI/Mainline/Modules/DataTexts/SpecSwitch.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ local loadoutList = { { text = L["Loadouts"], isTitle = true, notCheckable = tru
5050
local DEFAULT_TEXT = E:RGBToHex(0.9, 0.9, 0.9, nil, _G.TALENT_FRAME_DROP_DOWN_DEFAULT)
5151
local STARTER_TEXT = E:RGBToHex(BLUE_FONT_COLOR.r, BLUE_FONT_COLOR.g, BLUE_FONT_COLOR.b, nil, _G.TALENT_FRAME_DROP_DOWN_STARTER_BUILD)
5252

53-
local mainIcon = '|T%s:16:16:0:0:64:64:4:60:4:60|t'
53+
local mainSize = 16
54+
local mainIcon = '|T%s:%d:%d:0:0:64:64:4:60:4:60|t'
5455
local listIcon = '|T%s:16:16:0:0:50:50:4:46:4:46|t'
55-
local specText = '|T%s:14:14:0:0:64:64:4:60:4:60|t %s'
56+
local listText = '|T%s:14:14:0:0:64:64:4:60:4:60|t %s'
5657

5758
local function starter_checked()
5859
return GetStarterBuildActive()
@@ -92,7 +93,7 @@ local function OnEvent(self, event, loadoutID)
9293
local id, name, _, icon = GetSpecializationInfo(index)
9394
if id then
9495
menuList[index + 2] = { arg1 = id, text = name, checked = menu_checked, func = menu_func }
95-
specList[index + 1] = { arg1 = index, text = format(specText, icon, name), checked = spec_checked, func = spec_func }
96+
specList[index + 1] = { arg1 = index, text = format(listText, icon, name), checked = spec_checked, func = spec_func }
9697
end
9798
end
9899
end
@@ -147,7 +148,8 @@ local function OnEvent(self, event, loadoutID)
147148
active = specIndex
148149

149150
local db = E.global.datatexts.settings["Talent/Loot Specialization"]
150-
local spec, text = format(mainIcon, info.icon)
151+
local size = db.iconSize or mainSize
152+
local spec, text = format(mainIcon, info.icon, size, size)
151153
if db.displayStyle == 'BOTH' or db.displayStyle == 'SPEC' then
152154
if specialization == 0 or ID == specialization then
153155
if db.iconOnly then
@@ -156,11 +158,11 @@ local function OnEvent(self, event, loadoutID)
156158
text = format('%s %s', spec, info.name)
157159
end
158160
else
159-
info = DT.SPECIALIZATION_CACHE[specialization]
161+
local cache = DT.SPECIALIZATION_CACHE[specialization]
160162
if db.iconOnly then
161-
text = format('%s %s', spec, format(mainIcon, info.icon))
163+
text = format('%s %s', spec, format(mainIcon, cache.icon, size, size))
162164
else
163-
text = format('%s: %s %s: %s', L["Spec"], spec, LOOT, format(mainIcon, info.icon))
165+
text = format('%s: %s %s: %s', L["Spec"], spec, LOOT, format(mainIcon, cache.icon, size, size))
164166
end
165167
end
166168
end

ElvUI_Options/Core/DataTexts.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ local function CreateDTOptions(name, data)
242242
elseif name == 'Talent/Loot Specialization' then
243243
optionTable.args.displayStyle = ACH:Select(L["Display Style"], nil, 1, { SPEC = L["Specializations Only"], LOADOUT = L["Loadout Only"], BOTH = L["Spec/Loadout"] })
244244
optionTable.args.iconOnly = ACH:Toggle(L["Icons Only"], L["Only show icons instead of specialization names"], 2)
245+
optionTable.args.iconSize = ACH:Range(L["Icon Size"], nil, 3, { min = 10, softMax = 24, step = 1})
245246
elseif name == 'Time' then
246247
optionTable.args.time24 = ACH:Toggle(L["24-Hour Time"], L["Toggle 24-hour mode for the time datatext."], 5)
247248
optionTable.args.seconds = ACH:Toggle(L["Seconds"], L["Show seconds on the time display."], 6)

0 commit comments

Comments
 (0)