/trunk/libs
@version 1.1 |
--]] |
local MAJOR,MINOR,REVISION = "LibExtraTip", 1, "$Revision: 275 $" |
local MAJOR,MINOR,REVISION = "LibExtraTip", 1, "$Revision: 295 $" |
-- A string unique to this version to prevent frame name conflicts. |
local LIBSTRING = MAJOR.."_"..MINOR.."_"..REVISION |
-- prepare upvalues |
local orig = tip[method] |
if not orig then |
-- there should be an original method. for now silently bail out. todo: insert debug tracking here so we can identify defunct methods |
-- There should be an original method - abort if it's missing |
if nLog then |
nLog.AddMessage("LibExtraTip", "Hooks", N_NOTICE, "Missing method", "LibExtraTip:hook detected missing method: "..tostring(method)) |
end |
return |
end |
control = {prehook or false, posthook or false} |
else |
local link = GetTradeSkillItemLink(index) |
reg.additional.link = link |
reg.result = item |
reg.quantity = GetTradeSkillNumMade(index) |
if (link:sub(0, 6) == "spell:") then |
if link and link:match("spell:%d") then |
SetSpellDetail(reg, link) |
end |
end |
-- Default disabled events: |
-- SetAction = function(self,actionid) |
-- OnTooltipCleared(self) |
-- local reg = tooltipRegistry[self] |
-- reg.ignoreOnCleared = true |
-- local t,id,sub = GetActionInfo(actionid) |
-- reg.additional.event = "SetAction" |
-- reg.additional.eventIndex = actionid |
-- reg.additional.actionType = t |
-- reg.additional.actionIndex = id |
-- reg.additional.actionSubtype = subtype |
-- if t == "item" then |
-- reg.quantity = GetActionCount(actionid) |
-- elseif t == "spell" then |
-- if id and id > 0 then |
-- local link = GetSpellLink(id, sub) |
-- SetSpellDetail(reg, link) |
-- end |
-- end |
-- end, |
SetAuctionCompareItem = function(self, type, index, offset) |
--[[ disabled due to taint issues |
SetAction = function(self,actionid) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.ignoreOnCleared = true |
reg.additional.event = "SetAuctionCompareItem" |
reg.additional.eventType = type |
reg.additional.eventIndex = index |
reg.additional.eventOffset = offset |
local t,id,sub = GetActionInfo(actionid) |
reg.additional.event = "SetAction" |
reg.additional.eventIndex = actionid |
reg.additional.actionType = t |
reg.additional.actionIndex = id |
reg.additional.actionSubtype = subtype |
if t == "item" then |
reg.quantity = GetActionCount(actionid) |
elseif t == "spell" then |
if id and id > 0 then |
local link = GetSpellLink(id, sub) |
SetSpellDetail(reg, link) |
end |
end |
end, |
--]] |
SetCurrencyToken = function(self, index) |
OnTooltipCleared(self) |
reg.additional.eventIndex = index |
end, |
SetMerchantCompareItem = function(self, index, offset) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.ignoreOnCleared = true |
reg.additional.event = "SetMerchantCompareItem" |
reg.additional.eventIndex = index |
reg.additional.eventOffset = offset |
end, |
SetPetAction = function(self, index) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.additional.eventIndex = index |
end, |
SetPlayerBuff = function(self, index) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.ignoreOnCleared = true |
reg.additional.event = "SetPlayerBuff" |
reg.additional.eventIndex = index |
end, |
SetQuestLogRewardSpell = function(self) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.additional.eventIndex = index |
end, |
SetSpell = function(self,index,type) |
SetSpellBookItem = function(self,index,booktype) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.ignoreOnCleared = true |
local link = GetSpellLink(index, type) |
local link = GetSpellLink(index, booktype) |
if link then |
reg.additional.event = "SetSpell" |
reg.additional.event = "SetSpellBookItem" |
reg.additional.eventIndex = index |
reg.additional.eventType = type |
reg.additional.eventType = booktype |
SetSpellDetail(reg, link) |
end |
end, |
reg.additional.eventIndex = index |
end, |
SetTracking = function(self, index) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.ignoreOnCleared = true |
reg.additional.event = "SetTracking" |
reg.additional.eventIndex = index |
end, |
SetTrainerService = function(self, index) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.additional.eventUnit= unit |
end, |
--[[ disabled due to taint issues |
SetUnitAura = function(self, unit, index, filter) |
OnTooltipCleared(self) |
local reg = tooltipRegistry[self] |
reg.additional.eventIndex = index |
reg.additional.eventFilter = filter |
end, |
--]] |
SetUnitBuff = function(self, unit, index, filter) |
OnTooltipCleared(self) |
end |
end, |
-- SetAction = posthookClearIgnore, |
SetAuctionCompareItem = posthookClearIgnore, |
--SetAction = posthookClearIgnore, |
SetCurrencyToken = posthookClearIgnore, |
SetMerchantCompareItem = posthookClearIgnore, |
SetPetAction = posthookClearIgnore, |
SetPlayerBuff = posthookClearIgnore, |
SetQuestLogRewardSpell = posthookClearIgnore, |
SetQuestRewardSpell = posthookClearIgnore, |
SetShapeshift = posthookClearIgnore, |
SetSpell = posthookClearIgnore, |
SetSpellBookItem = posthookClearIgnore, |
SetTalent = posthookClearIgnore, |
SetTracking = posthookClearIgnore, |
SetTrainerService = posthookClearIgnore, |
SetUnit = posthookClearIgnore, |
SetUnitAura = posthookClearIgnore, |
--SetUnitAura = posthookClearIgnore, |
SetUnitBuff = posthookClearIgnore, |
SetUnitDebuff = posthookClearIgnore, |
} |
## Interface: 40000 |
## LoadOnDemand: 0 |
## |
## Version: 1.1 |
## Revision: $Id: LibExtraTip.toc 280 2010-10-12 19:52:29Z Esamynn $ |
## Version: <%version%> (<%codename%>) |
## Revision: $Id: LibExtraTip.toc 284 2010-11-01 04:11:43Z dinesh $ |
## Author: Norganna's AddOns |
## X-Part-Of: Libraries |
## X-Category: Library |
## X-Max-Interface: 40000 |
## X-URL: http://zip.norganna.org/libs/LibExtraTip/ |
## X-Feedback: http://forums.norganna.org |
## |
Load.xml |