Skip to content

Commit 8f84607

Browse files
committed
Made the Catalyst + Upgrade combined icon a lot prettier, and added an option to change the size of the Baganator icon (fixes #13)
1 parent 178395d commit 8f84607

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

TransmogUpgradeMaster.lua

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ local LEARNED_FROM_OTHER_ITEM = 'learnedFromOtherItem'
2020

2121
local BONUS_ID_OFFSET = 13
2222
local ITEM_UPGRADE_TOOLTIP_PATTERN = ITEM_UPGRADE_TOOLTIP_FORMAT_STRING:gsub('%%d', '(%%d+)'):gsub('%%s', '(.-)');
23-
local CATALYST_MARKUP = CreateAtlasMarkup('CreationCatalyst-32x32', 18, 18)
24-
local UPGRADE_MARKUP = CreateAtlasMarkup('CovenantSanctum-Upgrade-Icon-Available', 18, 18)
25-
local CATALYST_UPGRADE_MARKUP = CreateSimpleTextureMarkup([[Interface\AddOns\TransmogUpgradeMaster\media\CatalystUpgrade.png]], 18, 18)
26-
local OK_MARKUP = "|TInterface\\RaidFrame\\ReadyCheck-Ready:0|t"
27-
local NOK_MARKUP = "|TInterface\\RaidFrame\\ReadyCheck-NotReady:0|t"
28-
local OTHER_MARKUP = CreateAtlasMarkup('QuestRepeatableTurnin', 16, 16)
29-
30-
local playerClassID = select(3, UnitClass("player"))
31-
32-
local classIDToName = {}
23+
local CATALYST_ATLAS = 'CreationCatalyst-32x32';
24+
local UPGRADE_ATLAS = 'CovenantSanctum-Upgrade-Icon-Available';
25+
local CATALYST_UPGRADE_TEXTURE = [[Interface\AddOns\TransmogUpgradeMaster\media\CatalystUpgrade.png]];
26+
local CATALYST_MARKUP = CreateAtlasMarkup(CATALYST_ATLAS, 18, 18);
27+
local UPGRADE_MARKUP = CreateAtlasMarkup(UPGRADE_ATLAS, 18, 18);
28+
local CATALYST_UPGRADE_MARKUP = CreateSimpleTextureMarkup(CATALYST_UPGRADE_TEXTURE, 18, 18);
29+
local OK_MARKUP = [[|TInterface\RaidFrame\ReadyCheck-Ready:0|t]];
30+
local NOK_MARKUP = [[|TInterface\RaidFrame\ReadyCheck-NotReady:0|t]];
31+
local OTHER_MARKUP = CreateAtlasMarkup('QuestRepeatableTurnin', 16, 16);
32+
33+
local playerClassID = select(3, UnitClass("player"));
34+
35+
local classIDToName = {};
3336
do
3437
for classID = 1, GetNumClasses() do
3538
local className, classFile = GetClassInfo(classID);
@@ -789,17 +792,17 @@ function TUM:RegisterIntoBaganator()
789792
if not C_AddOns.IsAddOnLoaded("Baganator") or not Baganator or not Baganator.API then return; end
790793

791794
local function setUpgrade(icon)
792-
icon:SetAtlas('CovenantSanctum-Upgrade-Icon-Available');
795+
icon:SetAtlas(UPGRADE_ATLAS);
793796

794797
return true;
795798
end
796799
local function setCatalyst(icon)
797-
icon:SetAtlas('CreationCatalyst-32x32');
800+
icon:SetAtlas(CATALYST_ATLAS);
798801

799802
return true;
800803
end
801804
local function setCatalystUpgrade(icon)
802-
icon:SetTexture([[Interface\AddOns\TransmogUpgradeMaster\media\CatalystUpgrade_black.png]]);
805+
icon:SetTexture(CATALYST_UPGRADE_TEXTURE);
803806

804807
return true;
805808
end
@@ -810,6 +813,8 @@ function TUM:RegisterIntoBaganator()
810813
--- @param itemDetails BaganatorItemDetails
811814
--- @return boolean? shouldDisplay # return nil if not enough info is known
812815
local function onUpdate(icon, itemDetails)
816+
local size = self.db.baganatorIconSize;
817+
icon:SetSize(size, size);
813818
if cache[itemDetails.itemLink] ~= nil then
814819
return cache[itemDetails.itemLink](icon);
815820
end
@@ -857,7 +862,8 @@ function TUM:RegisterIntoBaganator()
857862
onUpdate,
858863
function(itemButton)
859864
local tex = itemButton:CreateTexture(nil, "OVERLAY");
860-
tex:SetSize(12, 12);
865+
local size = self.db.baganatorIconSize;
866+
tex:SetSize(size, size);
861867

862868
return tex;
863869
end,

config.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ TUM_Config.settingKeys = {
3232
showWarbandCatalystInfoModifierKey = "showWarbandCatalystInfoModifierKey",
3333
warbandCatalystClassList = "warbandCatalystClassList",
3434
autoConfirmCatalyst = "autoConfirmCatalyst",
35+
baganatorIconSize = "baganatorIconSize",
3536
debug = "debug",
3637
};
3738

@@ -58,6 +59,8 @@ function TUM_Config:Init()
5859
warbandCatalystClassList = {},
5960
--- @type TUM_Config_AutoConfirmCatalystOptions
6061
autoConfirmCatalyst = self.autoConfirmCatalystOptions.previousSeason,
62+
--- @type number
63+
baganatorIconSize = 15,
6164
--- @type boolean
6265
UI_treatOtherItemAsCollected = false,
6366
--- @type boolean
@@ -154,6 +157,20 @@ function TUM_Config:Init()
154157

155158

156159
Config:MakeHeader("Other Settings");
160+
local sliderOptions = Settings.CreateSliderOptions(5, 30, 0.5);
161+
sliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right, function(val) return ("%.1f"):format(val); end);
162+
local initializer, setting = Config:MakeSlider(
163+
"Baganator Icon Size",
164+
self.settingKeys.baganatorIconSize,
165+
"Adjust the size of the icon shown in Baganator. Use Baganator's settings to adjust the position of the icon.",
166+
sliderOptions
167+
);
168+
initializer:AddModifyPredicate(function() return C_AddOns.IsAddOnLoaded("Baganator") and Baganator and Baganator.API and true or false; end);
169+
setting:SetValueChangedCallback(function()
170+
if Baganator and Baganator.API then
171+
Baganator.API.RequestItemButtonsRefresh()
172+
end
173+
end);
157174
Config:MakeDropdown(
158175
"Auto Confirm Catalyst",
159176
self.settingKeys.autoConfirmCatalyst,

media/CatalystUpgrade.png

-5.69 KB
Loading

media/CatalystUpgrade_black.png

-6.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)