From cfd1149af8d619876e69b0b29d4d810920fc4215 Mon Sep 17 00:00:00 2001 From: Alar of Runetotem Date: Sun, 28 Aug 2016 19:37:56 +0200 Subject: [PATCH] Refactored specific module retrieval --- GarrisonCommander.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua index 1217115..22656c4 100644 --- a/GarrisonCommander.lua +++ b/GarrisonCommander.lua @@ -403,6 +403,9 @@ end function addon:GetBigScreen() return ns.bigscreen end +function addon:GetMissionModule(followertype) + return ns.custom[followertype] +end function addon:OnInitialized() --@debug@ print("Initialize") @@ -2869,7 +2872,7 @@ function addon:AddStandardDataToButton(source,button,mission,missionID,bigscreen else button.LocBG:Hide(); end - ns.custom[mission.followerTypeID]:AddLevel(source,button,mission,missionID,bigscreen) + self:GetMissionModule(mission.followerTypeID):AddLevel(source,button,mission,missionID,bigscreen) button:Enable() button.MissionType:SetPoint("TOPLEFT",5,-2) -- From here on, I am in my own buttons context @@ -3153,7 +3156,7 @@ end function addon:HookedGarrisonMissionButton_SetRewards(frame,rewards,numRewards) collectgarbage("step",300) local mission=frame.info - local module=ns.custom[mission.followerTypeID] + local module=self:GetMissionModule(mission.followerTypeID) local main=module:GetMain() if not main or not main:IsVisible() then return end local Missions=module:GetMissions() -- 1.7.9.5