mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
questitem: add option to disable features
This commit is contained in:
@@ -576,6 +576,8 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("tooltip", "compare", "basestats", "1")
|
pfUI:UpdateConfig("tooltip", "compare", "basestats", "1")
|
||||||
pfUI:UpdateConfig("tooltip", "compare", "showalways", "0")
|
pfUI:UpdateConfig("tooltip", "compare", "showalways", "0")
|
||||||
pfUI:UpdateConfig("tooltip", "vendor", "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("tooltip", "statusbar", "texture", "Interface\\AddOns\\pfUI\\img\\bar")
|
||||||
|
|
||||||
pfUI:UpdateConfig("chat", "text", "input_width", "0")
|
pfUI:UpdateConfig("chat", "text", "input_width", "0")
|
||||||
|
|||||||
@@ -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["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 Item Comparison"], C.tooltip.compare, "showalways", "checkbox")
|
||||||
CreateConfig(nil, T["Always Show Extended Vendor Values"], C.tooltip.vendor, "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)
|
end)
|
||||||
|
|
||||||
CreateGUIEntry(T["Castbar"], nil, function()
|
CreateGUIEntry(T["Castbar"], nil, function()
|
||||||
|
|||||||
+11
-1
@@ -3,6 +3,9 @@ pfUI:RegisterModule("questitem", function ()
|
|||||||
local itemcache = {}
|
local itemcache = {}
|
||||||
|
|
||||||
local function AddTooltip(frame, item)
|
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
|
-- check if we can replace the questitem string
|
||||||
local replace = nil
|
local replace = nil
|
||||||
if frame and _G[frame:GetName().."TextLeft2"] then
|
if frame and _G[frame:GetName().."TextLeft2"] then
|
||||||
@@ -42,7 +45,7 @@ pfUI:RegisterModule("questitem", function ()
|
|||||||
local color = GetDifficultyColor(level)
|
local color = GetDifficultyColor(level)
|
||||||
|
|
||||||
-- read item counts
|
-- 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).."_(.-)_")
|
local _, _, required = strfind(string.lower(questlog[itemcache[item]]), "_"..string.lower(item).."_(.-)_")
|
||||||
if required then
|
if required then
|
||||||
quest = string.format("%s |cffaaaaaa[%s/%s]", quest, (GetItemCount(item) or 0), required)
|
quest = string.format("%s |cffaaaaaa[%s/%s]", quest, (GetItemCount(item) or 0), required)
|
||||||
@@ -70,6 +73,8 @@ pfUI:RegisterModule("questitem", function ()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
pfUI.questitem:SetScript("OnUpdate", function()
|
pfUI.questitem:SetScript("OnUpdate", function()
|
||||||
|
if C.tooltip.questitem.showquest ~= "1" then return end
|
||||||
|
|
||||||
-- skip if nothing to do
|
-- skip if nothing to do
|
||||||
if not this.run or GetTime() < this.run then return end
|
if not this.run or GetTime() < this.run then return end
|
||||||
|
|
||||||
@@ -118,6 +123,11 @@ pfUI:RegisterModule("questitem", function ()
|
|||||||
this.run = nil
|
this.run = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- reload quest entries on config change
|
||||||
|
pfUI.questitem.UpdateConfig = function()
|
||||||
|
pfUI.questitem.run = GetTime() + .5
|
||||||
|
end
|
||||||
|
|
||||||
-- add to regular tooltips
|
-- add to regular tooltips
|
||||||
pfUI.questitem.tooltip = CreateFrame("Frame", "pfQuestItems", GameTooltip )
|
pfUI.questitem.tooltip = CreateFrame("Frame", "pfQuestItems", GameTooltip )
|
||||||
pfUI.questitem.tooltip:SetScript("OnShow", function()
|
pfUI.questitem.tooltip:SetScript("OnShow", function()
|
||||||
|
|||||||
Reference in New Issue
Block a user