Quantcast

Moar bydlocode :D

Darthpred [02-19-13 - 08:43]
Moar bydlocode :D
Filename
ElvUI_SLE/modules/farm/farm.lua
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()