From 2378a79636a99def62e57439bb124ae928f88d54 Mon Sep 17 00:00:00 2001 From: ackis Date: Tue, 20 Jan 2009 19:50:12 +0000 Subject: [PATCH] Get the number of skill lines in addon enable instead of immediatly. --- ARLFrame.lua | 17 ++++++++++++++--- AckisRecipeList.lua | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) 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() -- 1.7.9.5