From 8aa0e266047621dd2b9ea6a13867aed29eece33f Mon Sep 17 00:00:00 2001 From: Repooc Date: Mon, 22 Oct 2012 14:38:36 -0500 Subject: [PATCH] Show Raid Marker module only in instance option. Signed-off-by: Repooc --- ElvUI_SLE/config/profile.lua | 1 + ElvUI_SLE/modules/marks/marks.lua | 13 +++++++++++-- ElvUI_SLE/modules/marks/options.lua | 12 ++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua index f5b5a93..0bc6f59 100644 --- a/ElvUI_SLE/config/profile.lua +++ b/ElvUI_SLE/config/profile.lua @@ -49,6 +49,7 @@ P['sle'] = { ['marks'] = { ['enabled'] = true, ['growth'] = "RIGHT", + ['showinside'] = false, ['size'] = 18, }, diff --git a/ElvUI_SLE/modules/marks/marks.lua b/ElvUI_SLE/modules/marks/marks.lua index 336a27c..fc67c9d 100644 --- a/ElvUI_SLE/modules/marks/marks.lua +++ b/ElvUI_SLE/modules/marks/marks.lua @@ -185,8 +185,16 @@ end --Visibility/enable check function RM:UpdateVisibility() + local inInstance, instanceType = IsInInstance() + if E.db.sle.marks.enabled then - mark_menu:Show() + if inInstance and E.db.sle.marks.showinside then + mark_menu:Show() + elseif not inInstance and E.db.sle.marks.showinside then + mark_menu:Hide() + elseif not E.db.sle.marks.showinside then + mark_menu:Show() + end else mark_menu:Hide() end @@ -198,7 +206,8 @@ function RM:Initialize() RM:FrameButtonsGrowth() RM:SetButtonAttributes() RM:UpdateVisibility() - + self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateVisibility"); + E:CreateMover(mark_menu, "MarkMover", "RM", nil, nil, nil, "ALL,S&L") end diff --git a/ElvUI_SLE/modules/marks/options.lua b/ElvUI_SLE/modules/marks/options.lua index 46430d5..6aa0cab 100644 --- a/ElvUI_SLE/modules/marks/options.lua +++ b/ElvUI_SLE/modules/marks/options.lua @@ -20,8 +20,16 @@ E.Options.args.sle.args.marks = { get = function(info) return E.db.sle.marks.enabled end, set = function(info, value) E.db.sle.marks.enabled = value; RM:UpdateVisibility() end }, - size = { + showinside = { order = 3, + type = "toggle", + name = "Show in an instance only.", + desc = "Selecting this option will have the Raid Markers appear only while in a raid or dungeon.", + get = function(info) return E.db.sle.marks.showinside end, + set = function(info, value) E.db.sle.marks.showinside = value; RM:UpdateVisibility() end + }, + size = { + order = 4, type = "range", name = L['Size'], desc = L["Sets size of buttons"], @@ -30,7 +38,7 @@ E.Options.args.sle.args.marks = { set = function(info, value) E.db.sle.marks.size = value; RM:FrameButtonsGrowth(); RM:FrameButtonsSize() end, }, growth = { - order = 4, + order = 5, type = "select", name = L["Direction"], desc = L["Change the direction of buttons growth from the skull marker"], -- 1.7.9.5