From 6534646235a7e93544ccefdc417b99bb707664b6 Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Sat, 10 Jan 2015 16:47:33 -0600 Subject: [PATCH] x --- .../AddOns/SVUI_CraftOMatic/components/farming.lua | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua index bc903a5..8742eb7 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua @@ -435,21 +435,24 @@ function PLUGIN:RefreshFarmingTools() end for i = 1, NUM_SEED_BARS do + local seedBar = _G["FarmSeedBar"..i] count = 0 - for i, button in ipairs(seedButtons[i]) do - local BUTTONSIZE = seedBar.ButtonSize; - button:SetPointToScale("TOPLEFT", seedBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:SetSizeToScale(BUTTONSIZE,BUTTONSIZE) - if (not self.db.general.farming.onlyactive or (self.db.general.farming.onlyactive and button.items > 0)) then - button.icon:SetVertexColor(1,1,1) - count = count + 1 - elseif (not self.db.general.farming.onlyactive and button.items <= 0) then - button:Show() - button.icon:SetVertexColor(0.25,0.25,0.25) - count = count + 1 - else - button:Hide() + if(seedButtons[i]) then + for i, button in ipairs(seedButtons[i]) do + local BUTTONSIZE = seedBar.ButtonSize; + button:SetPointToScale("TOPLEFT", seedBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:SetSizeToScale(BUTTONSIZE,BUTTONSIZE) + if (not self.db.general.farming.onlyactive or (self.db.general.farming.onlyactive and button.items > 0)) then + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not self.db.general.farming.onlyactive and button.items <= 0) then + button:Show() + button.icon:SetVertexColor(0.25,0.25,0.25) + count = count + 1 + else + button:Hide() + end end end if(self.db.general.farming.onlyactive and not self.db.general.farming.undocked) then -- 1.7.9.5