From 343af781dfc0c6eace3a8ed14c32ed0c33c1f520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tekkub=20=3Abear=3A=E2=80=82?= Date: Sun, 4 Nov 2012 18:24:01 -0700 Subject: [PATCH] Switch to externals for deprob and idmemo --- Panda.toc | 4 +++- PanelFactory.lua | 3 +-- externals.txt | 2 ++ tekDEprob.lua => externals/disenchant_probability.lua | 0 tekIDmemo.lua => externals/itemid.lua | 8 ++++---- 5 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 externals.txt rename tekDEprob.lua => externals/disenchant_probability.lua (100%) mode change 100755 => 100644 rename tekIDmemo.lua => externals/itemid.lua (63%) diff --git a/Panda.toc b/Panda.toc index f7ec6ca..441abc9 100644 --- a/Panda.toc +++ b/Panda.toc @@ -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 diff --git a/PanelFactory.lua b/PanelFactory.lua index fc1d9f7..49a64ac 100755 --- a/PanelFactory.lua +++ b/PanelFactory.lua @@ -1,7 +1,6 @@  local myname, ns = ... -local idmemo = LibStub("tekIDmemo") local unknown, knowncombines, tracker = {} local known = setmetatable({}, {__index = function(t,i) @@ -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 diff --git a/externals.txt b/externals.txt new file mode 100644 index 0000000..0ebe452 --- /dev/null +++ b/externals.txt @@ -0,0 +1,2 @@ +disenchant_probability.lua +itemid.lua diff --git a/tekDEprob.lua b/externals/disenchant_probability.lua old mode 100755 new mode 100644 similarity index 100% rename from tekDEprob.lua rename to externals/disenchant_probability.lua diff --git a/tekIDmemo.lua b/externals/itemid.lua similarity index 63% rename from tekIDmemo.lua rename to externals/itemid.lua index ffde7a7..f916e03 100644 --- a/tekIDmemo.lua +++ b/externals/itemid.lua @@ -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 @@ -17,4 +18,3 @@ setmetatable(ids, { return id end, }) -