Quantcast

Get the number of skill lines in addon enable instead of immediatly.

ackis [01-20-09 - 19:50]
Get the number of skill lines in addon enable instead of immediatly.
Filename
ARLFrame.lua
AckisRecipeList.lua
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 8111935..e77a498 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -1924,14 +1924,25 @@ end

 do

-	local NumSkillLines = GetNumSkillLines()
+	local NumSkillLines

 	-- Description: Switch the displayed profession in the main panel
 	-- Expected result:
 	-- Input:
 	-- Output:

-	function addon.SwitchProfs(button)
+	function addon:SetSkillLines()
+
+		NumSkillLines = GetNumSkillLines()
+
+	end
+
+	-- Description: Switch the displayed profession in the main panel
+	-- Expected result:
+	-- Input:
+	-- Output:
+
+	function addon:SwitchProfs(button)
 		-- Known professions should be in playerData["Professions"]

 		-- This loop is gonna be weird. The reason is because we need to
@@ -3366,7 +3377,7 @@ function addon:CreateFrame(
 			ARL_SwitcherButton:RegisterForClicks("LeftButtonUp", "RightButtonUp")
 			ARL_SwitcherButton:SetScript("OnClick",
 				function(self, button)
-					addon.SwitchProfs(button)
+					addon:SwitchProfs(button)
 				end
 			)

diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index 2279c8d..d217a94 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -315,6 +315,9 @@ function addon:OnEnable()
 	-- Populate the repuatation level
 	self:GetFactionLevels()

+	-- Find out how many skill lines we have
+	self:SetSkillLines()
+
 	--Create the button now for later use
 	self:CreateScanButton()