/trunk
--Loaded |
function AtlasLootReverse:OnEnable() |
if db.dbversion ~= AtlasLootReverse.version or db.alversion ~= ATLASLOOT_VERSION then |
local zone |
wipe(db.whoTable) -- Wipe the table |
AtlasLoot_LoadAllModules() -- Force AtlasLoot to load all modules |
for k1,v1 in pairs(AtlasLoot_TableNames) do |
for k2,v2 in pairs(AtlasLoot_Data[k1]) do |
if type(v2) == "table" and type(v2[2]) == "number" and not db.whoTable[v2[2]] and v2[2] > 0 then |
if strsub(k1, -5) == "25Man" then |
db.whoTable[v2[2]] = { v1[1], strtrim(string.format(L["25 Man %s"], AtlasLootReverse:FindZone(strsub(k1, 1, strlen(k1)-5)))) } -- [itemId] = { boss, zone } |
zone = strtrim(string.format(L["25 Man %s"], AtlasLootReverse:FindZone(strsub(k1, 1, strlen(k1)-5)))) |
else |
db.whoTable[v2[2]] = { v1[1], AtlasLootReverse:FindZone(k1) } -- [itemId] = { boss, zone } |
zone = AtlasLootReverse:FindZone(k1) |
end |
if zone ~= "" then zone = " (" .. zone .. ")" end |
db.whoTable[v2[2]] = v1[1] .. zone |
end |
end |
end |
function AtlasLootReverse:Who(item) |
local _, itemId = strsplit(":", item) |
if db.whoTable[tonumber(itemId)] then |
local string = string.format(L["Drops from %s"], db.whoTable[tonumber(itemId)][1]) |
if (db.whoTable[tonumber(itemId)][2] ~= "") then |
string = string .. " (" .. db.whoTable[tonumber(itemId)][2] .. ")" |
end |
TT:AddLine(self, string, nil, nil, nil, true) |
TT:AddLine(self, string.format(L["Drops from %s"], db.whoTable[tonumber(itemId)]), nil, nil, nil, true) |
end |
end |
L["AtlasLootReverse"] = true |
L["Drops from %s"] = true -- %s is boss |
L["Drops from %s"] = true -- %s is boss (instance) |
L["25 Man %s"] = true -- %s is instance |