From ac98bb3ee2830a0dad5559f5b126b335a879924f Mon Sep 17 00:00:00 2001 From: Repooc Date: Tue, 4 Mar 2014 05:30:40 -0500 Subject: [PATCH] Pethide the minimap bar during petbattles --- ElvUI_SLE/config/profile.lua | 1 + ElvUI_SLE/modules/minimap/minimapicons.lua | 12 ++++++++++++ ElvUI_SLE/modules/minimap/options.lua | 18 +++++++++++++----- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua index 1512739..f1031e6 100755 --- a/ElvUI_SLE/config/profile.lua +++ b/ElvUI_SLE/config/profile.lua @@ -222,6 +222,7 @@ P['sle'] = { ['iconmouseover'] = false, ['iconsize'] = 27, ['iconperrow'] = 12, + ['pethide'] = false, ['skindungeon'] = false, }, }, diff --git a/ElvUI_SLE/modules/minimap/minimapicons.lua b/ElvUI_SLE/modules/minimap/minimapicons.lua index b9d5f4f..a180995 100755 --- a/ElvUI_SLE/modules/minimap/minimapicons.lua +++ b/ElvUI_SLE/modules/minimap/minimapicons.lua @@ -351,4 +351,16 @@ SquareMinimapButtonBar:SetScript('OnEvent', function(self, event, addon) OnLeave(self) end) +function SMB:RegisterHide() + if E.db.sle.minimap.mapicons.pethide then + E.FrameLocks["SquareMinimapButtonBar"] = true + else + E.FrameLocks["SquareMinimapButtonBar"] = nil + end +end + +function SMB:Initialize() + SMB:RegisterHide() +end + E:RegisterModule(SMB:GetName()) \ No newline at end of file diff --git a/ElvUI_SLE/modules/minimap/options.lua b/ElvUI_SLE/modules/minimap/options.lua index a752b5e..092a71b 100755 --- a/ElvUI_SLE/modules/minimap/options.lua +++ b/ElvUI_SLE/modules/minimap/options.lua @@ -81,9 +81,17 @@ local function configTable() get = function(info) return E.private.sle.minimap.mapicons.enable end, set = function(info, value) E.private.sle.minimap.mapicons.enable = value; E:StaticPopup_Show("PRIVATE_RL") end, }, - skindungeon = { + pethide = { order = 2, type = 'toggle', + name = L['Hide Pet Battles'], + desc = L['Enable/Disable Square Minimap Bar During Pet Battles.'], + get = function(info) return E.db.sle.minimap.mapicons.pethide end, + set = function(info, value) E.db.sle.minimap.mapicons.pethide = value; E:GetModule('SquareMinimapButtons'):RegisterHide() end, + }, + skindungeon = { + order = 3, + type = 'toggle', name = L['Skin Dungeon'], desc = L['Skin dungeon icon.'], get = function(info) return E.db.sle.minimap.mapicons.skindungeon end, @@ -91,7 +99,7 @@ local function configTable() disabled = function() return not E.private.sle.minimap.mapicons.enable end, }, skinmail = { - order = 3, + order = 4, type = 'toggle', name = L['Skin Mail'], desc = L['Skin mail icon.'], @@ -100,7 +108,7 @@ local function configTable() disabled = function() return not E.private.sle.minimap.mapicons.enable end, }, iconsize = { - order = 4, + order = 5, type = 'range', name = L['Button Size'], desc = L['The size of the minimap buttons when not anchored to the minimap.'], @@ -110,7 +118,7 @@ local function configTable() disabled = function() return not E.private.sle.minimap.mapicons.enable end, }, iconperrow = { - order = 5, + order = 6, type = 'range', name = L['Icons Per Row'], desc = L['Anchor mode for displaying the minimap buttons are skinned.'], @@ -120,7 +128,7 @@ local function configTable() disabled = function() return not E.private.sle.minimap.mapicons.enable end, }, iconmouseover = { - order = 6, + order = 7, name = L['Mouse Over'], desc = L['Show minimap buttons on mouseover.'], type = "toggle", -- 1.7.9.5