diff --git a/Config.lua b/Config.lua index 1e5ce8b..ed34842 100644 --- a/Config.lua +++ b/Config.lua @@ -1667,21 +1667,28 @@ for expansion, expansionData in pairs(GT.ItemData) do order = itemData.order } else + local rarity = C_Item.GetItemQualityByID(itemData.id) or 1 + local R, G, B = C_Item.GetItemQualityColor(rarity) filterOptions.args[expansion].args[category].args[tostring(itemData.id)] = { type = "toggle", dialogControl = "NW_CheckBox", name = function() + local qualityHex = GT:RGBtoHex(R or 1, G or 1, B or 1, 1) + local name = "|c" .. qualityHex .. "|Hitem:" .. itemData.id .. "::::::::::::::::::|h" .. itemData.name + if itemData.quality then if itemData.quality == 1 then - return "|cff784335" .. itemData.name .. "*" + name = name .. " |A:Professions-ChatIcon-Quality-Tier1:17:15::1|a|h|r" elseif itemData.quality == 2 then - return "|cff96979E" .. itemData.name .. "**" + name = name .. " |A:Professions-ChatIcon-Quality-Tier2:17:23::|a|h|r" elseif itemData.quality == 3 then - return "|cffDCC15F" .. itemData.name .. "***" + name = name .. " |A:Professions-ChatIcon-Quality-Tier3:17:18::1|a|h|r" end else - return itemData.name + name = name .. "|h|r" end + + return name end, image = function() if itemData.id <= #GT.ItemData.Other.Other then @@ -1702,14 +1709,12 @@ for expansion, expansionData in pairs(GT.ItemData) do borderColor = { 1, 1, 1, 0.8 } overlay = nil else - local rarity = C_Item.GetItemQualityByID(itemData.id) or 1 if rarity <= 1 then border = { "Interface\\Common\\WhiteIconFrame", "texture" } else border = { "bags-glow-white", "atlas" } end - local R, G, B = C_Item.GetItemQualityColor(rarity) borderColor = { R, G, B, 0.8 } if itemData.quality then @@ -1767,10 +1772,12 @@ function GT:CreateCustomFilterOptions() if not item:IsItemEmpty() then item:ContinueOnItemLoad(function() local itemName = item:GetItemName() + local itemLink = item:GetItemLink() + itemLink = itemLink:gsub("[%[%]]", "") filterOptions.args.custom.args[itemName] = { type = "toggle", dialogControl = "NW_CheckBox", - name = itemName, + name = itemLink, image = function() return C_Item.GetItemIconByID(id) end, get = function() return GT.db.profile.CustomFiltersTable[id] end, set = function(_, key) diff --git a/FilterButton.lua b/FilterButton.lua index 38ff37c..b5c87f4 100644 --- a/FilterButton.lua +++ b/FilterButton.lua @@ -199,16 +199,21 @@ function GT:GenerateFiltersMenu(frame) if itemData.id == -1 then local divider = frame[expansion][category]:CreateTitle(itemData.name) else - local name = itemData.name + local rarity = C_Item.GetItemQualityByID(itemData.id) or 1 + local R, G, B = C_Item.GetItemQualityColor(rarity) + local qualityHex = GT:RGBtoHex(R or 1, G or 1, B or 1, 1) + local name = "|c" .. qualityHex .. "|Hitem:" .. itemData.id .. "::::::::::::::::::|h" .. itemData.name if itemData.quality then if itemData.quality == 1 then - name = "|cff784335" .. name .. "*" + name = name .. " |A:Professions-ChatIcon-Quality-Tier1:17:15::1|a|h|r" elseif itemData.quality == 2 then - name = "|cff96979E" .. name .. "**" + name = name .. " |A:Professions-ChatIcon-Quality-Tier2:17:23::|a|h|r" elseif itemData.quality == 3 then - name = "|cffDCC15F" .. name .. "***" + name = name .. " |A:Professions-ChatIcon-Quality-Tier3:17:18::1|a|h|r" end + else + name = name .. "|h|r" end frame[expansion][category][itemData.name] = frame[expansion][category]:CreateCheckbox(name, IsSelected_Item, SetSelected_Item) @@ -231,13 +236,11 @@ function GT:GenerateFiltersMenu(frame) 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) @@ -254,6 +257,9 @@ function GT:GenerateFiltersMenu(frame) leftTextureQuality:SetAllPoints(leftTexture) end end) + frame[expansion][category][itemData.name]:SetTooltip(function(tooltip, elementDescription) + tooltip:SetHyperlink(name) + end) end end end @@ -340,10 +346,12 @@ function GT:CreateCustomFiltersList(frame, rootDescription) --Waits for the data to be returned from the server if not item:IsItemEmpty() then item:ContinueOnItemLoad(function() + local itemLink = string.gsub(item:GetItemLink(), "[%[%]]", "") local itemDetails = { id = tonumber(id), text = item:GetItemName(), - icon = tostring(C_Item.GetItemIconByID(itemID) or "") + icon = tostring(C_Item.GetItemIconByID(itemID) or ""), + link = itemLink, } table.insert(customFiltersList, itemDetails) end) @@ -394,7 +402,7 @@ function GT:CreateCustomFiltersList(frame, rootDescription) GT:InventoryUpdate("Custom Filter " .. itemData.text .. " menu clicked", false) end - frame["Custom Filters"][itemData.text] = frame["Custom Filters"]:CreateCheckbox(itemData.text, IsSelected_CustomFilterItem, SetSelected_CustomFilterItem) + frame["Custom Filters"][itemData.text] = frame["Custom Filters"]:CreateCheckbox(itemData.link, IsSelected_CustomFilterItem, SetSelected_CustomFilterItem) frame["Custom Filters"][itemData.text]:AddInitializer(function(text, description, menu) local leftTexture = text:AttachTexture() @@ -418,6 +426,9 @@ function GT:CreateCustomFiltersList(frame, rootDescription) leftTextureRarity:SetVertexColor(R, G, B, 0.8) leftTextureRarity:SetAllPoints(leftTexture) end) + frame["Custom Filters"][itemData.text]:SetTooltip(function(tooltip, elementDescription) + tooltip:SetHyperlink(itemData.link) + end) end end diff --git a/GatheringTracker.toc b/GatheringTracker.toc index ed22f7f..c3294a3 100644 --- a/GatheringTracker.toc +++ b/GatheringTracker.toc @@ -2,7 +2,7 @@ ## Title: Gathering Tracker ## Notes: Addon for tracking gathered items, supports solo players and groups ## Author: Noshei -## Version: 3.1.0 +## Version: 3.1.1 ## OptionalDeps: TradeSkillMaster, RECrystallize, Auctionator ## SavedVariables: GatheringTrackerDB ## AddonCompartmentFunc: GatheringTracker_OnAddonCompartmentClick diff --git a/Libs/AceGUI-3.0-NosheiWidgets/CheckBox-Extended.lua b/Libs/AceGUI-3.0-NosheiWidgets/CheckBox-Extended.lua index 1359a44..9c83867 100644 --- a/Libs/AceGUI-3.0-NosheiWidgets/CheckBox-Extended.lua +++ b/Libs/AceGUI-3.0-NosheiWidgets/CheckBox-Extended.lua @@ -44,13 +44,23 @@ Scripts local function Control_OnEnter(frame) local self = frame.obj self.background:SetVertexColor(0.35, 0.35, 0.35, 1) - frame.obj:Fire("OnEnter") + if self.border:GetTexture() then + GameTooltip:SetOwner(frame, self:GetTooltipAnchor()) + GameTooltip:SetHyperlink(self.text:GetText()) + GameTooltip:Show() + else + frame.obj:Fire("OnEnter") + end end local function Control_OnLeave(frame) local self = frame.obj self.background:SetVertexColor(0, 0, 0, 0) - frame.obj:Fire("OnLeave") + if self.border:GetTexture() then + GameTooltip:Hide() + else + frame.obj:Fire("OnLeave") + end end local function CheckBox_OnMouseDown(frame) @@ -293,6 +303,11 @@ local methods = { overlay:SetAtlas(path, true) end end, + + ["GetTooltipAnchor"] = function(self) + local x = self.frame:GetRight() / GetScreenWidth() > 0.8 + return x and 'ANCHOR_LEFT' or 'ANCHOR_RIGHT' + end } --[[-----------------------------------------------------------------------------