Quantcast

Starting up base structures, config, micromenu

MilleXIV [08-07-16 - 23:27]
Starting up base structures, config, micromenu
Filename
XIV_Databar.toc
core.lua
locales/enUS.lua
modules/load_modules.xml
modules/micromenu.lua
modules/old/micromenu.lua
modules/test.lua
diff --git a/XIV_Databar.toc b/XIV_Databar.toc
index f6fb8ae..f95de73 100644
--- a/XIV_Databar.toc
+++ b/XIV_Databar.toc
@@ -9,12 +9,13 @@
 embeds.xml
 locales\locales.xml
 core.lua
+modules\load_modules.xml

 settings.lua

 modules\config.lua
 modules\social.lua
-modules\micromenu.lua
+modules\old\micromenu.lua
 modules\armor.lua
 modules\talent.lua
 modules\clock.lua
diff --git a/core.lua b/core.lua
index be214b6..922d18b 100644
--- a/core.lua
+++ b/core.lua
@@ -1,11 +1,14 @@
 local AddOnName, Engine = ...;
 local _G = _G;
 local pairs, unpack, select = pairs, unpack, select
-local XIVBar = LibStub("AceAddon-3.0"):NewAddon(AddOnName);
+local XIVBar = LibStub("AceAddon-3.0"):NewAddon(AddOnName, "AceConsole-3.0", "AceEvent-3.0");
 local L = LibStub("AceLocale-3.0"):GetLocale(AddOnName, false);

 XIVBar.defaults = {
   profile = {
+    general = {
+      barPosition = "BOTTOM",
+    },
     color = {
       barColor = {
         r = 0.25,
@@ -14,11 +17,37 @@ XIVBar.defaults = {
         a = 1
       },
       normal = {
+        r = 0.8,
+        g = 0.8,
+        b = 0.8,
+        a = 0.75
+      },
+      inactive = {
         r = 1,
         g = 1,
         b = 1,
-        a = 0.75
+        a = 0.25
+      },
+      useCC = true,
+      hover = {
+        r = 1,
+        g = 1,
+        b = 1,
+        a = 1
       }
+    },
+    text = {
+      fontSize = 12,
+      smallFontSize = 11,
+      font =  L['Homizio Bold']
+    },
+
+
+
+
+
+    modules = {
+
     }
   }
 };
@@ -29,8 +58,11 @@ XIVBar.constants = {
   playerClass = select(2, UnitClass("player"))
 }

+P = {};
+
 Engine[1] = XIVBar;
 Engine[2] = L;
+Engine[3] = P;
 _G.XIVBar = Engine;

 XIVBar.LSM = LibStub('LibSharedMedia-3.0');
@@ -38,59 +70,21 @@ XIVBar.LSM = LibStub('LibSharedMedia-3.0');
 _G[AddOnName] = Engine;

 function XIVBar:OnInitialize()
-  self.db = LibStub("AceDB-3.0"):New("XIVBarDB", self.defaults, "Default")
+
+  self.LSM:Register(self.LSM.MediaType.FONT, L['Homizio Bold'], self.constants.mediaPath.."homizio_bold.ttf")
+
   local options = {
     name = "XIV Bar",
     handler = XIVBar,
     type = 'group',
     args = {
       general = {
-        name = L['Test'],
+        name = L['General'],
         type = "group",
         args = {
-          colors = {
-            name = L['Text Colors'],
-            type = "group",
-            inline = true,
-            args = {
-              normal = {
-                name = L['Normal'],
-                type = "color",
-                hasAlpha = true,
-                set = function(info, r, g, b, a)
-                  XIVBar:SetColor('normal', r, g, b, a)
-                end,
-                get = function() return XIVBar:GetColor('normal') end
-              }, -- normal
-              inactive = {
-                name = L['Inactive'],
-                type = "color",
-                hasAlpha = true,
-                set = function(info, r, g, b, a)
-                  XIVBar:SetColor('normal', r, g, b, a)
-                end,
-                get = function() return XIVBar:GetColor('normal') end
-              }, -- normal
-              hoverCC = {
-                name = L['Hover Class Colors'],
-                type = "color",
-                hasAlpha = true,
-                set = function(info, r, g, b, a)
-                  XIVBar:SetColor('normal', r, g, b, a)
-                end,
-                get = function() return XIVBar:GetColor('normal') end
-              }, -- normal
-              hover = {
-                name = L['Normal'],
-                type = "color",
-                hasAlpha = true,
-                set = function(info, r, g, b, a)
-                  XIVBar:SetColor('normal', r, g, b, a)
-                end,
-                get = function() return XIVBar:GetColor('normal') end
-              }, -- normal
-            }
-          }, -- colors
+          general = self:GetGeneralOptions(),
+          text = self:GetTextOptions(),
+          textColors = self:GetTextColorOptions(), -- colors
         }
       }, -- general
       modules = {
@@ -102,27 +96,239 @@ function XIVBar:OnInitialize()
       } -- modules
     }
   }
+  for name, module in self:IterateModules() do
+    if module['GetConfig'] ~= nil then
+      options.args.modules.args[name] = module:GetConfig()
+    end
+    if module['GetDefaultOptions'] ~= nil then
+      local oName, oTable = module:GetDefaultOptions()
+      self.defaults.profile.modules[oName] = oTable
+    end
+  end
+
+  self.db = LibStub("AceDB-3.0"):New("XIVBarDB", self.defaults, "Default")
+  P = self.db.profile
+
   LibStub("AceConfig-3.0"):RegisterOptionsTable(AddOnName, options)
-  LibStub("AceConfigDialog-3.0"):AddToBlizOptions(AddOnName, "XIV Bar", nil, "general")
+  self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(AddOnName, "XIV Bar", nil, "general")
+
+  --options.args.modules = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
+  self.modulesOptionFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(AddOnName, L['Modules'], "XIV Bar", "modules")

   --LibStub("AceConfig-3.0"):RegisterOptionsTable(AddOnName.."-Profiles", )
   options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
   self.profilesOptionFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(AddOnName, L['Profiles'], "XIV Bar", "profiles")
+
+
+
+  self:RegisterChatCommand('xivbar', 'ToggleConfig')
 end

 function XIVBar:OnEnable()
   self.frames = {}
-  self.frames.bar = CreateFrame("FRAME")
+  self:CreateMainBar()
+end
+
+function XIVBar:ToggleConfig()
+  InterfaceOptionsFrame_OpenToCategory(self.optionsFrame)
 end

 function XIVBar:SetColor(name, r, g, b, a)
-  self.db.profile.color[name].r = r
-  self.db.profile.color[name].g = g
-  self.db.profile.color[name].b = b
-  self.db.profile.color[name].a = a
+  P.color[name].r = r
+  P.color[name].g = g
+  P.color[name].b = b
+  P.color[name].a = a
+
+  self:Refresh()
 end

 function XIVBar:GetColor(name)
-  d = self.db.profile.color[name]
+  d = P.color[name]
   return d.r, d.g, d.b, d.a
 end
+
+function XIVBar:HoverColors()
+  local colors = {
+    P.color.hover.r,
+    P.color.hover.g,
+    P.color.hover.b,
+    P.color.hover.a
+  }
+  if P.color.useCC then
+    colors = {
+      RAID_CLASS_COLORS[self.constants.playerClass].r,
+      RAID_CLASS_COLORS[self.constants.playerClass].g,
+      RAID_CLASS_COLORS[self.constants.playerClass].b,
+      P.color.hover.a
+    }
+  end
+  return colors
+end
+
+function XIVBar:RegisterFrame(name, frame)
+  self.frames[name] = frame
+end
+
+function XIVBar:GetFrame(name)
+  return self.frames[name]
+end
+
+function XIVBar:CreateMainBar()
+  self:RegisterFrame('bar', CreateFrame("FRAME", "XIV_Databar", UIParent))
+  self:RegisterFrame('bgTexture', self.frames.bar:CreateTexture(nil, "BACKGROUND"))
+  self:Refresh()
+end
+
+function XIVBar:GetHeight()
+  return (P.text.fontSize * 2) + 3
+end
+
+function XIVBar:Refresh()
+  local mainBar = self.frames.bar
+  local bgTexture = self.frames.bgTexture
+  local barColor = P.color.barColor
+
+  mainBar:ClearAllPoints()
+  mainBar:SetPoint(P.general.barPosition)
+  mainBar:SetPoint("LEFT")
+  mainBar:SetPoint("RIGHT")
+  mainBar:SetHeight(self:GetHeight())
+
+  bgTexture:SetAllPoints()
+  bgTexture:SetColorTexture(barColor.r, barColor.g, barColor.b, barColor.a)
+
+  for name, module in self:IterateModules() do
+    if module['Refresh'] == nil then return; end
+    module:Refresh()
+  end
+end
+
+
+
+
+
+function XIVBar:GetGeneralOptions()
+  return {
+    name = L['General'],
+    type = "group",
+    order = 3,
+    inline = true,
+    args = {
+      barPosition = {
+        name = L['Bar Position'],
+        type = "select",
+        order = 1,
+        values = {TOP = L['Top'], BOTTOM = L['Bottom']},
+        style = "dropdown",
+        get = function() return P.general.barPosition; end,
+        set = function(info, value) P.general.barPosition = value; self:Refresh(); end,
+      },
+      barColor = {
+        name = L['Bar Color'],
+        type = "color",
+        order = 2,
+        hasAlpha = true,
+        set = function(info, r, g, b, a)
+          XIVBar:SetColor('barColor', r, g, b, a)
+        end,
+        get = function() return XIVBar:GetColor('barColor') end
+      },
+    }
+  }
+end
+
+function XIVBar:GetTextOptions()
+  local t = self.LSM:List(self.LSM.MediaType.FONT);
+  local fontList = {};
+  for k,v in pairs(t) do
+    fontList[v] = v;
+  end
+  return {
+    name = L['Text'],
+    type = "group",
+    order = 3,
+    inline = true,
+    args = {
+      font = {
+        name = L['Font'],
+        type = "select",
+        order = 1,
+        values = fontList,
+        style = "dropdown",
+        get = function() return P.text.font; end,
+        set = function(info, val) P.text.font = val; self:Refresh(); end
+      },
+      fontSize = {
+        name = L['Font Size'],
+        type = 'range',
+        order = 2,
+        min = 10,
+        max = 20,
+        step = 1,
+        get = function() return P.text.fontSize; end,
+        set = function(info, val) P.text.fontSize = val; self:Refresh(); end
+      },
+      smallFontSize = {
+        name = L['Small Font Size'],
+        type = 'range',
+        order = 2,
+        min = 10,
+        max = 20,
+        step = 1,
+        get = function() return P.text.smallFontSize; end,
+        set = function(info, val) P.text.smallFontSize = val; self:Refresh(); end
+      },
+    }
+  }
+end
+
+function XIVBar:GetTextColorOptions()
+  return {
+    name = L['Text Colors'],
+    type = "group",
+    order = 3,
+    inline = true,
+    args = {
+      normal = {
+        name = L['Normal'],
+        type = "color",
+        order = 1,
+        width = "double",
+        hasAlpha = true,
+        set = function(info, r, g, b, a)
+          XIVBar:SetColor('normal', r, g, b, a)
+        end,
+        get = function() return XIVBar:GetColor('normal') end
+      }, -- normal
+      hoverCC = {
+        name = L['Use Class Colors for Hover'],
+        type = "toggle",
+        order = 2,
+        set = function(info, val) P.color.useCC = val; self:Refresh(); end,
+        get = function() return P.color.useCC end
+      }, -- normal
+      inactive = {
+        name = L['Inactive'],
+        type = "color",
+        order = 3,
+        hasAlpha = true,
+        width = "double",
+        set = function(info, r, g, b, a)
+          XIVBar:SetColor('inactive', r, g, b, a)
+        end,
+        get = function() return XIVBar:GetColor('inactive') end
+      }, -- normal
+      hover = {
+        name = L['Hover'],
+        type = "color",
+        order = 4,
+        hasAlpha = true,
+        set = function(info, r, g, b, a)
+          XIVBar:SetColor('hover', r, g, b, a)
+        end,
+        get = function() return XIVBar:GetColor('hover') end,
+        disabled = function() return P.color.useCC end
+      }, -- normal
+    }
+  }
+end
diff --git a/locales/enUS.lua b/locales/enUS.lua
index ac1b090..ee8810a 100644
--- a/locales/enUS.lua
+++ b/locales/enUS.lua
@@ -3,6 +3,38 @@ local AceLocale = LibStub:GetLibrary("AceLocale-3.0");
 local L = AceLocale:NewLocale(AddOnName, "enUS", true, true);
 if not L then return; end

-L['Test'] = true;
+L['General'] = true;
+L['Text'] = true;
+
 L['Profiles'] = true;
 L['Modules'] = true;
+
+-- General
+L['Bar Position'] = true;
+L['Top'] = true;
+L['Bottom'] = true;
+L['Bar Color'] = true;
+
+-- Media
+L['Font'] = true;
+L['Font Size'] = true;
+L['Small Font Size'] = true;
+
+-- Text Colors
+L['Text Colors'] = true;
+L['Normal'] = true;
+L['Inactive'] = true;
+L['Use Class Colors for Hover'] = true;
+L['Hover'] = true;
+
+
+
+
+-------------------- MODULES ---------------------------
+L['Test Module'] = true;
+
+L['Micromenu'] = true;
+
+
+------------ PROPER NOUNS - DO NOT LOCALIZE ------------
+L['Homizio Bold'] = true;
diff --git a/modules/load_modules.xml b/modules/load_modules.xml
new file mode 100644
index 0000000..0dfe101
--- /dev/null
+++ b/modules/load_modules.xml
@@ -0,0 +1,4 @@
+<Ui xmlns="http://www.blizzard.com/wow/ui/">
+  <Script file="test.lua" />
+  <Script file="micromenu.lua" />
+</Ui>
diff --git a/modules/micromenu.lua b/modules/micromenu.lua
index 54f23ae..f53be7f 100644
--- a/modules/micromenu.lua
+++ b/modules/micromenu.lua
@@ -1,371 +1,173 @@
-local addon, ns = ...
-local cfg = ns.cfg
-local unpack = unpack
---------------------------------------------------------------
-if not cfg.micromenu.show then return end
----------------------------------------------
--- GAME MENU
----------------------------------------------
+local AddOnName, Engine = ...;
+local _G = _G;
+local xb = Engine[1];
+local L = Engine[2];
+local P = {};

-PlayerFrame.name:SetFont("Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf", 11, "THINOUTLINE")
-TargetFrame.name:SetFont("Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf", 11, "THINOUTLINE")
+MenuModule = xb:NewModule("MenuModule")

-local isBeautiful = IsAddOnLoaded("Blizzard_RaidUI") --!Beautycase check
-
-if isBeautiful then
-	subframes.name:SetFont("Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf",11,"THINOUTLINE")
+function MenuModule:GetName()
+  return L['Micromenu'];
 end

+function MenuModule:OnInitialize()
+  P = xb.db.profile
+  self.mediaFolder = xb.constants.mediaPath..'microbar\\'
+  self.icons = {}
+  self.frames = {}
+end

-local gameMenuFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-gameMenuFrame:SetSize(32, 32)
-gameMenuFrame:SetPoint("LEFT",2,0)
-gameMenuFrame:EnableMouse(true)
-gameMenuFrame:RegisterForClicks("AnyUp")
-local gameMenuIcon = gameMenuFrame:CreateTexture(nil,"OVERLAY",nil,7)
-gameMenuIcon:SetPoint("CENTER")
-gameMenuIcon:SetTexture(cfg.mediaFolder.."microbar\\menu")
-gameMenuIcon:SetVertexColor(unpack(cfg.color.normal))
-
-gameMenuFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	gameMenuIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-gameMenuFrame:SetScript("OnLeave", function() gameMenuIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-gameMenuFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		ToggleFrame(GameMenuFrame)
-	elseif button == "RightButton" then
-		if IsShiftKeyDown() then ReloadUI()
-		elseif IsAltKeyDown() then
-			if cfg.useConfig then
-				--if cfg.SXconfigFrame:IsShown() then
-				ToggleFrame(cfg.SXconfigFrame)
-				--else
-				--ToggleFrame(cfg.SXconfigFrame)
-				--end
-			end
-		else ToggleFrame(AddonList) end
-	end
-end)
-
----------------------------------------------
--- CHARACTER FRAME
----------------------------------------------
-
-local characterFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-characterFrame:SetSize(32, 32)
-characterFrame:SetPoint("LEFT",174,0)
-characterFrame:EnableMouse(true)
-characterFrame:RegisterForClicks("AnyUp")
-local characterFrameIcon = characterFrame:CreateTexture(nil,"OVERLAY",nil,7)
-characterFrameIcon:SetAllPoints()
-characterFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\char")
-characterFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-characterFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	characterFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-characterFrame:SetScript("OnLeave", function() characterFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-characterFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		ToggleCharacter("PaperDollFrame")
-	end
-end)
-
----------------------------------------------
--- SPELLS
----------------------------------------------
-
-local spellFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-spellFrame:SetSize(32, 32)
-spellFrame:SetPoint("LEFT",characterFrame,"RIGHT",4,0)
-spellFrame:EnableMouse(true)
-spellFrame:RegisterForClicks("AnyUp")
-local spellFrameIcon = spellFrame:CreateTexture(nil,"OVERLAY",nil,7)
-spellFrameIcon:SetSize(32,32)
-spellFrameIcon:SetPoint("CENTER")
-spellFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\spell")
-spellFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-spellFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	spellFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-spellFrame:SetScript("OnLeave", function() spellFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-spellFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		ToggleFrame(SpellBookFrame)
-	end
-end)
-
----------------------------------------------
--- TALENT
----------------------------------------------
-
-local talentFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-talentFrame:SetSize(32, 32)
-talentFrame:SetPoint("LEFT",spellFrame,"RIGHT",4,0)
-talentFrame:EnableMouse(true)
-talentFrame:RegisterForClicks("AnyUp")
-local talentFrameIcon = talentFrame:CreateTexture(nil,"OVERLAY",nil,7)
-talentFrameIcon:SetSize(32,32)
-talentFrameIcon:SetPoint("CENTER")
-talentFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\talent")
-talentFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-talentFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	talentFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-talentFrame:SetScript("OnLeave", function() talentFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-talentFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		TalentMicroButton:Click()
-	end
-end)
-
----------------------------------------------
--- ACHIV
----------------------------------------------
-
-local achievementFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-achievementFrame:SetSize(32, 32)
-achievementFrame:SetPoint("LEFT",talentFrame,"RIGHT",4,0)
-achievementFrame:EnableMouse(true)
-achievementFrame:RegisterForClicks("AnyUp")
-local achievementFrameIcon = achievementFrame:CreateTexture(nil,"OVERLAY",nil,7)
-achievementFrameIcon:SetSize(32,32)
-achievementFrameIcon:SetPoint("CENTER")
-achievementFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\ach")
-achievementFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-achievementFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	achievementFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-achievementFrame:SetScript("OnLeave", function() achievementFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-achievementFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		securecall(ToggleAchievementFrame)
-	end
-end)
-
----------------------------------------------
--- QUEST
----------------------------------------------
-
-local questFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-questFrame:SetSize(32, 32)
-questFrame:SetPoint("LEFT",achievementFrame,"RIGHT",4,0)
-questFrame:EnableMouse(true)
-questFrame:RegisterForClicks("AnyUp")
-local questFrameIcon = questFrame:CreateTexture(nil,"OVERLAY",nil,7)
-questFrameIcon:SetSize(32,32)
-questFrameIcon:SetPoint("CENTER")
-questFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\quest")
-questFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-questFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	questFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-questFrame:SetScript("OnLeave", function() questFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-questFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		QuestLogMicroButton:Click()
-	end
-end)
-
----------------------------------------------
--- LFG
----------------------------------------------
-
-local lfgFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-lfgFrame:SetSize(32, 32)
-lfgFrame:SetPoint("LEFT",questFrame,"RIGHT",4,0)
-lfgFrame:EnableMouse(true)
-lfgFrame:RegisterForClicks("AnyUp")
-local lfgFrameIcon = lfgFrame:CreateTexture(nil,"OVERLAY",nil,7)
-lfgFrameIcon:SetSize(32,32)
-lfgFrameIcon:SetPoint("CENTER")
-lfgFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\lfg")
-lfgFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-lfgFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	lfgFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-lfgFrame:SetScript("OnLeave", function() lfgFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-lfgFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		securecall(PVEFrame_ToggleFrame, 'GroupFinderFrame')
-	end
-end)
-
----------------------------------------------
--- ADVENTURE GUIDE
----------------------------------------------
-
-local adventureFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-adventureFrame:SetSize(32, 32)
-adventureFrame:SetPoint("LEFT",lfgFrame,"RIGHT",4,0)
-adventureFrame:EnableMouse(true)
-adventureFrame:RegisterForClicks("AnyUp")
-local adventureFrameIcon = adventureFrame:CreateTexture(nil,"OVERLAY",nil,7)
-adventureFrameIcon:SetSize(32,32)
-adventureFrameIcon:SetPoint("CENTER")
-adventureFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\journal")
-adventureFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-adventureFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	adventureFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-adventureFrame:SetScript("OnLeave", function() adventureFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-adventureFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		EJMicroButton:Click()
-	end
-end)
-
----------------------------------------------
--- PvP
----------------------------------------------
-
-local pvpFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-pvpFrame:SetSize(32, 32)
-pvpFrame:SetPoint("LEFT",adventureFrame,"RIGHT",4,0)
-pvpFrame:EnableMouse(true)
-pvpFrame:RegisterForClicks("AnyUp")
-local pvpFrameIcon = pvpFrame:CreateTexture(nil,"OVERLAY",nil,7)
-pvpFrameIcon:SetSize(32,32)
-pvpFrameIcon:SetPoint("CENTER")
-pvpFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\pvp")
-pvpFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-pvpFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	pvpFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
-
-pvpFrame:SetScript("OnLeave", function() pvpFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
-
-pvpFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		securecall(PVEFrame_ToggleFrame, 'PVPUIFrame', HonorFrame)
-	end
-end)
+function MenuModule:OnEnable()
+  self.microMenuFrame = CreateFrame("FRAME", nil, xb:GetFrame('bar'))
+  xb:RegisterFrame('microMenuFrame', self.microMenuFrame)

----------------------------------------------
--- MOUNTS
----------------------------------------------
+  self:CreateFrames()
+  self:RegisterFrameEvents()
+  self:CreateIcons()
+  self:Refresh()
+end

-local mountFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-mountFrame:SetSize(32, 32)
-mountFrame:SetPoint("LEFT",pvpFrame,"RIGHT",4,0)
-mountFrame:EnableMouse(true)
-mountFrame:RegisterForClicks("AnyUp")
-local mountFrameIcon = mountFrame:CreateTexture(nil,"OVERLAY",nil,7)
-mountFrameIcon:SetSize(32,32)
-mountFrameIcon:SetPoint("CENTER")
-mountFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\pet")
-mountFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-mountFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	mountFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
+function MenuModule:OnDisable()
+end

-mountFrame:SetScript("OnLeave", function() mountFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+function MenuModule:Refresh()
+  if self.frames.menu == nil then return; end
+
+  self.iconSize = xb:GetHeight();
+
+  local colors = P.color
+  local totalWidth = 0;
+  for name, frame in pairs(self.frames) do
+    self:IconDefaults(name)
+    totalWidth = totalWidth + frame:GetWidth() + 2
+    if name == 'menu' then
+      frame:SetPoint("LEFT", 2, 0)
+    else
+      frame:SetPoint("LEFT", frame:GetParent(), "RIGHT", 2, 0)
+    end
+  end
+  self.microMenuFrame:SetPoint("LEFT")
+  self.microMenuFrame:SetSize(totalWidth, xb:GetHeight())
+end

-mountFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		securecall(ToggleCollectionsJournal, 1)
-	end
-end)
+function MenuModule:CreateFrames()
+  self.frames.menu = CreateFrame("BUTTON", nil, xb:GetFrame('microMenuFrame'))
+
+  self.frames.socialParent = CreateFrame("FRAME", nil, self.frames.menu)
+  self.frames.chat = CreateFrame("BUTTON", nil, self.frames.socialParent)
+  self.frames.guild = CreateFrame("BUTTON", nil, self.frames.chat)
+  self.frames.social = CreateFrame("BUTTON", nil, self.frames.guild)
+
+  self.frames.microbar = CreateFrame("FRAME", nil, self.frames.social)
+  self.frames.char = CreateFrame("BUTTON", nil, self.frames.microbar)
+  self.frames.spell = CreateFrame("BUTTON", nil, self.frames.char)
+  self.frames.talent = CreateFrame("BUTTON", nil, self.frames.spell)
+  self.frames.ach = CreateFrame("BUTTON", nil, self.frames.talent)
+  self.frames.quest = CreateFrame("BUTTON", nil, self.frames.ach)
+  self.frames.lfg = CreateFrame("BUTTON", nil, self.frames.quest)
+  self.frames.journal = CreateFrame("BUTTON", nil, self.frames.lfg)
+  self.frames.pvp = CreateFrame("BUTTON", nil, self.frames.journal)
+  self.frames.pet = CreateFrame("BUTTON", nil, self.frames.pvp)
+  self.frames.shop = CreateFrame("BUTTON", nil, self.frames.pet)
+  self.frames.help = CreateFrame("BUTTON", nil, self.frames.shop)
+end

----------------------------------------------
--- SHOP
----------------------------------------------
+function MenuModule:CreateIcons()
+  for name, frame in pairs(self.frames) do
+    if frame['Click'] ~= nil then --Odd way of checking if it's a button
+      self.icons[name] = frame:CreateTexture(nil, "OVERLAY")
+      self.icons[name]:SetTexture(self.mediaFolder..name)
+    end
+  end
+end

-local shopFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-shopFrame:SetSize(32, 32)
-shopFrame:SetPoint("LEFT",mountFrame,"RIGHT",4,0)
-shopFrame:EnableMouse(true)
-shopFrame:RegisterForClicks("AnyUp")
-local shopFrameIcon = shopFrame:CreateTexture(nil,"OVERLAY",nil,7)
-shopFrameIcon:SetSize(32,32)
-shopFrameIcon:SetPoint("CENTER")
-shopFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\shop")
-shopFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-shopFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	shopFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
+function MenuModule:IconDefaults(name)
+  local colors = P.color
+  if self.frames[name] == nil then return; end
+  if self.frames[name]['Click'] ~= nil then
+    self.frames[name]:SetSize(self.iconSize, self.iconSize)
+  else
+    self.frames[name]:SetSize(floor(self.iconSize / 3), self.iconSize)
+  end
+
+  if self.icons[name] == nil then return; end
+  self.icons[name]:SetPoint('CENTER')
+  self.icons[name]:SetSize(self.iconSize, self.iconSize)
+  self.icons[name]:SetVertexColor(colors.normal.r, colors.normal.g, colors.normal.b, colors.normal.a)
+end

-shopFrame:SetScript("OnLeave", function() shopFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+function MenuModule:RegisterFrameEvents()
+  for name, frame in pairs(self.frames) do
+    frame:EnableMouse(true)
+
+    if frame['Click'] ~= nil then
+      frame:RegisterForClicks("AnyUp")
+    end
+    frame:SetScript("OnEnter", self:DefaultHover(name))
+    frame:SetScript("OnLeave", self:DefaultLeave(name))
+  end
+  self.frames.menu:SetScript('OnClick', self:MainMenuClick())
+end

-shopFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		StoreMicroButton:Click()
-	end
-end)
+function MenuModule:DefaultHover(name)
+  return function()
+    if InCombatLockdown() then return; end
+    if self.icons[name] ~= nil then
+      self.icons[name]:SetVertexColor(unpack(xb:HoverColors()))
+    end
+  end
+end

----------------------------------------------
--- HELP
----------------------------------------------
+function MenuModule:DefaultLeave(name)
+  return function()
+    if InCombatLockdown() then return; end
+    if self.icons[name] ~= nil then
+      self.icons[name]:SetVertexColor(P.color.normal.r, P.color.normal.g, P.color.normal.b, P.color.normal.a)
+    end
+  end
+end

-local helpFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
-helpFrame:SetSize(32, 32)
-helpFrame:SetPoint("LEFT",shopFrame,"RIGHT",4,0)
-helpFrame:EnableMouse(true)
-helpFrame:RegisterForClicks("AnyUp")
-local helpFrameIcon = helpFrame:CreateTexture(nil,"OVERLAY",nil,7)
-helpFrameIcon:SetSize(32,32)
-helpFrameIcon:SetPoint("CENTER")
-helpFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\help")
-helpFrameIcon:SetVertexColor(unpack(cfg.color.normal))
-
-helpFrame:SetScript("OnEnter", function()
-	if InCombatLockdown() then return end
-	helpFrameIcon:SetVertexColor(unpack(cfg.color.hover))
-end)
+function MenuModule:MainMenuClick()
+  return function(self, button, down)
+    if InCombatLockdown() then return; end
+  	if button == "LeftButton" then
+  		ToggleFrame(GameMenuFrame)
+  	elseif button == "RightButton" then
+  		if IsShiftKeyDown() then
+        ReloadUI()
+  		else
+        ToggleFrame(AddonList)
+      end
+  	end
+  end
+end

-helpFrame:SetScript("OnLeave", function() helpFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+function MenuModule:GetDefaultOptions()
+  return 'microMenu', {
+      enabled = true,
+      showTooltips = true
+    }
+end

-helpFrame:SetScript("OnClick", function(self, button, down)
-	if InCombatLockdown() then return end
-	if button == "LeftButton" then
-		securecall(ToggleHelpFrame)
-	end
-end)
\ No newline at end of file
+function MenuModule:GetConfig()
+  return {
+    name = self:GetName(),
+    type = "group",
+    args = {
+      enable = {
+        name = L['Enabled'],
+        order = 0,
+        type = "toggle",
+        get = function() return P.modules.microMenu.enabled; end,
+        set = function(_, val) P.modules.microMenu.enabled = val; end
+      },
+      showTooltips = {
+        name = L['Show Social Tooltips'],
+        order = 0,
+        type = "toggle",
+        get = function() return P.modules.microMenu.showTooltips; end,
+        set = function(_, val) P.modules.microMenu.showTooltips = val; end
+      }
+    }
+  }
+end
diff --git a/modules/old/micromenu.lua b/modules/old/micromenu.lua
new file mode 100644
index 0000000..96d762a
--- /dev/null
+++ b/modules/old/micromenu.lua
@@ -0,0 +1,371 @@
+local addon, ns = ...
+local cfg = ns.cfg
+local unpack = unpack
+--------------------------------------------------------------
+if not cfg.micromenu.show then return end
+---------------------------------------------
+-- GAME MENU
+---------------------------------------------
+
+PlayerFrame.name:SetFont("Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf", 11, "THINOUTLINE")
+TargetFrame.name:SetFont("Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf", 11, "THINOUTLINE")
+
+local isBeautiful = IsAddOnLoaded("Blizzard_RaidUI") --!Beautycase check
+
+if isBeautiful then
+	subframes.name:SetFont("Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf",11,"THINOUTLINE")
+end
+
+
+local gameMenuFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+gameMenuFrame:SetSize(32, 32)
+gameMenuFrame:SetPoint("LEFT",2,0)
+gameMenuFrame:EnableMouse(true)
+gameMenuFrame:RegisterForClicks("AnyUp")
+local gameMenuIcon = gameMenuFrame:CreateTexture(nil,"OVERLAY",nil,7)
+gameMenuIcon:SetPoint("CENTER")
+gameMenuIcon:SetTexture(cfg.mediaFolder.."microbar\\menu")
+gameMenuIcon:SetVertexColor(unpack(cfg.color.normal))
+
+gameMenuFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	gameMenuIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+gameMenuFrame:SetScript("OnLeave", function() gameMenuIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+gameMenuFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		ToggleFrame(GameMenuFrame)
+	elseif button == "RightButton" then
+		if IsShiftKeyDown() then ReloadUI()
+		elseif IsAltKeyDown() then
+			if cfg.useConfig then
+				--if cfg.SXconfigFrame:IsShown() then
+				ToggleFrame(cfg.SXconfigFrame)
+				--else
+				--ToggleFrame(cfg.SXconfigFrame)
+				--end
+			end
+		else ToggleFrame(AddonList) end
+	end
+end)
+
+---------------------------------------------
+-- CHARACTER FRAME
+---------------------------------------------
+
+local characterFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+characterFrame:SetSize(32, 32)
+characterFrame:SetPoint("LEFT",174,0)
+characterFrame:EnableMouse(true)
+characterFrame:RegisterForClicks("AnyUp")
+local characterFrameIcon = characterFrame:CreateTexture(nil,"OVERLAY",nil,7)
+characterFrameIcon:SetAllPoints()
+characterFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\char")
+characterFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+characterFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	characterFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+characterFrame:SetScript("OnLeave", function() characterFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+characterFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		ToggleCharacter("PaperDollFrame")
+	end
+end)
+
+---------------------------------------------
+-- SPELLS
+---------------------------------------------
+
+local spellFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+spellFrame:SetSize(32, 32)
+spellFrame:SetPoint("LEFT",characterFrame,"RIGHT",4,0)
+spellFrame:EnableMouse(true)
+spellFrame:RegisterForClicks("AnyUp")
+local spellFrameIcon = spellFrame:CreateTexture(nil,"OVERLAY",nil,7)
+spellFrameIcon:SetSize(32,32)
+spellFrameIcon:SetPoint("CENTER")
+spellFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\spell")
+spellFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+spellFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	spellFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+spellFrame:SetScript("OnLeave", function() spellFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+spellFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		ToggleFrame(SpellBookFrame)
+	end
+end)
+
+---------------------------------------------
+-- TALENT
+---------------------------------------------
+
+local talentFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+talentFrame:SetSize(32, 32)
+talentFrame:SetPoint("LEFT",spellFrame,"RIGHT",4,0)
+talentFrame:EnableMouse(true)
+talentFrame:RegisterForClicks("AnyUp")
+local talentFrameIcon = talentFrame:CreateTexture(nil,"OVERLAY",nil,7)
+talentFrameIcon:SetSize(32,32)
+talentFrameIcon:SetPoint("CENTER")
+talentFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\talent")
+talentFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+talentFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	talentFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+talentFrame:SetScript("OnLeave", function() talentFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+talentFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		TalentMicroButton:Click()
+	end
+end)
+
+---------------------------------------------
+-- ACHIV
+---------------------------------------------
+
+local achievementFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+achievementFrame:SetSize(32, 32)
+achievementFrame:SetPoint("LEFT",talentFrame,"RIGHT",4,0)
+achievementFrame:EnableMouse(true)
+achievementFrame:RegisterForClicks("AnyUp")
+local achievementFrameIcon = achievementFrame:CreateTexture(nil,"OVERLAY",nil,7)
+achievementFrameIcon:SetSize(32,32)
+achievementFrameIcon:SetPoint("CENTER")
+achievementFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\ach")
+achievementFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+achievementFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	achievementFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+achievementFrame:SetScript("OnLeave", function() achievementFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+achievementFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		securecall(ToggleAchievementFrame)
+	end
+end)
+
+---------------------------------------------
+-- QUEST
+---------------------------------------------
+
+local questFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+questFrame:SetSize(32, 32)
+questFrame:SetPoint("LEFT",achievementFrame,"RIGHT",4,0)
+questFrame:EnableMouse(true)
+questFrame:RegisterForClicks("AnyUp")
+local questFrameIcon = questFrame:CreateTexture(nil,"OVERLAY",nil,7)
+questFrameIcon:SetSize(32,32)
+questFrameIcon:SetPoint("CENTER")
+questFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\quest")
+questFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+questFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	questFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+questFrame:SetScript("OnLeave", function() questFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+questFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		QuestLogMicroButton:Click()
+	end
+end)
+
+---------------------------------------------
+-- LFG
+---------------------------------------------
+
+local lfgFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+lfgFrame:SetSize(32, 32)
+lfgFrame:SetPoint("LEFT",questFrame,"RIGHT",4,0)
+lfgFrame:EnableMouse(true)
+lfgFrame:RegisterForClicks("AnyUp")
+local lfgFrameIcon = lfgFrame:CreateTexture(nil,"OVERLAY",nil,7)
+lfgFrameIcon:SetSize(32,32)
+lfgFrameIcon:SetPoint("CENTER")
+lfgFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\lfg")
+lfgFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+lfgFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	lfgFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+lfgFrame:SetScript("OnLeave", function() lfgFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+lfgFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		securecall(PVEFrame_ToggleFrame, 'GroupFinderFrame')
+	end
+end)
+
+---------------------------------------------
+-- ADVENTURE GUIDE
+---------------------------------------------
+
+local adventureFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+adventureFrame:SetSize(32, 32)
+adventureFrame:SetPoint("LEFT",lfgFrame,"RIGHT",4,0)
+adventureFrame:EnableMouse(true)
+adventureFrame:RegisterForClicks("AnyUp")
+local adventureFrameIcon = adventureFrame:CreateTexture(nil,"OVERLAY",nil,7)
+adventureFrameIcon:SetSize(32,32)
+adventureFrameIcon:SetPoint("CENTER")
+adventureFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\journal")
+adventureFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+adventureFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	adventureFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+adventureFrame:SetScript("OnLeave", function() adventureFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+adventureFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		EJMicroButton:Click()
+	end
+end)
+
+---------------------------------------------
+-- PvP
+---------------------------------------------
+
+local pvpFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+pvpFrame:SetSize(32, 32)
+pvpFrame:SetPoint("LEFT",adventureFrame,"RIGHT",4,0)
+pvpFrame:EnableMouse(true)
+pvpFrame:RegisterForClicks("AnyUp")
+local pvpFrameIcon = pvpFrame:CreateTexture(nil,"OVERLAY",nil,7)
+pvpFrameIcon:SetSize(32,32)
+pvpFrameIcon:SetPoint("CENTER")
+pvpFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\pvp")
+pvpFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+pvpFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	pvpFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+pvpFrame:SetScript("OnLeave", function() pvpFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+pvpFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		securecall(PVEFrame_ToggleFrame, 'PVPUIFrame', HonorFrame)
+	end
+end)
+
+---------------------------------------------
+-- MOUNTS
+---------------------------------------------
+
+local mountFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+mountFrame:SetSize(32, 32)
+mountFrame:SetPoint("LEFT",pvpFrame,"RIGHT",4,0)
+mountFrame:EnableMouse(true)
+mountFrame:RegisterForClicks("AnyUp")
+local mountFrameIcon = mountFrame:CreateTexture(nil,"OVERLAY",nil,7)
+mountFrameIcon:SetSize(32,32)
+mountFrameIcon:SetPoint("CENTER")
+mountFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\pet")
+mountFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+mountFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	mountFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+mountFrame:SetScript("OnLeave", function() mountFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+mountFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		securecall(ToggleCollectionsJournal, 1)
+	end
+end)
+
+---------------------------------------------
+-- SHOP
+---------------------------------------------
+
+local shopFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+shopFrame:SetSize(32, 32)
+shopFrame:SetPoint("LEFT",mountFrame,"RIGHT",4,0)
+shopFrame:EnableMouse(true)
+shopFrame:RegisterForClicks("AnyUp")
+local shopFrameIcon = shopFrame:CreateTexture(nil,"OVERLAY",nil,7)
+shopFrameIcon:SetSize(32,32)
+shopFrameIcon:SetPoint("CENTER")
+shopFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\shop")
+shopFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+shopFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	shopFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+shopFrame:SetScript("OnLeave", function() shopFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+shopFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		StoreMicroButton:Click()
+	end
+end)
+
+---------------------------------------------
+-- HELP
+---------------------------------------------
+
+local helpFrame = CreateFrame("BUTTON",nil, cfg.SXframe)
+helpFrame:SetSize(32, 32)
+helpFrame:SetPoint("LEFT",shopFrame,"RIGHT",4,0)
+helpFrame:EnableMouse(true)
+helpFrame:RegisterForClicks("AnyUp")
+local helpFrameIcon = helpFrame:CreateTexture(nil,"OVERLAY",nil,7)
+helpFrameIcon:SetSize(32,32)
+helpFrameIcon:SetPoint("CENTER")
+helpFrameIcon:SetTexture(cfg.mediaFolder.."microbar\\help")
+helpFrameIcon:SetVertexColor(unpack(cfg.color.normal))
+
+helpFrame:SetScript("OnEnter", function()
+	if InCombatLockdown() then return end
+	helpFrameIcon:SetVertexColor(unpack(cfg.color.hover))
+end)
+
+helpFrame:SetScript("OnLeave", function() helpFrameIcon:SetVertexColor(unpack(cfg.color.normal)) end)
+
+helpFrame:SetScript("OnClick", function(self, button, down)
+	if InCombatLockdown() then return end
+	if button == "LeftButton" then
+		securecall(ToggleHelpFrame)
+	end
+end)
diff --git a/modules/test.lua b/modules/test.lua
new file mode 100644
index 0000000..3bd7bbf
--- /dev/null
+++ b/modules/test.lua
@@ -0,0 +1,48 @@
+local AddOnName, Engine = ...;
+local _G = _G;
+local xb = Engine[1];
+local L = Engine[2];
+local P = {};
+
+TestModule = xb:NewModule("TestModule")
+
+function TestModule:GetName()
+  return L['Test Module'];
+end
+
+function TestModule:OnInitialize()
+  P = xb.db.profile
+end
+
+function TestModule:OnEnable()
+  xb:RegisterFrame('testModuleFrame', CreateFrame("FRAME", nil, xb:GetFrame('bar')))
+  self:Refresh()
+end
+
+function TestModule:OnDisable()
+end
+
+function TestModule:Refresh()
+end
+
+function TestModule:GetDefaultOptions()
+  return 'testModule', {
+      enabled = true
+    }
+end
+
+function TestModule:GetConfig()
+  return {
+    name = self:GetName(),
+    type = "group",
+    args = {
+      enable = {
+        name = L['Enabled'],
+        order = 0,
+        type = "toggle",
+        get = function() return P.modules.testModule.enabled; end,
+        set = function(_, val) P.modules.testModule.enabled = val; end
+      }
+    }
+  }
+end