Skip to content

Commit

Permalink
2.0.8
Browse files Browse the repository at this point in the history
Added quality and rarity display to the filter menu icons
  • Loading branch information
Noshei committed Aug 26, 2024
1 parent dcca602 commit a800df9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"utf8": "disable"
},
"Lua.workspace.library": [
"~\\.vscode\\extensions\\ketho.wow-api-0.16.6\\Annotations"
"~\\.vscode\\extensions\\ketho.wow-api-0.17.4\\Annotations"
]
}
30 changes: 28 additions & 2 deletions FilterButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,41 @@ function GT:FiltersButton(profileChanged)
GT.baseFrame.button[expansion][category][itemData.name]:AddInitializer(function(text, description, menu)
local leftTexture = text:AttachTexture()
leftTexture:SetSize(18, 18)
leftTexture:SetPoint("LEFT", text.leftTexture1, "RIGHT", 7, 1);
leftTexture:SetDrawLayer("BACKGROUND", 0)
leftTexture:SetPoint("LEFT", text.leftTexture1, "RIGHT", 7, 1)

if itemData.icon then
leftTexture:SetTexture(itemData.icon)
else
leftTexture:SetTexture(GetItemIcon(tonumber(itemData.id)))
end

text.fontString:SetPoint("LEFT", leftTexture, "RIGHT", 7, 1);
text.fontString:SetPoint("LEFT", leftTexture, "RIGHT", 7, 1)

local leftTextureRarity = text:AttachTexture()
leftTextureRarity:SetDrawLayer("BACKGROUND", 1)
local rarity = C_Item.GetItemQualityByID(itemData.id) or 1
if rarity <= 1 then
leftTextureRarity:SetTexture("Interface\\Common\\WhiteIconFrame")
else
leftTextureRarity:SetAtlas("bags-glow-white")
end
local R, G, B = C_Item.GetItemQualityColor(rarity)
leftTextureRarity:SetVertexColor(R, G, B, 0.8)
leftTextureRarity:SetAllPoints(leftTexture)

if itemData.quality then
local leftTextureQuality = text:AttachTexture()
leftTextureQuality:SetDrawLayer("BACKGROUND", 2)
if itemData.quality == 1 then
leftTextureQuality:SetAtlas("professions-icon-quality-tier1-inv", true)
elseif itemData.quality == 2 then
leftTextureQuality:SetAtlas("professions-icon-quality-tier2-inv", true)
elseif itemData.quality == 3 then
leftTextureQuality:SetAtlas("professions-icon-quality-tier3-inv", true)
end
leftTextureQuality:SetAllPoints(leftTexture)
end
end)
end
end
Expand Down
2 changes: 1 addition & 1 deletion GatheringTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ function GT:CreateRarityBorder(frame, iconRarity)
else
frame.iconRarity:SetAtlas("bags-glow-white")
end
local R, G, B = GetItemQualityColor(rarity)
local R, G, B = C_Item.GetItemQualityColor(rarity)
frame.iconRarity:SetVertexColor(R, G, B, 0.8)
frame.iconRarity:SetAllPoints(frame.icon)
frame.iconRarity:Show()
Expand Down
2 changes: 1 addition & 1 deletion GatheringTracker.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Gathering Tracker
## Notes: Addon for tracking gathered items, supports solo players and groups
## Author: Noshei
## Version: 2.0.7
## Version: 2.0.8
## OptionalDeps: TradeSkillMaster
## SavedVariables: GatheringTrackerDB
## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick
Expand Down

0 comments on commit a800df9

Please sign in to comment.