WoWInterface SVN Ranch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

trunk/ranch.lua
0,0 → 1,36
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
local dataobj = ldb:NewDataObject("Ranch", {type = "data source", text = "Ranch"})
 
function dataobj:OnTooltipShow()
local i, j
ranch_items = {}
for i = 0, 4 do
for j = 1, GetContainerNumSlots(i) do
local ContainerItemLink = GetContainerItemLink(i,j)
if ContainerItemLink ~= nil then
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(ContainerItemLink)
if itemType == "Trade Goods" then
if ranch_items[itemSubType] == nil then
ranch_items[itemSubType] = {}
end
local found, _, itemString = string.find(itemLink, "^|c%x+|H(.+)|h%[.*%]")
local _, itemId, enchantId, jewelId1, jewelId2, jewelId3, jewelId4, suffixId, uniqueId = strsplit(":", itemString)
if ranch_items[itemSubType][itemId] == nil then
ranch_items[itemSubType][itemId] = GetItemCount(itemLink)
end
end
end
end
end
 
local itemGroup, Collection, itemId, itemCount
self:AddLine("Ranch")
for itemGroup, Collection in pairs(ranch_items) do
self:AddLine(" ")
self:AddLine(itemGroup)
for itemId, itemCount in pairs(Collection) do
_, itemLink = GetItemInfo(itemId)
self:AddDoubleLine(itemLink,itemCount)
end
end
end
\ No newline at end of file