Quantcast

Solved problems modules links with display options

Mikeprod [10-04-16 - 14:13]
Solved problems modules links with display options
Filename
modules/armor.lua
modules/gold.lua
modules/micromenu.lua
modules/system.lua
diff --git a/modules/armor.lua b/modules/armor.lua
index b2ea220..bb75d69 100644
--- a/modules/armor.lua
+++ b/modules/armor.lua
@@ -130,13 +130,16 @@ function ArmorModule:Refresh()

   local relativeAnchorPoint = 'RIGHT'
   local xOffset = xb.db.profile.general.moduleSpacing
-  if not xb:GetFrame('microMenuFrame'):IsVisible() then
+
+  local parentFrame = xb:GetFrame('microMenuFrame');
+  if not xb.db.profile.modules.microMenu.enabled then
+	parentFrame = self.armorFrame:GetParent()
     relativeAnchorPoint = 'LEFT'
     xOffset = 0
   end

   self.armorFrame:ClearAllPoints()
-  self.armorFrame:SetPoint('LEFT', xb:GetFrame('microMenuFrame'), relativeAnchorPoint, xOffset, 0)
+  self.armorFrame:SetPoint('LEFT', parentFrame, relativeAnchorPoint, xOffset, 0)
   self:SetArmorColor()
 end

diff --git a/modules/gold.lua b/modules/gold.lua
index af08c71..2b369f7 100644
--- a/modules/gold.lua
+++ b/modules/gold.lua
@@ -90,11 +90,13 @@ function GoldModule:Refresh()

   local relativeAnchorPoint = 'LEFT'
   local xOffset = db.general.moduleSpacing
-  if not xb:GetFrame('travelFrame'):IsVisible() then
+  local parentFrame = xb:GetFrame('travelFrame')
+  if not xb.db.profile.modules.travel.enabled then
+    parentFrame = self.goldFrame:GetParent()
     relativeAnchorPoint = 'RIGHT'
     xOffset = 0
   end
-  self.goldFrame:SetPoint('RIGHT', xb:GetFrame('travelFrame'), relativeAnchorPoint, -(xOffset), 0)
+  self.goldFrame:SetPoint('RIGHT', parentFrame, relativeAnchorPoint, -(xOffset), 0)
 end

 function GoldModule:CreateFrames()
diff --git a/modules/micromenu.lua b/modules/micromenu.lua
index a501fcd..01a0842 100644
--- a/modules/micromenu.lua
+++ b/modules/micromenu.lua
@@ -63,7 +63,7 @@ function MenuModule:OnEnable()
     self:CreateFrames()
     self:RegisterFrameEvents()
     self:CreateIcons()
-    self:Refresh()
+    xb:Refresh()
     self:UpdateGuildText()
     self:UpdateFriendText()
   end
@@ -74,14 +74,14 @@ function MenuModule:OnDisable()
     frame:Hide()
   end
   self.microMenuFrame:Hide()
-  self:Refresh()
   self:UnregisterFrameEvents()
+  xb:Refresh()
 end

 function MenuModule:Refresh()
-  if self.frames.menu == nil then return; end
-
   if not xb.db.profile.modules.microMenu.enabled then self:Disable(); return; end
+
+  if self.frames.menu == nil then return; end

   if InCombatLockdown() then
     self:RegisterEvent('PLAYER_REGEN_ENABLED', function()
diff --git a/modules/system.lua b/modules/system.lua
index dacccb4..2b23fb3 100644
--- a/modules/system.lua
+++ b/modules/system.lua
@@ -96,11 +96,17 @@ function SystemModule:Refresh()
   --self.systemFrame:SetSize()
   local relativeAnchorPoint = 'LEFT'
   local xOffset = db.general.moduleSpacing
-  if not xb:GetFrame('goldFrame'):IsVisible() then
-    relativeAnchorPoint = 'RIGHT'
-    xOffset = 0
+  local parentFrame = xb:GetFrame('goldFrame');
+  if not xb.db.profile.modules.gold.enabled then
+	if xb.db.profile.modules.travel.enabled then
+	  parentFrame = xb:GetFrame('travelFrame');
+	else
+	  relativeAnchorPoint = 'RIGHT'
+	  xOffset = 0
+	  parentFrame = self.systemFrame:GetParent();
+	end
   end
-  self.systemFrame:SetPoint('RIGHT', xb:GetFrame('goldFrame'), relativeAnchorPoint, -(xOffset), 0)
+  self.systemFrame:SetPoint('RIGHT', parentFrame, relativeAnchorPoint, -(xOffset), 0)
 end

 function SystemModule:UpdateTexts()