Version 1.2.5 (26-12-2017)

Jarth [12-26-17 - 18:00]
Version 1.2.5 (26-12-2017)
Filename
Changelog
SummonAssistant.lua
diff --git a/Changelog b/Changelog
index d0b1147..ba56f20 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,9 @@
 -------------------------------------------------------------------------------
 Summon Assistant
 -------------------------------------------------------------------------------
+Version 1.2.5 (26-12-2017)
+- Fixed issue where the border would be visible, when no icons were shown
+
 Version 1.2.4 (18-12-2017)
 - Fixed issue when dragging skills to the hotbar

diff --git a/SummonAssistant.lua b/SummonAssistant.lua
index 4e5b8e6..2502bc7 100644
--- a/SummonAssistant.lua
+++ b/SummonAssistant.lua
@@ -13,7 +13,7 @@ local LAM2 = LibStub:GetLibrary("LibAddonMenu-2.0")
 -------------------------------------------------------------------------------------------------
 local ADDON_NAME = "SummonAssistant"
 local ADDON_VERSION = 1.2
-local ADDON_MINOR_VERSION = 4
+local ADDON_MINOR_VERSION = 5
 local ADDON_AUTHOR = "Jarth"
 local ADDON_WEBSITE = ""
 local SummonAssistant = {} -- this may seem odd, but it sets the access level for "SummonAssistant"
@@ -97,6 +97,7 @@ function SummonAssistant.addControlToFrame(menuOpen)
   if menuOpen then
     SA_Frame:SetHidden(true)
   end
+
   SCENE_MANAGER:GetScene('hud'):AddFragment(SummonAssistant.Fragment)
   SCENE_MANAGER:GetScene('hudui'):AddFragment(SummonAssistant.Fragment)
 end
@@ -111,29 +112,31 @@ function SummonAssistant.removeControlToFrame(menuOpen)
 end

 function SummonAssistant.setButtonFrameWidth()
-  local saSize = 0
-  if IsCollectibleUnlocked(267) and SummonAssistant.savedVariables.showBanker then saSize = saSize + 60 end
-  if IsCollectibleUnlocked(300) and SummonAssistant.savedVariables.showFence  then saSize = saSize + 60 end
-  if IsCollectibleUnlocked(301) and SummonAssistant.savedVariables.showVendor then saSize = saSize + 60 end
-  SA_Frame:SetHidden(saSize == 0)
-  if SummonAssistant.savedVariables.horizontalOrientation then
-    SA_Frame:SetWidth(saSize)
-    SA_FrameBackdrop:SetWidth(saSize)
-    SA_Frame:SetHeight(60)
-    SA_FrameBackdrop:SetHeight(60)
-  else
-    SA_Frame:SetWidth(60)
-    SA_FrameBackdrop:SetWidth(60)
-    SA_Frame:SetHeight(saSize)
-    SA_FrameBackdrop:SetHeight(saSize)
-  end
+  local saBtnHeight = 60
+  local saBtnWidth = 60
+  local saCount = 0
+  local saShow = 0
+
+  if IsCollectibleUnlocked(267) and SummonAssistant.savedVariables.showBanker then saCount = saCount + 1 end
+  if IsCollectibleUnlocked(300) and SummonAssistant.savedVariables.showFence  then saCount = saCount + 1 end
+  if IsCollectibleUnlocked(301) and SummonAssistant.savedVariables.showVendor then saCount = saCount + 1 end
+  if saCount > 0 then saShow = 1 end
+
+  SA_Frame:SetHidden(saCount == 0)
+  SA_FrameBackdrop:SetHidden(saCount == 0)
+
+  SA_Frame:SetHeight(SummonAssistant.savedVariables.horizontalOrientation and saShow * saBtnHeight or saCount * saBtnWidth)
+  SA_FrameBackdrop:SetHeight(SummonAssistant.savedVariables.horizontalOrientation and saShow * saBtnHeight or saCount * saBtnWidth)
+  SA_Frame:SetWidth(SummonAssistant.savedVariables.horizontalOrientation and saCount * saBtnWidth or saShow * saBtnHeight)
+  SA_FrameBackdrop:SetWidth(SummonAssistant.savedVariables.horizontalOrientation and saCount * saBtnWidth or saShow * saBtnHeight)
 end

 function SummonAssistant.isCollectibleEnabled(id)
   local result = true
-  if id == 267 and not SummonAssistant.savedVariables.showBanker then result = false end
-  if id == 300 and not SummonAssistant.savedVariables.showFence  then result = false end
-  if id == 301 and not SummonAssistant.savedVariables.showVendor then result = false end
+  if id == 267 and not SummonAssistant.savedVariables.showBanker then result = false
+  elseif id == 300 and not SummonAssistant.savedVariables.showFence  then result = false
+  elseif id == 301 and not SummonAssistant.savedVariables.showVendor then result = false
+  end
   return result
 end