Skip to content

Commit

Permalink
Switch to externals for deprob and idmemo
Browse files Browse the repository at this point in the history
  • Loading branch information
tekkub committed Nov 5, 2012
1 parent 82c0df7 commit 343af78
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Panda.toc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ tekKonfigButton.lua
tekKonfigScroll.lua
tinyGratuity.lua
tekIDmemo.lua
tekDEprob.lua

externals\disenchant_probability.lua
externals\itemid.lua

Panda.lua
ButtonFactory.lua
Expand Down
3 changes: 1 addition & 2 deletions PanelFactory.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

local myname, ns = ...

local idmemo = LibStub("tekIDmemo")

local unknown, knowncombines, tracker = {}
local known = setmetatable({}, {__index = function(t,i)
Expand Down Expand Up @@ -167,7 +166,7 @@ function Panda:PanelFiller()
local spellid = spelllink:match("enchant:(%d+)")
knowncombines[tonumber(spellid) + 0.1] = true
if skilltype == ENSCRIBE then AddToData(name)
elseif idmemo[link] then knowncombines[idmemo[link]] = true end
elseif ns.ids[link] then knowncombines[ns.ids[link]] = true end
end
end
for f in pairs(unknown) do f:SetAlpha(known[f] and 1 or 0.25) end
Expand Down
2 changes: 2 additions & 0 deletions externals.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disenchant_probability.lua
itemid.lua
File renamed without changes.
8 changes: 4 additions & 4 deletions tekIDmemo.lua → externals/itemid.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

local ids = LibStub:NewLibrary("tekIDmemo", 2)
if not ids then return end
local myname, ns = ...

setmetatable(ids, {

-- Creates a memoizing table that converts an itemlink string into an itemID int
ns.ids = setmetatable({}, {
__index = function(t,i)
if type(i) == "number" then
t[i] = i
Expand All @@ -17,4 +18,3 @@ setmetatable(ids, {
return id
end,
})

0 comments on commit 343af78

Please sign in to comment.