Quantcast

Pethide the minimap bar during petbattles

Repooc [03-04-14 - 10:30]
Pethide the minimap bar during petbattles
Filename
ElvUI_SLE/config/profile.lua
ElvUI_SLE/modules/minimap/minimapicons.lua
ElvUI_SLE/modules/minimap/options.lua
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",