annotate Core.lua @ 2:e9a1646beaa4

Removing libs from my repo so I can use externals instead
author Asa Ayers <Asa.Ayers@Gmail.com>
date Thu, 20 May 2010 22:46:36 -0700
parents 6c87720c301c
children bbcf81868171
rev   line source
Asa@0 1 local addon = LibStub("AceAddon-3.0"):NewAddon("ItemAuditor", "AceConsole-3.0", "AceEvent-3.0", "AceBucket-3.0")
Asa@0 2
Asa@0 3 ItemAuditor = addon
Asa@0 4
Asa@0 5 local WHITE = "|cFFFFFFFF"
Asa@0 6 local RED = "|cFFFF0000"
Asa@0 7 local GREEN = "|cFF00FF00"
Asa@0 8 local YELLOW = "|cFFFFFF00"
Asa@0 9 local ORANGE = "|cFFFF7F00"
Asa@0 10 local TEAL = "|cFF00FF9A"
Asa@0 11 local GOLD = "|cFFFFD700"
Asa@0 12
Asa@0 13 function addon:OnInitialize()
Asa@0 14 local DB_defaults = {
Asa@0 15 char = {
Asa@0 16 debug = false
Asa@0 17 },
Asa@0 18 factionrealm = {
Asa@0 19 item_account = {}
Asa@0 20 },
Asa@0 21 }
Asa@0 22 self.db = LibStub("AceDB-3.0"):New("ItemAuditorDB", DB_defaults, true)
Asa@0 23
Asa@0 24 self.db.char.debug = true
Asa@0 25
Asa@0 26 self:RegisterOptions()
Asa@0 27
Asa@0 28 self:RegisterEvent("MAIL_SHOW")
Asa@0 29 self:WatchBags()
Asa@0 30 end
Asa@0 31
Asa@1 32 local function IA_tcount(tab)
Asa@0 33 local n = #tab
Asa@0 34 if (n == 0) then
Asa@0 35 for _ in pairs(tab) do
Asa@0 36 n = n + 1
Asa@0 37 end
Asa@0 38 end
Asa@0 39 return n
Asa@0 40 end
Asa@0 41
Asa@0 42
Asa@0 43 local options = {
Asa@0 44 name = "ItemAuditor",
Asa@0 45 handler = ItemAuditor,
Asa@0 46 type = 'group',
Asa@0 47 args = {
Asa@0 48 debug = {
Asa@0 49 type = "toggle",
Asa@0 50 name = "Debug",
Asa@0 51 desc = "Toggles debug messages in chat",
Asa@0 52 get = "GetDebug",
Asa@0 53 set = "SetDebug"
Asa@0 54 },
Asa@0 55 dump = {
Asa@0 56 type = "execute",
Asa@0 57 name = "dump",
Asa@0 58 desc = "dumps IA database",
Asa@0 59 func = "DumpInfo",
Asa@0 60 },
Asa@0 61 options = {
Asa@0 62 type = "execute",
Asa@0 63 name = "options",
Asa@0 64 desc = "Show Blizzard's options GUI",
Asa@0 65 func = "ShowOptionsGUI",
Asa@0 66 guiHidden = true,
Asa@0 67 },
Asa@0 68 },
Asa@0 69 }
Asa@0 70
Asa@0 71
Asa@0 72 function addon:DumpInfo()
Asa@0 73 self:Print("self.db.char")
Asa@0 74 DevTools_Dump(self.db.char)
Asa@0 75 self:Print("self.db.factionrealm")
Asa@0 76 DevTools_Dump(self.db.factionrealm)
Asa@0 77 end
Asa@0 78
Asa@0 79 function addon:RegisterOptions()
Asa@0 80 self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ItemAuditor", "ItemAuditor")
Asa@0 81
Asa@0 82 LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", options, {"ia"})
Asa@0 83 end
Asa@0 84
Asa@0 85 function addon:GetMessage(info)
Asa@0 86 return self.message
Asa@0 87 end
Asa@0 88
Asa@0 89 function addon:SetMessage(info, newValue)
Asa@0 90 self.message = newValue
Asa@0 91 end
Asa@0 92
Asa@0 93
Asa@0 94 function addon:ShowOptionsGUI()
Asa@0 95 InterfaceOptionsFrame_OpenToCategory(self.optionsFrame)
Asa@0 96 end
Asa@0 97
Asa@0 98 function addon:GetDebug(info)
Asa@0 99 return self.db.char.debug
Asa@0 100 end
Asa@0 101
Asa@0 102 function addon:SetDebug(info, input)
Asa@0 103 self.db.char.debug = input
Asa@0 104 local value = "off"
Asa@0 105 if input then
Asa@0 106 value = "on"
Asa@0 107 end
Asa@0 108 self:Print("Debugging is now: " .. value)
Asa@0 109 end
Asa@0 110
Asa@0 111
Asa@0 112 -- ================ DEBUG ================
Asa@0 113 addon.OriginalRegisterEvent = addon.RegisterEvent
Asa@0 114 addon.OriginalUnregisterEvent = addon.UnregisterEvent
Asa@0 115
Asa@0 116 function addon:RegisterEvent(event, callback, arg)
Asa@0 117 self:Debug("RegisterEvent " .. event )
Asa@0 118 if arg ~= nil then
Asa@0 119 addon:OriginalRegisterEvent(event, callback, arg)
Asa@0 120 elseif callback ~= nil then
Asa@0 121 addon:OriginalRegisterEvent(event, callback)
Asa@0 122 else
Asa@0 123 addon:OriginalRegisterEvent(event)
Asa@0 124 end
Asa@0 125 end
Asa@0 126
Asa@0 127 function addon:UnregisterEvent(event)
Asa@0 128 self:Debug("UnregisterEvent " .. event )
Asa@0 129 addon:OriginalUnregisterEvent (event)
Asa@0 130 end
Asa@0 131
Asa@0 132 -- ================ DEBUG ================
Asa@0 133
Asa@0 134 function addon:FormatMoney(money)
Asa@0 135 return Altoholic:GetMoneyString(money, WHITE, false)
Asa@0 136 end
Asa@0 137
Asa@0 138 function addon:GetCurrentInventory()
Asa@0 139 local i = {}
Asa@0 140 local link
Asa@0 141
Asa@0 142 for bagID = 0, NUM_BAG_SLOTS do
Asa@0 143 bagSize=GetContainerNumSlots(bagID)
Asa@0 144 for slotID = 0, bagSize do
Asa@0 145 itemID = GetContainerItemID(bagID, slotID);
Asa@0 146
Asa@0 147 if itemID ~= nil then
Asa@0 148 _, itemCount, _, _, _= GetContainerItemInfo(bagID, slotID);
Asa@0 149 name = GetItemInfo(itemID)
Asa@0 150 if i[name] == nil then
Asa@0 151 i[name] = 0
Asa@0 152 end
Asa@0 153 i[name] = i[name] + (itemCount or 0)
Asa@0 154 end
Asa@0 155
Asa@0 156 end
Asa@0 157
Asa@0 158 end
Asa@0 159 return {items = i, money = GetMoney()}
Asa@0 160 end
Asa@0 161
Asa@0 162 function addon:GetInventoryDiff(pastInventory, current)
Asa@0 163 if current == nil then
Asa@0 164 current = self:GetCurrentInventory()
Asa@0 165 end
Asa@0 166 local diff = {}
Asa@0 167
Asa@0 168 for name, count in pairs(current.items) do
Asa@0 169 if pastInventory.items[name] == nil then
Asa@0 170 diff[name] = count
Asa@0 171 self:Debug("1 diff[" .. name .. "]=" .. diff[name])
Asa@0 172 elseif count - pastInventory.items[name] ~= 0 then
Asa@0 173 diff[name] = count - pastInventory.items[name]
Asa@0 174 self:Debug("2 diff[" .. name .. "]=" .. diff[name])
Asa@0 175 end
Asa@0 176 end
Asa@0 177
Asa@0 178 for name, count in pairs(pastInventory.items) do
Asa@0 179 if current.items[name] == nil then
Asa@0 180 diff[name] = -count
Asa@0 181 self:Debug("3 diff[" .. name .. "]=" .. diff[name])
Asa@0 182 elseif current.items[name] - count ~= 0 then
Asa@0 183 diff[name] = current.items[name] - pastInventory.items[name]
Asa@0 184 self:Debug("4 diff[" .. name .. "]=" .. diff[name])
Asa@0 185 end
Asa@0 186 end
Asa@0 187
Asa@0 188 local moneyDiff = current.money - pastInventory.money
Asa@0 189
Asa@0 190 return {items = diff, money = moneyDiff}
Asa@0 191 end
Asa@0 192
Asa@0 193
Asa@0 194 function addon:ScanMail()
Asa@0 195 local results = {}
Asa@0 196 for mailIndex = 1, GetInboxNumItems() or 0 do
Asa@0 197 local sender, msgSubject, msgMoney, msgCOD, _, msgItem, _, _, msgText, _, isGM = select(3, GetInboxHeaderInfo(mailIndex))
Asa@0 198 local mailType = Postal:GetMailType(msgSubject)
Asa@0 199
Asa@0 200 if mailType == "NonAHMail" then
Asa@0 201 -- Don't know how to handle these yet
Asa@0 202 elseif mailType == "AHSuccess" then
Asa@0 203 local invoiceType, itemName, playerName, bid, buyout, deposit, consignment = GetInboxInvoiceInfo(mailIndex);
Asa@0 204 if results[itemName] == nil then
Asa@0 205 results[itemName] = 0
Asa@0 206 end
Asa@0 207 results[itemName] = results[itemName] + deposit + buyout - consignment
Asa@0 208
Asa@0 209 elseif mailType == "AHWon" then
Asa@0 210 local invoiceType, itemName, playerName, bid, buyout, deposit, consignment = GetInboxInvoiceInfo(mailIndex);
Asa@0 211 if results[itemName] == nil then
Asa@0 212 results[itemName] = 0
Asa@0 213 end
Asa@0 214 results[itemName] = results[itemName] - bid
Asa@0 215 elseif mailType == "AHExpired" or mailType == "AHCancelled" then
Asa@0 216 -- These should be handled when you pay the deposit at the AH
Asa@0 217 else
Asa@0 218 self:Debug("Unhandled mail type: " .. mailType)
Asa@0 219 self:Debug(msgSubject)
Asa@0 220 end
Asa@0 221
Asa@0 222 end
Asa@0 223 return results
Asa@0 224 end
Asa@0 225
Asa@0 226 function addon:MAIL_SHOW()
Asa@0 227 self:Debug("MAIL_SHOW")
Asa@0 228 self.lastMailScan = self:ScanMail()
Asa@0 229 self:UnregisterEvent("MAIL_SHOW")
Asa@0 230 self:RegisterEvent("MAIL_CLOSED")
Asa@0 231 self:RegisterEvent("MAIL_INBOX_UPDATE")
Asa@0 232 self:Debug("MAIL_SHOW complete")
Asa@0 233 end
Asa@0 234
Asa@0 235 function addon:MAIL_CLOSED()
Asa@0 236 addon:UnregisterEvent("MAIL_CLOSED")
Asa@0 237 self:UnregisterEvent("MAIL_INBOX_UPDATE")
Asa@0 238 self:RegisterEvent("MAIL_SHOW")
Asa@0 239 end
Asa@0 240
Asa@0 241 function addon:MAIL_INBOX_UPDATE()
Asa@0 242 local newScan = addon:ScanMail()
Asa@0 243 local diff
Asa@0 244 for item, total in pairs(self.lastMailScan) do
Asa@0 245
Asa@0 246 if newScan[item] == nil then
Asa@0 247 newScan[item] = 0
Asa@0 248 end
Asa@0 249 diff = total - newScan[item]
Asa@0 250 if diff ~= 0 then
Asa@0 251 self:SaveValue(item, diff)
Asa@0 252 end
Asa@0 253
Asa@0 254 end
Asa@0 255
Asa@0 256 self.lastMailScan = newScan
Asa@0 257 end
Asa@0 258
Asa@0 259 function addon:SaveValue(item, value)
Asa@0 260 local item_account = self.db.factionrealm.item_account
Asa@0 261 if item_account[item] == nil then
Asa@0 262 item_account[item] = 0
Asa@0 263 end
Asa@0 264 item_account[item] = item_account[item] + value
Asa@0 265
Asa@0 266 if item_account[item] >= 0 then
Asa@0 267 item_account[item] = nil
Asa@0 268 end
Asa@0 269 end
Asa@0 270
Asa@0 271 function addon:OnEnable()
Asa@0 272 self:Debug("Hello, world! OnEnable")
Asa@0 273 end
Asa@0 274
Asa@0 275 function addon:Debug(msg)
Asa@0 276 if self.db.char.debug then
Asa@0 277 self:Print(msg)
Asa@0 278 end
Asa@0 279 end
Asa@0 280
Asa@0 281 function addon:WatchBags()
Asa@0 282 if self.watch_handle == nil then
Asa@0 283 self.lastInventory = self:GetCurrentInventory()
Asa@0 284 self.watch_handle = self:RegisterBucketEvent({"BAG_UPDATE", "PLAYER_MONEY"}, 0.2, "UpdateAudit")
Asa@0 285 end
Asa@0 286 end
Asa@0 287
Asa@0 288 function addon:UnwatchBags()
Asa@0 289 if self.watch_handle ~= nil then
Asa@0 290 self:UnregisterBucket(self.watch_handle)
Asa@0 291 self.watch_handle = nil
Asa@0 292 end
Asa@0 293 end
Asa@0 294
Asa@0 295 function addon:UpdateAudit()
Asa@0 296 self:Debug("UpdateAudit")
Asa@0 297 local currentInventory = self:GetCurrentInventory()
Asa@0 298 local diff = addon:GetInventoryDiff(self.lastInventory, currentInventory)
Asa@0 299 -- this is only here for debugging
Asa@0 300 self.lastdiff = diff
Asa@0 301
Asa@0 302 if abs(diff.money) > 0 and IA_tcount(diff.items) == 1 then
Asa@0 303 self:Debug("purchase or sale")
Asa@0 304
Asa@0 305 for itemName, count in pairs(diff.items) do
Asa@0 306 self:SaveValue(itemName, diff.money)
Asa@0 307 end
Asa@0 308 elseif IA_tcount(diff.items) > 1 then
Asa@0 309 local positive, negative = {}, {}
Asa@0 310 local positiveCount, negativeCount = 0, 0
Asa@0 311 for item, count in pairs(diff.items) do
Asa@0 312 if count > 0 then
Asa@0 313 positive[item] = count
Asa@0 314 positiveCount = positiveCount + count
Asa@0 315 elseif count < 0 then
Asa@0 316 negative[item] = count
Asa@0 317 negativeCount = negativeCount + abs(count)
Asa@0 318 end
Asa@0 319 end
Asa@0 320
Asa@0 321 if IA_tcount(positive) > 0 and IA_tcount(negative) > 0 then
Asa@0 322 -- we must have created/converted something
Asa@0 323 self:Debug("conversion")
Asa@0 324 local totalChange = 0
Asa@0 325 for itemName, change in pairs(negative) do
Asa@0 326 local _, itemCost, count = self:GetItemCost(itemName, change)
Asa@0 327 self:SaveValue(itemName, abs(itemCost * change))
Asa@0 328
Asa@0 329 totalChange = totalChange + abs(itemCost * change)
Asa@0 330 end
Asa@0 331
Asa@0 332 self:Debug("totalChange")
Asa@0 333 self:Debug(totalChange)
Asa@0 334
Asa@0 335 local valuePerItem = totalChange / positiveCount
Asa@0 336 self:Debug(valuePerItem )
Asa@0 337 for itemName, change in pairs(positive) do
Asa@0 338 self:Debug(itemName)
Asa@0 339 self:Debug(0-abs(valuePerItem * change))
Asa@0 340 self:SaveValue(itemName, 0-abs(valuePerItem * change))
Asa@0 341 end
Asa@0 342 end
Asa@0 343 end
Asa@0 344
Asa@0 345 self.lastInventory = currentInventory
Asa@0 346 end
Asa@0 347
Asa@0 348 function addon:GetItemCost(itemName, countModifier)
Asa@0 349 local invested = abs(self.db.factionrealm.item_account[itemName] or 0)
Asa@0 350
Asa@0 351 if invested > 0 then
Asa@0 352 local _, itemLink = GetItemInfo (itemName);
Asa@0 353 local _, _, _, _, Id = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
Asa@0 354 local count = Altoholic:GetItemCount(tonumber(Id))
Asa@0 355 if countModifier ~= nil then
Asa@0 356 count = count - countModifier
Asa@0 357 end
Asa@0 358 if count == 0 then
Asa@0 359 self.db.factionrealm.item_account[itemName] = nil
Asa@0 360 self:Print("You ran out of " .. itemName .. "and never recovered " .. self:FormatMoney(invested))
Asa@0 361 return 0, 0, 0
Asa@0 362 end
Asa@0 363 return ceil(invested), ceil(invested/count), count
Asa@0 364 end
Asa@0 365 return 0, 0, 0
Asa@0 366 end
Asa@0 367
Asa@0 368 function addon:ShowTooltip(tip, link, num)
Asa@0 369 if (link == nil) then
Asa@0 370 return;
Asa@0 371 end
Asa@0 372
Asa@0 373 local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, _, _, _, _, itemVendorPrice = GetItemInfo (link);
Asa@0 374 -- local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, Name = string.find(link, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
Asa@0 375
Asa@0 376 local investedTotal, investedPerItem, count = self:GetItemCost(itemName)
Asa@0 377
Asa@0 378 local AHCut = 0.05
Asa@0 379 local keep = 1 - AHCut
Asa@0 380
Asa@0 381 if investedTotal > 0 then
Asa@0 382 tip:AddDoubleLine("\124cffffffffIA: Total Invested", self:FormatMoney(investedTotal));
Asa@0 383 tip:AddDoubleLine("\124cffffffffIA: Invested/Item (" .. count .. ")", self:FormatMoney(ceil(investedPerItem)));
Asa@0 384 tip:AddDoubleLine("\124cffffffffIA: Minimum faction AH Price: ", self:FormatMoney(ceil(investedPerItem/keep)))
Asa@0 385 tip:Show()
Asa@0 386 end
Asa@0 387 end
Asa@0 388
Asa@0 389 local function ShowTipWithPricing(tip, link, num)
Asa@0 390 addon:ShowTooltip(tip, link, num)
Asa@0 391 end
Asa@0 392
Asa@0 393 hooksecurefunc (GameTooltip, "SetBagItem",
Asa@0 394 function(tip, bag, slot)
Asa@0 395 local _, num = GetContainerItemInfo(bag, slot);
Asa@0 396 ShowTipWithPricing (tip, GetContainerItemLink(bag, slot), num);
Asa@0 397 end
Asa@0 398 );
Asa@0 399
Asa@0 400
Asa@0 401 hooksecurefunc (GameTooltip, "SetAuctionItem",
Asa@0 402 function (tip, type, index)
Asa@0 403 ShowTipWithPricing (tip, GetAuctionItemLink(type, index));
Asa@0 404 end
Asa@0 405 );
Asa@0 406
Asa@0 407 hooksecurefunc (GameTooltip, "SetAuctionSellItem",
Asa@0 408 function (tip)
Asa@0 409 local name, _, count = GetAuctionSellItemInfo();
Asa@0 410 local __, link = GetItemInfo(name);
Asa@0 411 ShowTipWithPricing (tip, link, num);
Asa@0 412 end
Asa@0 413 );
Asa@0 414
Asa@0 415
Asa@0 416 hooksecurefunc (GameTooltip, "SetLootItem",
Asa@0 417 function (tip, slot)
Asa@0 418 if LootSlotIsItem(slot) then
Asa@0 419 local link, _, num = GetLootSlotLink(slot);
Asa@0 420 ShowTipWithPricing (tip, link, num);
Asa@0 421 end
Asa@0 422 end
Asa@0 423 );
Asa@0 424
Asa@0 425 hooksecurefunc (GameTooltip, "SetLootRollItem",
Asa@0 426 function (tip, slot)
Asa@0 427 local _, _, num = GetLootRollItemInfo(slot);
Asa@0 428 ShowTipWithPricing (tip, GetLootRollItemLink(slot), num);
Asa@0 429 end
Asa@0 430 );
Asa@0 431
Asa@0 432
Asa@0 433 hooksecurefunc (GameTooltip, "SetInventoryItem",
Asa@0 434 function (tip, unit, slot)
Asa@0 435 ShowTipWithPricing (tip, GetInventoryItemLink(unit, slot), GetInventoryItemCount(unit, slot));
Asa@0 436 end
Asa@0 437 );
Asa@0 438
Asa@0 439 hooksecurefunc (GameTooltip, "SetGuildBankItem",
Asa@0 440 function (tip, tab, slot)
Asa@0 441 local _, num = GetGuildBankItemInfo(tab, slot);
Asa@0 442 ShowTipWithPricing (tip, GetGuildBankItemLink(tab, slot), num);
Asa@0 443 end
Asa@0 444 );
Asa@0 445
Asa@0 446 hooksecurefunc (GameTooltip, "SetTradeSkillItem",
Asa@0 447 function (tip, skill, id)
Asa@0 448 local link = GetTradeSkillItemLink(skill);
Asa@0 449 local num = GetTradeSkillNumMade(skill);
Asa@0 450 if id then
Asa@0 451 link = GetTradeSkillReagentItemLink(skill, id);
Asa@0 452 num = select (3, GetTradeSkillReagentInfo(skill, id));
Asa@0 453 end
Asa@0 454
Asa@0 455 ShowTipWithPricing (tip, link, num);
Asa@0 456 end
Asa@0 457 );
Asa@0 458
Asa@0 459 hooksecurefunc (GameTooltip, "SetTradePlayerItem",
Asa@0 460 function (tip, id)
Asa@0 461 local _, _, num = GetTradePlayerItemInfo(id);
Asa@0 462 ShowTipWithPricing (tip, GetTradePlayerItemLink(id), num);
Asa@0 463 end
Asa@0 464 );
Asa@0 465
Asa@0 466 hooksecurefunc (GameTooltip, "SetTradeTargetItem",
Asa@0 467 function (tip, id)
Asa@0 468 local _, _, num = GetTradeTargetItemInfo(id);
Asa@0 469 ShowTipWithPricing (tip, GetTradeTargetItemLink(id), num);
Asa@0 470 end
Asa@0 471 );
Asa@0 472
Asa@0 473 hooksecurefunc (GameTooltip, "SetQuestItem",
Asa@0 474 function (tip, type, index)
Asa@0 475 local _, _, num = GetQuestItemInfo(type, index);
Asa@0 476 ShowTipWithPricing (tip, GetQuestItemLink(type, index), num);
Asa@0 477 end
Asa@0 478 );
Asa@0 479
Asa@0 480 hooksecurefunc (GameTooltip, "SetQuestLogItem",
Asa@0 481 function (tip, type, index)
Asa@0 482 local num, _;
Asa@0 483 if type == "choice" then
Asa@0 484 _, _, num = GetQuestLogChoiceInfo(index);
Asa@0 485 else
Asa@0 486 _, _, num = GetQuestLogRewardInfo(index)
Asa@0 487 end
Asa@0 488
Asa@0 489 ShowTipWithPricing (tip, GetQuestLogItemLink(type, index), num);
Asa@0 490 end
Asa@0 491 );
Asa@0 492
Asa@0 493 hooksecurefunc (GameTooltip, "SetInboxItem",
Asa@0 494 function (tip, index, attachIndex)
Asa@0 495 local _, _, num = GetInboxItem(index, attachIndex);
Asa@0 496 ShowTipWithPricing (tip, GetInboxItemLink(index, attachIndex), num);
Asa@0 497 end
Asa@0 498 );
Asa@0 499
Asa@0 500 hooksecurefunc (GameTooltip, "SetSendMailItem",
Asa@0 501 function (tip, id)
Asa@0 502 local name, _, num = GetSendMailItem(id)
Asa@0 503 local name, link = GetItemInfo(name);
Asa@0 504 ShowTipWithPricing (tip, link, num);
Asa@0 505 end
Asa@0 506 );
Asa@0 507
Asa@0 508 hooksecurefunc (GameTooltip, "SetHyperlink",
Asa@0 509 function (tip, itemstring, num)
Asa@0 510 local name, link = GetItemInfo (itemstring);
Asa@0 511 ShowTipWithPricing (tip, link, num);
Asa@0 512 end
Asa@0 513 );
Asa@0 514
Asa@0 515 hooksecurefunc (ItemRefTooltip, "SetHyperlink",
Asa@0 516 function (tip, itemstring)
Asa@0 517 local name, link = GetItemInfo (itemstring);
Asa@0 518 ShowTipWithPricing (tip, link);
Asa@0 519 end
Asa@0 520 );