From dcf3a3bc5ef9eb3b8139fbc8bcc73e7ca76a9882 Mon Sep 17 00:00:00 2001 From: Silversage of Eitrigg Date: Sun, 2 Oct 2011 21:58:19 -0700 Subject: [PATCH] general clean-up --- SageGearLevelTooltip.lua | 9 +++------ SageReforge.lua | 9 ++------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/SageGearLevelTooltip.lua b/SageGearLevelTooltip.lua index 850cf0e..2ebaed9 100644 --- a/SageGearLevelTooltip.lua +++ b/SageGearLevelTooltip.lua @@ -4,9 +4,9 @@ ]] ---------------------------------------------------------------------------------------------------- -local Class = sage and sage.class and sage.class.Class or error("Need access to sage.class.Class") -local Item = sage.item and sage.item.Item or error("Need access to sage.item.Item") -local Reforgings = sage.reforge and sage.reforge.Reforgings or error("Need access to sage.item.Item") +local Class = sage.class.Class +local Item = sage.item.Item +local Reforgings = sage.reforge.Reforgings local function newClass(arg) return Class:NewClass(arg) @@ -304,9 +304,6 @@ local EvaluatorToLineAdderAdaptor do EvaluatorToLineAdderAdaptor = class end ---[[ -/run function qz(...) local t,i,v={...}; if (#t)==0 then return end i=math.random(#t); v=table.remove(t, i); return v, qz(unpack(t)) end - ]] ---------------------------------------------------------------------------------------------------- local SageGearLevelTooltipUpdater do local class = newClass{name="TooltipUpdater"} diff --git a/SageReforge.lua b/SageReforge.lua index 9e1a210..a4eabce 100644 --- a/SageReforge.lua +++ b/SageReforge.lua @@ -2,7 +2,7 @@ -- Credit to emelio, read prior to writing this lib ---------------------------------------------------------------------------------------------------- -local Class = (sage and sage.class and sage.class.Class) or error("Need access to sage.class.Class") +local Class = sage.class.Class ---------------------------------------------------------------------------------------------------- -- A specific reforging from one stat to another @@ -72,16 +72,12 @@ local Reforgings do for _, to in ipairs(reforgeableStats) do if from~=to then REFORGING_BY_ID[index] = Reforging:New(index, from, to) --- REFORGING_BY_ID[index]:_Dump(index) index = index + 1 end end end end --- for k,v in pairs(REFORGING_BY_ID) do --- v:_Dump(k) --- end function class:_Initialize(instance, reforgingById) --self is class instance.reforgingById = reforgingById or REFORGING_BY_ID @@ -97,7 +93,6 @@ local Reforgings do function class:Find(itemId) local id = tonumber(itemId:match("item:%d+:%d+:%d+:%d+:%d+:%d+:%-?%d+:%-?%d+:%d+:(%d+)")) local result = self.reforgingById[id or 0] -- 0 will return nil --- print("id = " .. id .. ", index = " .. result.index .. ", to.shortName=" .. result.to.shortName) return result end @@ -105,6 +100,6 @@ local Reforgings do end -sage.reforge = sage.reforge or {} +namespace("sage.reforge") sage.reforge.Reforging = Reforging sage.reforge.Reforgings = Reforgings -- 1.7.9.5