Added Bag icons for Vanity and Wardrobe unlocks (#52)

* Added Bag icons for Vanity and Wardrobe unlocks

* Show if item is both Vanity and Wardrobe unlock
added related textures

* Adjusted icon so edges match up
This commit is contained in:
Xan-Asc
2024-04-09 16:41:58 -07:00
committed by GitHub
parent d2e86421cc
commit bea4a6ab23
7 changed files with 100 additions and 13 deletions
+6 -1
View File
@@ -7,6 +7,9 @@ function E:TextureString(texString, dataString)
end
E.Media = {
Atlases = {
BagWardrobeIcon = [[poi-transmogrifier]], -- not elvui
},
Fonts = {
ActionMan = M..[[Fonts\ActionMan.ttf]],
ContinuumMedium = M..[[Fonts\ContinuumMedium.ttf]],
@@ -89,6 +92,8 @@ E.Media = {
ArrowUp = M..[[Textures\ArrowUp.tga]],
BagJunkIcon = M..[[Textures\BagJunkIcon.blp]],
BagQuestIcon = M..[[Textures\BagQuestIcon.tga]],
BagVanityIcon = M..[[Textures\VanityUnlock.blp]],
BagVanityAndWardrobe = M..[[Textures\VanityAndWardrobe.blp]],
Black8x8 = M..[[Textures\Black8x8.tga]],
White8x8 = [[Interface\BUTTONS\WHITE8X8]], -- not elvui
Broom = M..[[Textures\Broom.blp]],
@@ -156,4 +161,4 @@ LSM:Register("statusbar", "ElvUI Gloss", E.Media.Textures.NormTex)
LSM:Register("statusbar", "ElvUI Norm", E.Media.Textures.NormTex2)
LSM:Register("statusbar", "Minimalist", E.Media.Textures.Minimalist)
LSM:Register("statusbar", "ElvUI Blank", E.Media.Textures.White8x8)
LSM:Register("background", "ElvUI Blank", E.Media.Textures.White8x8)
LSM:Register("background", "ElvUI Blank", E.Media.Textures.White8x8)
Binary file not shown.
Binary file not shown.
+71 -9
View File
@@ -70,6 +70,13 @@ local SEARCH = SEARCH
local SEARCH_STRING = ""
-- item types that will show they have a wardrobe unlock but cannot be unlocked
local BAD_WARDROBE_SUBTYPES = {
["Thrown"] = true,
["Fishing Poles"] = true,
["Miscellaneous"] = true,
}
function B:GetContainerFrame(arg)
if type(arg) == "boolean" and arg == true then
return B.BankFrame
@@ -321,6 +328,9 @@ function B:UpdateSlot(frame, bagID, slotID)
slot:Show()
slot.questIcon:Hide()
slot.JunkIcon:Hide()
slot.unlearnedVanityIcon:Hide()
slot.unlearnedWardrobeIcon:Hide()
slot.unlearnedVanityAndWardrobeIcon:Hide()
slot.itemLevel:SetText("")
slot.bindType:SetText("")
@@ -338,8 +348,9 @@ function B:UpdateSlot(frame, bagID, slotID)
slot:SetBackdropBorderColor(unpack(B.ProfessionColors[bagType]))
slot.ignoreBorderColors = true
elseif clink then
local iLvl, iType, itemEquipLoc, itemPrice
slot.name, _, slot.rarity, iLvl, _, iType, _, _, itemEquipLoc, _, itemPrice = GetItemInfo(clink)
slot.id = GetItemInfoFromHyperlink(clink)
local iLvl, iType, iSubtype, itemEquipLoc, itemPrice
slot.name, _, slot.rarity, iLvl, _, iType, iSubtype, _, itemEquipLoc, _, itemPrice = GetItemInfo(clink)
local isQuestItem, questId, isActiveQuest = GetContainerItemQuestInfo(bagID, slotID)
local r, g, b
@@ -376,14 +387,27 @@ function B:UpdateSlot(frame, bagID, slotID)
end
end
slot.isUnlearnedVanity = VANITY_ITEMS[slot.id] and not C_VanityCollection.IsCollectionItemOwned(slot.id)
slot.isUnlearnedWardrobe = not (BAD_WARDROBE_SUBTYPES[iSubtype] and iType == "Weapon") and APPEARANCE_ITEM_INFO[slot.id] and not APPEARANCE_ITEM_INFO[slot.id]:GetCollectedID()
slot.isJunk = (slot.rarity and slot.rarity == 0) and (itemPrice and itemPrice > 0) and (iType and iType ~= "Quest")
slot.junkDesaturate = slot.isJunk and E.db.bags.junkDesaturate
local showVanity = slot.unlearnedVanityIcon and E.db.bags.unlearnedVanityIcon and slot.isUnlearnedVanity
local showWardrobe = slot.unlearnedWardrobeIcon and E.db.bags.unlearnedWardrobeIcon and slot.isUnlearnedWardrobe
-- Both Vanity and Wardrobe Unlock
if showVanity and showWardrobe then
slot.unlearnedVanityAndWardrobeIcon:Show()
-- Vanity Unlock Icon
elseif showVanity then
slot.unlearnedVanityIcon:Show()
-- Wardrobe Unlock Icon
elseif showWardrobe then
slot.unlearnedWardrobeIcon:Show()
-- Junk Icon
if slot.JunkIcon then
if E.db.bags.junkIcon and slot.isJunk then
slot.JunkIcon:Show()
end
elseif slot.JunkIcon and E.db.bags.junkIcon and slot.isJunk then
slot.JunkIcon:Show()
end
if B.db.questIcon and (questId and not isActiveQuest) then
@@ -663,10 +687,34 @@ function B:Layout(isBank)
f.Bags[bagID][slotID].questIcon:Hide()
end
if not f.Bags[bagID][slotID].unlearnedVanityAndWardrobeIcon then
local unlearnedVanityAndWardrobeIcon = f.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY")
unlearnedVanityAndWardrobeIcon:SetTexture(E.Media.Textures.BagVanityAndWardrobe)
unlearnedVanityAndWardrobeIcon:Point("BOTTOMLEFT", 1, 1)
unlearnedVanityAndWardrobeIcon:Hide()
f.Bags[bagID][slotID].unlearnedVanityAndWardrobeIcon = unlearnedVanityAndWardrobeIcon
end
if not f.Bags[bagID][slotID].unlearnedVanityIcon then
local unlearnedVanityIcon = f.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY")
unlearnedVanityIcon:SetTexture(E.Media.Textures.BagVanityIcon)
unlearnedVanityIcon:Point("BOTTOMLEFT", 1, 1)
unlearnedVanityIcon:Hide()
f.Bags[bagID][slotID].unlearnedVanityIcon = unlearnedVanityIcon
end
if not f.Bags[bagID][slotID].unlearnedWardrobeIcon then
local unlearnedWardrobeIcon = f.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY")
unlearnedWardrobeIcon:SetAtlas(E.Media.Atlases.BagWardrobeIcon)
unlearnedWardrobeIcon:Point("BOTTOMLEFT", 1, 1)
unlearnedWardrobeIcon:Hide()
f.Bags[bagID][slotID].unlearnedWardrobeIcon = unlearnedWardrobeIcon
end
if not f.Bags[bagID][slotID].JunkIcon then
local JunkIcon = f.Bags[bagID][slotID]:CreateTexture(nil, "OVERLAY")
JunkIcon:SetTexture(E.Media.Textures.BagJunkIcon)
JunkIcon:Point("TOPLEFT", 1, 0)
JunkIcon:Point("BOTTOMLEFT", 1, 1)
JunkIcon:Hide()
f.Bags[bagID][slotID].JunkIcon = JunkIcon
end
@@ -702,6 +750,18 @@ function B:Layout(isBank)
f.Bags[bagID][slotID]:SetID(slotID)
f.Bags[bagID][slotID]:Size(buttonSize)
if f.Bags[bagID][slotID].unlearnedVanityAndWardrobeIcon then
f.Bags[bagID][slotID].unlearnedVanityAndWardrobeIcon:Size(buttonSize/2)
end
if f.Bags[bagID][slotID].unlearnedVanityIcon then
f.Bags[bagID][slotID].unlearnedVanityIcon:Size(buttonSize/2)
end
if f.Bags[bagID][slotID].unlearnedWardrobeIcon then
f.Bags[bagID][slotID].unlearnedWardrobeIcon:Size(buttonSize/2)
end
if f.Bags[bagID][slotID].JunkIcon then
f.Bags[bagID][slotID].JunkIcon:Size(buttonSize/2)
end
@@ -1106,7 +1166,7 @@ end
local function BagUpdate(self, bagIDs)
for bagID in pairs(bagIDs) do
B.OnEvent(self, "BAG_UPDATE", bagID)
B.OnEvent(self, "BAG_UPDATE", bagID)
end
end
@@ -1459,6 +1519,7 @@ function B:ToggleBags(id)
if id and (GetContainerNumSlots(id) == 0) then return end --Closes a bag when inserting a new container..
if not B.BagFrame:IsShown() then
B:UpdateAllBagSlots()
B:OpenBags()
-- else
-- B:CloseBags()
@@ -1469,6 +1530,7 @@ function B:ToggleBackpack()
if IsOptionFrameOpen() then return end
if IsBagOpen(0) then
B:UpdateAllBagSlots()
B:OpenBags()
PlaySound("igBackPackOpen")
else
@@ -1863,4 +1925,4 @@ local function InitializeCallback()
B:Initialize()
end
E:RegisterModule(B:GetName(), InitializeCallback)
E:RegisterModule(B:GetName(), InitializeCallback)
+2
View File
@@ -165,6 +165,8 @@ P.bags = {
moneyCoins = true,
junkIcon = false,
junkDesaturate = true,
unlearnedVanityIcon = false,
unlearnedWardrobeIcon = false,
ignoredItems = {},
itemLevel = true,
itemLevelThreshold = 1,
+17 -3
View File
@@ -149,8 +149,22 @@ E.Options.args.bags = {
name = L["Disable Bank Sort"],
set = function(info, value) E.db.bags[info[#info]] = value B:ToggleSortButtonState(true) end
},
countGroup = {
unlearnedVanityIcon = {
order = 16,
type = "toggle",
name = L["Unlearned Vanity"],
desc = L["Unlearned Vanity Desc"],
set = function(info, value) E.db.bags[info[#info]] = value B:UpdateAllBagSlots() end
},
unlearnedWardrobeIcon = {
order = 17,
type = "toggle",
name = L["Unlearned Wardrobe"],
desc = L["Unlearned Wardrobe Desc"],
set = function(info, value) E.db.bags[info[#info]] = value B:UpdateAllBagSlots() end
},
countGroup = {
order = 18,
type = "group",
name = L["Item Count Font"],
guiInline = true,
@@ -195,7 +209,7 @@ E.Options.args.bags = {
}
},
itemLevelGroup = {
order = 17,
order = 19,
type = "group",
name = L["Item Level"],
guiInline = true,
@@ -794,4 +808,4 @@ E.Options.args.bags = {
}
}
}
}
}
+4
View File
@@ -1185,6 +1185,10 @@ L["You need to hold this modifier down in order to blacklist an aura by right-cl
L["Your Auras First"] = true
L["xOffset"] = true
L["yOffset"] = true
L["Unlearned Vanity"] = true
L["Unlearned Vanity Desc"] = "Adds an Icon to Unlearned Vanity Items. This has a higher priority than Wardrobe or Junk Icons"
L["Unlearned Wardrobe"] = true
L["Unlearned Wardrobe Desc"] = "Adds an Icon to Unlearned Wardrobe Items. This has a higher priority than Junk Icons and a lower priority than Vanity."
L["ACTIONBARS_DESC"] = "Modify the actionbar settings."
L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap."