From 9cea8279c61d6ebe7dc09822dfa9f227ba252353 Mon Sep 17 00:00:00 2001 From: Repooc Date: Sat, 23 Mar 2013 13:48:55 -0400 Subject: [PATCH] Automatically Hide Coords on pet battle, Added options for hiding S&L DT Panels during combat, Hide is on by default. --- ElvUI_SLE/config/profile.lua | 8 ++++++++ ElvUI_SLE/locales/english.lua | 2 +- ElvUI_SLE/modules/datatexts/add_panels.lua | 12 ++++++++++++ ElvUI_SLE/modules/datatexts/options.lua | 7 +++++++ ElvUI_SLE/modules/minimap/minimapcoords.lua | 1 + 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua index c88758d..1c40d81 100755 --- a/ElvUI_SLE/config/profile.lua +++ b/ElvUI_SLE/config/profile.lua @@ -85,34 +85,42 @@ P['sle'] = { ['dp1'] = { ['enabled'] = false, ['width'] = E.screenwidth/5, + ['pethide'] = true, }, ['dp2'] = { ['enabled'] = false, ['width'] = E.screenwidth/5, + ['pethide'] = true, }, ['top'] = { ['enabled'] = true, ['width'] = E.screenwidth/5 - 4, + ['pethide'] = true, }, ['dp3'] = { ['enabled'] = false, ['width'] = E.screenwidth/5, + ['pethide'] = true, }, ['dp4'] = { ['enabled'] = false, ['width'] = E.screenwidth/5, + ['pethide'] = true, }, ['dp5'] = { ['enabled'] = false, ['width'] = E.screenwidth/4 - 60, + ['pethide'] = true, }, ['bottom'] = { ['enabled'] = false, ['width'] = E.screenwidth/10 - 4, + ['pethide'] = true, }, ['dp6'] = { ['enabled'] = false, ['width'] = E.screenwidth/4 - 60, + ['pethide'] = true, }, ['chatleft'] = { ['enabled'] = true, diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua index 9eda664..ca717e6 100755 --- a/ElvUI_SLE/locales/english.lua +++ b/ElvUI_SLE/locales/english.lua @@ -61,7 +61,7 @@ L["Set the texture to use in this frame. Requirements are the same as the chat L["Backdrop Template"] = true L["Change the template used for this backdrop."] = true L["Default"] = true -L["Hide in Pet Batlle"] = true +L["Hide in Pet Battle"] = true L["Show/Hide this frame during Pet Battles."] = true --Character Frame Options diff --git a/ElvUI_SLE/modules/datatexts/add_panels.lua b/ElvUI_SLE/modules/datatexts/add_panels.lua index b2fc216..9093d10 100755 --- a/ElvUI_SLE/modules/datatexts/add_panels.lua +++ b/ElvUI_SLE/modules/datatexts/add_panels.lua @@ -82,9 +82,21 @@ function DTP:Update() DTP:Resize() end +function DTP:RegisterHide() + local db = E.db.sle.datatext + for k,v in pairs(panels) do + if db[v[1]].pethide then + E.FrameLocks[k] = true + else + E.FrameLocks[k] = nil + end + end +end + --Renew panels after loading screens function DTP:PLAYER_ENTERING_WORLD(...) DTP:ExtraDataBarSetup() +DTP:RegisterHide() self:UnregisterEvent("PLAYER_ENTERING_WORLD"); end DTP:RegisterEvent('PLAYER_ENTERING_WORLD') diff --git a/ElvUI_SLE/modules/datatexts/options.lua b/ElvUI_SLE/modules/datatexts/options.lua index aae85f0..d8ac571 100755 --- a/ElvUI_SLE/modules/datatexts/options.lua +++ b/ElvUI_SLE/modules/datatexts/options.lua @@ -111,6 +111,13 @@ E.Options.args.sle.args.datatext.args[v[1]] = { --get = function(info) return E.db.sle.datatext[v[1]]."transparent"] end, set = function(info, value) E.db.sle.datatext[v[1]].transparent = value; DTP:ExtraDataBarSetup() end, }, + pethide = { + order = 5, + name = L['Hide in Pet Battle'], + type = 'toggle', + desc = L['Show/Hide this frame during Pet Battles.'], + set = function(info, value) E.db.sle.datatext[v[1]].pethide = value; DTP:RegisterHide() end, + }, }, } end diff --git a/ElvUI_SLE/modules/minimap/minimapcoords.lua b/ElvUI_SLE/modules/minimap/minimapcoords.lua index fa5a0a6..fa94a4a 100755 --- a/ElvUI_SLE/modules/minimap/minimapcoords.lua +++ b/ElvUI_SLE/modules/minimap/minimapcoords.lua @@ -37,6 +37,7 @@ local function CreateCoordsFrame(middle) panel:SetFrameStrata("MEDIUM") panel:Point("CENTER", Minimap, "CENTER", 0, 0) panel:Size(E.MinimapSize, 22) + E.FrameLocks['CoordsPanel'] = true; xpos = CreateFrame('Frame', "MapCoordinatesX", panel) xpos:Size(40, 22) -- 1.7.9.5