From cf7080c9f217829d65b51cd44ccdf9cc742962a6 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Tue, 19 Feb 2013 12:43:52 +0400 Subject: [PATCH] Moar bydlocode :D --- ElvUI_SLE/modules/farm/farm.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ElvUI_SLE/modules/farm/farm.lua b/ElvUI_SLE/modules/farm/farm.lua index 07bd1e2..77e41d4 100644 --- a/ElvUI_SLE/modules/farm/farm.lua +++ b/ElvUI_SLE/modules/farm/farm.lua @@ -152,12 +152,14 @@ function F:UpdateSeedBarLayout(seedBar, anchor, buttons, category) else seedBar:Point("TOPLEFT", anchor, "TOPLEFT", (category-1)*(size+(E.PixelMode and 2 or 1))-(E.PixelMode and 0 or 2), 0) end]] - print(category) if category == 1 then seedBar:Point("TOPLEFT", anchor, "TOPLEFT", (E.PixelMode and 0 or -2), 0) else - print(_G[("FarmSeedBar%d"):format(category-1)]:GetName()) - seedBar:Point("TOPLEFT", _G[("FarmSeedBar%d"):format(category-1)], "TOPRIGHT", (E.PixelMode and 0 or 2), 0) --(size+(E.PixelMode and 2 or 1))-(E.PixelMode and 0 or 2), 0) + if _G[("FarmSeedBar%d"):format(category-1)]:IsShown() then + seedBar:Point("TOPLEFT", _G[("FarmSeedBar%d"):format(category-1)], "TOPRIGHT", (E.PixelMode and 0 or -1), 0) + else + F:UpdateSeedBarLayout(seedBar, anchor, buttons, category-1) + end end for i, button in ipairs(buttons) do @@ -172,20 +174,16 @@ function F:UpdateSeedBarLayout(seedBar, anchor, buttons, category) end end - if count ~= 0 then - seedBar:Width(size+2) - else - seedBar:Width(1) - end - seedBar:Height(100) --(count*(size+2)) + seedBar:Width(size+2) + seedBar:Height(1) --(count*(size+2)) return count end function F:UpdateBar(bar, layoutfunc, zonecheck, anchor, buttons, category) bar:Show() - local layout = layoutfunc(self, bar, anchor, buttons, category) - if (E.private.sle.farm and zonecheck(self) and not InCombatLockdown()) then + local count = layoutfunc(self, bar, anchor, buttons, category) + if (E.private.sle.farm and count > 0 and zonecheck(self) and not InCombatLockdown()) then bar:Show() else bar:Hide() -- 1.7.9.5