diff --git a/api/config.lua b/api/config.lua index 22296eca..41ccde11 100644 --- a/api/config.lua +++ b/api/config.lua @@ -576,6 +576,8 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("tooltip", "compare", "basestats", "1") pfUI:UpdateConfig("tooltip", "compare", "showalways", "0") pfUI:UpdateConfig("tooltip", "vendor", "showalways", "0") + pfUI:UpdateConfig("tooltip", "questitem", "showquest", "1") + pfUI:UpdateConfig("tooltip", "questitem", "showcount", "0") pfUI:UpdateConfig("tooltip", "statusbar", "texture", "Interface\\AddOns\\pfUI\\img\\bar") pfUI:UpdateConfig("chat", "text", "input_width", "0") diff --git a/modules/gui.lua b/modules/gui.lua index a843d393..04066e76 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2004,6 +2004,8 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(nil, T["Compare Item Base Stats"], C.tooltip.compare, "basestats", "checkbox") CreateConfig(nil, T["Always Show Item Comparison"], C.tooltip.compare, "showalways", "checkbox") CreateConfig(nil, T["Always Show Extended Vendor Values"], C.tooltip.vendor, "showalways", "checkbox") + CreateConfig(U["questitem"], T["Show Related Quest On Questitems"], C.tooltip.questitem, "showquest", "checkbox") + CreateConfig(U["questitem"], T["Show Required Questitem Count"], C.tooltip.questitem, "showcount", "checkbox") end) CreateGUIEntry(T["Castbar"], nil, function() diff --git a/modules/questitem.lua b/modules/questitem.lua index 0afd3737..5fef2705 100644 --- a/modules/questitem.lua +++ b/modules/questitem.lua @@ -3,6 +3,9 @@ pfUI:RegisterModule("questitem", function () local itemcache = {} local function AddTooltip(frame, item) + -- abort if questitem is disabled + if C.tooltip.questitem.showquest ~= "1" then return end + -- check if we can replace the questitem string local replace = nil if frame and _G[frame:GetName().."TextLeft2"] then @@ -42,7 +45,7 @@ pfUI:RegisterModule("questitem", function () local color = GetDifficultyColor(level) -- read item counts - if itemcache[item] and itemcache[item] ~= false then + if C.tooltip.questitem.showcount == "1" and itemcache[item] and itemcache[item] ~= false then local _, _, required = strfind(string.lower(questlog[itemcache[item]]), "_"..string.lower(item).."_(.-)_") if required then quest = string.format("%s |cffaaaaaa[%s/%s]", quest, (GetItemCount(item) or 0), required) @@ -70,6 +73,8 @@ pfUI:RegisterModule("questitem", function () end) pfUI.questitem:SetScript("OnUpdate", function() + if C.tooltip.questitem.showquest ~= "1" then return end + -- skip if nothing to do if not this.run or GetTime() < this.run then return end @@ -118,6 +123,11 @@ pfUI:RegisterModule("questitem", function () this.run = nil end) + -- reload quest entries on config change + pfUI.questitem.UpdateConfig = function() + pfUI.questitem.run = GetTime() + .5 + end + -- add to regular tooltips pfUI.questitem.tooltip = CreateFrame("Frame", "pfQuestItems", GameTooltip ) pfUI.questitem.tooltip:SetScript("OnShow", function()