Quantcast

Hide tradeskill frame if no professions

MilleXIV [09-02-16 - 11:41]
Hide tradeskill frame if no professions
Filename
modules/tradeskill.lua
diff --git a/modules/tradeskill.lua b/modules/tradeskill.lua
index 2dbee7a..7df146b 100644
--- a/modules/tradeskill.lua
+++ b/modules/tradeskill.lua
@@ -87,19 +87,24 @@ function TradeskillModule:Refresh()
     self.secondProfFrame:SetPoint('LEFT', self.firstProfFrame, 'RIGHT', 5, 0)
   end

-  self:UpdateProfValues()
+  if self.prof1 or self.prof2 then

-  self.tradeskillFrame:SetSize(totalWidth, xb:GetHeight())
+    self:UpdateProfValues()
+
+    self.tradeskillFrame:SetSize(totalWidth, xb:GetHeight())

-  --self.tradeskillFrame:SetSize(self.goldButton:GetSize())
+    --self.tradeskillFrame:SetSize(self.goldButton:GetSize())

-  local relativeAnchorPoint = 'RIGHT'
-  local xOffset = db.general.moduleSpacing
-  if not xb:GetFrame('clockFrame'):IsVisible() then
-    relativeAnchorPoint = 'LEFT'
-    xOffset = 0
+    local relativeAnchorPoint = 'RIGHT'
+    local xOffset = db.general.moduleSpacing
+    if not xb:GetFrame('clockFrame'):IsVisible() then
+      relativeAnchorPoint = 'LEFT'
+      xOffset = 0
+    end
+    self.tradeskillFrame:SetPoint('LEFT', xb:GetFrame('clockFrame'), relativeAnchorPoint, xOffset, 0)
+  else
+    self.tradeskillFrame:Hide()
   end
-  self.tradeskillFrame:SetPoint('LEFT', xb:GetFrame('clockFrame'), relativeAnchorPoint, xOffset, 0)
 end

 function TradeskillModule:StyleTradeskillFrame(framePrefix, profIndex)