WoWInterface SVN zz_itemsdb

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 59 to Rev 60
    Reverse comparison

Rev 59 → Rev 60

zz_itemsdb/currency.lua
7,7 → 7,7
local function getCurrencyItem(index)
local currencyLink = GetCurrencyListLink(index)
if(currencyLink) then
return currencyLink:match("currency:(%d+)") or nil
return tonumber(currencyLink:match("currency:(%d+)")) or nil
end
end
local function curLoop(res,id)
18,7 → 18,6
unitname = units[k]['name']
for a,b in pairs(v) do
if(a == id and b['count']>0) then
res[unitname] = b['count']
if(b['max']>0) then
res[unitname] = addon:colorize(format("%s/%s",b['count'],b['max']),b['count']==b['max'] and "ff0000" or "ffffff")
else
34,11 → 33,11
local function SetCurrencyByID(tooltip,itemID)
if(itemID) then
local res = curLoop({},itemID)
if(res) then
if(type(res) == 'table') then
tooltip:AddLine(" ")
for name, b in pairs(res) do
for curName, b in pairs(res) do
if(addon:GetPref(modul.name .. "Tooltip")) then
tooltip:AddLine(format("%s %s: %s",addon:getIcon(itemID),name,b))
tooltip:AddLine(format("%s %s: %s",addon:getIcon(itemID),curName,b))
end
end
end
50,7 → 49,7
SetCurrencyByID(tooltip,getCurrencyItem(index))
end
local function GameTooltip_SetHyperlink(tooltip, link)
SetCurrencyByID(tooltip,link:match("currency:(%d+)"))
SetCurrencyByID(tooltip,tonumber(link:match("currency:(%d+)")))
end
 
function events:CURRENCY_DISPLAY_UPDATE(event)
58,7 → 57,7
if(playerID) then
modul['db'][playerID] = modul['db'][playerID] or {}
for index=1,GetCurrencyListSize() do
local name, isHeader, isExpanded, isUnused, isWatched, count, icon, maximum, hasWeeklyLimit, currentWeeklyAmount =GetCurrencyListInfo(index)
local curName, isHeader, isExpanded, isUnused, isWatched, count, icon, maximum, hasWeeklyLimit, currentWeeklyAmount =GetCurrencyListInfo(index)
local itemID = getCurrencyItem(index)
if((not isHeader) and itemID) then
modul['db'][playerID][tonumber(itemID)] = {