Log:
XLootMonitor: Full usage of GetItemInfo(). "XLoot_Item_Recieved" event triggering fixed up. Disabled borked testing menu items (Nerf new item links)
Modified:
trunk/XLootMonitor/XLootMonitor.lua
trunk/XLootMonitor/XLootMonitorOptions.lua
Modified: trunk/XLootMonitor/XLootMonitor.lua
==============================================================================
--- trunk/XLootMonitor/XLootMonitor.lua (original)
+++ trunk/XLootMonitor/XLootMonitor.lua Tue Dec 12 00:33:45 2006
@@ -42,7 +42,7 @@
self:AddTestItem("money1", function() self:LootHandler(string.format(LOOT_MONEY_SPLIT, "70 Gold, 2 Silver, 3 Copper")) end)
self:AddTestItem("money2", function() self:LootHandler(string.format(LOOT_MONEY_SPLIT, "1 Gold, 3 Copper")) end)
self:AddTestItem("money3", function() self:LootHandler(string.format(LOOT_MONEY_SPLIT, "99 Silver, 3 Copper")) end)
- self:AddTestItem("selflootcommon", function() self:LootHandler("You receive loot: |cffffffff|Hitem:4338:0:0:0|h[Mageweave Cloth]|h|r.") end)
+ self:AddTestItem("selflootcommon", function() self:LootHandler("You receive loot: |cffffffff|Hitem:4338:0:0:0:0:0:0|h[Mageweave Cloth]|h|r.") end)
self:AddTestItem("selflootuncommon", function() self:LootHandler("You receive loot: |cff1eff00|Hitem:10373:0:0:0|h[Imbued Plate Leggings]|h|r.") end)
self:AddTestItem("selflootrare", function() self:LootHandler("You receive loot: |cff007099|Hitem:12602:0:0:0|h[Draconian Deflector]|h|r.") end)
self:AddTestItem("selfstackloot1", function() self:LootHandler("You receive loot: |cffffffff|Hitem:8948:0:0:0|h[Dried King Bolete]|h|rx3.") end)
@@ -73,7 +73,6 @@
row.item = nil
row.count = nil
row.link = nil
- row.itemid = nil
end
stack.opts.trunc = {
type = "range",
@@ -112,7 +111,7 @@
if not self.cache.player[recipient] then
self.cache.player[recipient] = { class = class, classname = classname }
end
- table.insert(self.cache.player[recipient], { item = item, player = recipient, count = count, time = time(), icon = icon })
+ table.insert(self.cache.player[recipient], { item = item, count = count, time = time(), icon = icon })
--Add to total cache
if not self.cache.total[item] then
@@ -192,7 +191,7 @@
'icon', v.icon,
'tooltipFunc', GameTooltip.SetHyperlink,
'tooltipArg1', GameTooltip,
- 'tooltipArg2', XLoot:LinkToID(v.item),
+ 'tooltipArg2', v.item,
'func', function(arg1) self:LinkHistoryItem(arg1) end,
'arg1', v)
end
@@ -277,7 +276,7 @@
'icon', v.icon,
'tooltipFunc', GameTooltip.SetHyperlink,
'tooltipArg1', GameTooltip,
- 'tooltipArg2', XLoot:LinkToID(v.item),
+ 'tooltipArg2', v.item,
'func', function(arg1) self:LinkHistoryItem(arg1) end,
'arg1', v)
end
@@ -293,7 +292,7 @@
'icon', v.icon,
'tooltipFunc', GameTooltip.SetHyperlink,
'tooltipArg1', GameTooltip,
- 'tooltipArg2', XLoot:LinkToID(v.item),
+ 'tooltipArg2',v.item,
'func', function(arg1) self:LinkHistoryItem(arg1) end,
'arg1', v)
end
@@ -365,17 +364,20 @@
function XLootMonitor:LinkHistoryItem(item)
if not IsControlKeyDown() then
+ if IsShiftKeyDown() then
+ return ChatEdit_InsertLink(item.item)
+ end
if not ChatFrameEditBox:IsVisible() then
ChatFrameEditBox:Show()
end
local outstring = string.format("%s %s: %s ", date("%H:%M", item.time), item.player, item.item)
if strlen(ChatFrameEditBox:GetText()..outstring) > 255 then
- self:Print(L["linkErrorLength"])
+ return self:Print(L["linkErrorLength"])
else
- ChatFrameEditBox:Insert(outstring)
+ return ChatFrameEditBox:Insert(outstring)
end
else
- DressUpItemLink(item.item)
+ return DressUpItemLink(item.item)
end
end
@@ -411,7 +413,6 @@
local item = v.item == "coin" and "coin" or matches[v.item]
local count = item == "coin" and (XLoot:ParseCoinString(matches[v.count]) or 0) or (v.count ~= nil and matches[v.count] or 1)
local PlayerClass, EnglishClass = UnitClass(unitFromPlayerName(recipient))
-
return self:AddLoot(item, recipient, count, EnglishClass, PlayerClass)
end
end
@@ -419,11 +420,11 @@
function XLootMonitor:AddLoot(item, recipient, count, class, classname)
local itemName, itemLink, itemQuality, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture
- local itemid
if item ~= "coin" then
- itemid = XLoot:LinkToID(item)
- itemName, itemLink, itemQuality, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = XLoot:ItemInfo(itemid)
+ itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(item)
+ self:TriggerEvent("XLoot_Item_Recieved", item, recipient, count, class, classname, itemTexture, itemName, itemLink)
+ DevTools_Dump({GetItemInfo(item)})
if recipient == UnitName("player") then
if itemQuality < self.db.profile.selfqualitythreshold then
return
@@ -434,12 +435,12 @@
end
end
else
+ itemName = "coin"
+ self:TriggerEvent("XLoot_Item_Recieved", item, recipient, count, class, classname, nil, itemName)
if not self.db.profile.money then
return
end
- itemName = "coin"
end
- self:TriggerEvent("XLoot_Item_Recieved", item, recipient, count, class, classname, itemTexture, itemName, itemLink)
local length = self.db.profile.monitorlinktrunc
if string.len(itemName) > length then
@@ -464,7 +465,6 @@
row.item = itemName or "coin"
row.count = count
row.link = item
- row.itemid = itemid
if item == "coin" then -- Money
row.fsplayer:SetText(loottext)
Modified: trunk/XLootMonitor/XLootMonitorOptions.lua
==============================================================================
--- trunk/XLootMonitor/XLootMonitorOptions.lua (original)
+++ trunk/XLootMonitor/XLootMonitorOptions.lua Tue Dec 12 00:33:45 2006
@@ -363,6 +363,7 @@
if not self.opts.advanced.args.test then
self.opts.advanced.args.test = {
type = "group",
+ disabled = true,
name = "|cFFFF5522Test handlers",
desc = "If you're using this, kill yourself now <3.",
args = { },
@@ -372,6 +373,7 @@
if not self.opts.advanced.args.autotest then
self.opts.advanced.args.autotest = {
type = "toggle",
+ disabled = true,
name = "|cFFFF5522Stress-test handlers",
desc = "If you're using this, you're most likely profiling. Again, kill yourself now. <3. Also. |cFFFF0000This WILL lag you out for a few moments.|r",
set = function()