It is no longer necessary to nil addon:InitializeLookups() after it has been run - it now does so itself.
James D. Callahan III [06-02-10 - 08:08]
It is no longer necessary to nil addon:InitializeLookups() after it has been run - it now does so itself.
diff --git a/ARL.lua b/ARL.lua
index 836e5bc..7783d4e 100644
--- a/ARL.lua
+++ b/ARL.lua
@@ -1749,20 +1749,25 @@ function addon:ChatCommand(input)
end
+-- Public API function to initialize all of the lookup lists - self-nils once run.
+-- @name AckisRecipeList:InitializeLookups()
+-- @usage if AckisRecipeList.InitializeLookups then AckisRecipeList:InitializeLookups() end
+function addon:InitializeLookups()
+ self:InitCustom(private.custom_list)
+ self:InitMob(private.mob_list)
+ self:InitQuest(private.quest_list)
+ self:InitReputation(private.reputation_list)
+ self:InitTrainer(private.trainer_list)
+ self:InitSeasons(private.seasonal_list)
+ self:InitVendor(private.vendor_list)
+
+ self.InitializeLookups = nil
+end
+
-------------------------------------------------------------------------------
-- Recipe Scanning Functions
-------------------------------------------------------------------------------
do
- function addon:InitializeLookups()
- self:InitCustom(private.custom_list)
- self:InitMob(private.mob_list)
- self:InitQuest(private.quest_list)
- self:InitReputation(private.reputation_list)
- self:InitTrainer(private.trainer_list)
- self:InitSeasons(private.seasonal_list)
- self:InitVendor(private.vendor_list)
- end
-
-- List of tradeskill headers, used in addon:Scan()
local header_list = {}
@@ -1811,7 +1816,6 @@ do
if self.InitializeLookups then
self:InitializeLookups()
- self.InitializeLookups = nil
end
-- Add the recipes to the database
-- TODO: Figure out what this variable was supposed to be for - it isn't used anywhere. -Torhal
diff --git a/Scanner.lua b/Scanner.lua
index d8b4766..0774aed 100644
--- a/Scanner.lua
+++ b/Scanner.lua
@@ -549,7 +549,6 @@ local function LoadRecipe()
-- Make sure the lookup lists are loaded as well, since they are no longer automatically loaded in addon:OnEnable().
if addon.InitializeLookups then
addon:InitializeLookups()
- addon.InitializeLookups = nil
end
for idx, prof in pairs(PROFESSIONS) do