WoWInterface SVN QualityID

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 18 to Rev 19
    Reverse comparison

Rev 18 → Rev 19

trunk/QualityID/QualityID.lua
10,15 → 10,19
QualityID = {}
QIDDB = {
enabled = true;
showid = true;
showitemLvl = true;
showStackCount = true;
showIcon = true;
showType = true;
}
 
QIDDB.enabled = true
QIDDB.showid = true
QIDDB.showitemLvl = true
QIDDB.showStackCount = true
QIDDB.showIcon = true
QIDDB.showType = true
QIDDB.showitemType = true
QIDDB.QualityIDVersion = "3.05"
 
--For testing if version is doubling info, if it shows twice, then we are sad pandas.
28,6 → 32,8
if (not (QIDDB)) then DEFAULT_CHAT_FRAME:AddMessage("Setting up QIDDB.") end
if (not (QIDDB)) then QIDDB = {} end
if (not (QIDDB.enabled)) then QIDDB.enabled = self.enabled end
if (not (QIDDB.showId)) then QIDDB.showId = self.showId end
if (not (QIDDB.showitemLvl)) then QIDDB.showitemLvl = self.showitemLvl end
if (not (QIDDB.showStackCount)) then QIDDB.showStackCount = self.showStackCount end
if (not (QIDDB.showIcon)) then QIDDB.showIcon = self.showIcon end
if (not (QIDDB.showitemType)) then QIDDB.showitemType = self.showitemType end
67,6 → 73,10
QIDDB.enabled = true;
elseif(msg:lower() == "off") then
QIDDB.enabled = false;
elseif(msg:lower() == "id") then
QIDDB.showid = not QIDDB.showid;
elseif(msg:lower() == "ilvl") then
QIDDB.showitemLvl = not QIDDB.showitemLvl;
elseif(msg:lower() == "stack") then
QIDDB.showStackCount = not QIDDB.showStackCount;
elseif(msg:lower() == "itemtype") then
74,7 → 84,9
elseif(msg:lower() == "icon") then
QIDDB.showIcon = not QIDDB.showIcon;
elseif(msg == "") then
chat("QIDTest options: /qid {toggle | on | off}");
chat("QualityID options: /qid {toggle | on | off}");
chat("/qid id {toggle} ");
chat("/qid ilvl {toggle} ");
chat("/qid stack {toggle}");
chat("/qid itemtype {toggle}");
chat("/qid icon {toggle}");
82,7 → 94,7
end
 
local origs = {}
--adds id, lvl, stkct, and type
--adds id, ilvl, stkct, and type
local function OnTooltipSetItem(frame, ...)
local name, link = frame:GetItem()
if QIDDB.enabled and link then
91,16 → 103,20
local name,link,quality,ilvl,reqLevel,type,subType,stackCount = GetItemInfo(id)
--text that you see in the tooltip
frame:AddLine(" ")
if stackCount and QIDDB.showStackCount and stackCount > 2 then
frame:AddLine( "Stacks in lots of "..ITEM_QUALITY_COLORS[quality].hex..stackCount)
end
if quality then
frame:AddLine( "Item ID: "..ITEM_QUALITY_COLORS[quality].hex..id)
frame:AddLine( "Item Lvl: "..ITEM_QUALITY_COLORS[quality].hex..ilvl)
if id and QIDDB.showid then
frame:AddLine( "Item ID: "..ITEM_QUALITY_COLORS[quality].hex..id)
end
if ilvl and QIDDB.showitemLvl then
frame:AddLine( "Item Lvl: "..ITEM_QUALITY_COLORS[quality].hex..ilvl)
end
if subType and QIDDB.showitemType then
frame:AddLine( ""..type..": "..ITEM_QUALITY_COLORS[quality].hex..subType)
end
if stackCount and QIDDB.showStackCount and stackCount > 2 then
frame:AddLine( "Stacks in lots of "..ITEM_QUALITY_COLORS[quality].hex..stackCount)
end
end
if QIDDB.showitemType then
frame:AddLine( ""..type..": "..subType, 0,1,0)
end
frame:AddLine(" ")
end
if origs[frame] then
109,7 → 125,7
end
 
--Add item icon to the tooltip.
local function hookItem(frame, ...)
local function hookTip(frame, ...)
local _G = getfenv(0)
local set = frame:GetScript('OnTooltipSetItem')
 
128,10 → 144,10
end
end)
end
hookItem(GameTooltip)
hookItem(ItemRefTooltip)
hookItem(ShoppingTooltip1)
hookItem(ShoppingTooltip2)
hookTip(GameTooltip)
hookTip(ItemRefTooltip)
hookTip(ShoppingTooltip1)
hookTip(ShoppingTooltip2)
 
for _,frame in pairs{GameTooltip, ItemRefTooltip, ShoppingTooltip1, ShoppingTooltip2} do
origs[frame] = frame:GetScript("OnTooltipSetItem")
140,10 → 156,8
 
 
--Run once when first loaded.
do
QID = CreateFrame("Frame", "QID")
QID:RegisterEvent("VARIABLES_LOADED")
QID:SetScript("OnEvent", function(self, event, ...) QualityID[event](QualityID, event, ...) end)
 
DEFAULT_CHAT_FRAME:AddMessage("|cff00dd88" .. "QualityID: v"..QIDDB.QualityIDVersion.." enabled!");
end
\ No newline at end of file + DEFAULT_CHAT_FRAME:AddMessage("|cff00dd88" .. "QualityID: v"..QIDDB.QualityIDVersion.." enabled!"); \ No newline at end of file