From 71ee45f1febaf75613627d40efa32357314d0881 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Wed, 18 Mar 2015 17:58:28 +0400 Subject: [PATCH] Raid Marker custom visibility. Cause why not --- ElvUI_SLE/defaults/profile.lua | 1 + ElvUI_SLE/modules/raidmarkers.lua | 2 +- ElvUI_SLE/options/raidmarkers_c.lua | 42 +++++++++++++++++++++-------------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua index 011136f..c415c54 100644 --- a/ElvUI_SLE/defaults/profile.lua +++ b/ElvUI_SLE/defaults/profile.lua @@ -388,6 +388,7 @@ P['sle'] = { ['raidmarkers'] = { ['enable'] = true, ['visibility'] = 'DEFAULT', + ['customVisibility'] = "[noexists, nogroup] hide; show", ['backdrop'] = false, ['buttonSize'] = 22, ['spacing'] = 2, diff --git a/ElvUI_SLE/modules/raidmarkers.lua b/ElvUI_SLE/modules/raidmarkers.lua index cf69cb2..d1fc765 100644 --- a/ElvUI_SLE/modules/raidmarkers.lua +++ b/ElvUI_SLE/modules/raidmarkers.lua @@ -140,7 +140,7 @@ end function RM:ToggleSettings() if self.db.enable then - RegisterStateDriver(self.frame, "visibility", self.db.visibility == 'DEFAULT' and '[noexists, nogroup] hide; show' or self.db.visibility == 'ALWAYS' and '[petbattle] hide; show' or '[group] show; [petbattle] hide; hide') + RegisterStateDriver(self.frame, "visibility", self.db.visibility == 'DEFAULT' and '[noexists, nogroup] hide; show' or self.db.visibility == 'ALWAYS' and '[petbattle] hide; show' or self.db.visibility == 'CUSTOM' and self.db.customVisibility or '[group] show; [petbattle] hide; hide') else UnregisterStateDriver(self.frame, "visibility") self.frame:Hide() diff --git a/ElvUI_SLE/options/raidmarkers_c.lua b/ElvUI_SLE/options/raidmarkers_c.lua index 40e706f..18ba65b 100644 --- a/ElvUI_SLE/options/raidmarkers_c.lua +++ b/ElvUI_SLE/options/raidmarkers_c.lua @@ -38,39 +38,28 @@ local function configTable() type = 'description', name = "", }, - visibility = { - type = 'select', - order = 6, - name = L["Visibility"], - disabled = function() return not E.db.sle.raidmarkers.enable end, - values = { - DEFAULT = L['Default'], - INPARTY = AGGRO_WARNING_IN_PARTY, - ALWAYS = L['Always Display'], - }, - }, backdrop = { type = 'toggle', - order = 7, + order = 6, name = L["Backdrop"], disabled = function() return not E.db.sle.raidmarkers.enable end, }, buttonSize = { - order = 8, + order = 7, type = 'range', name = L['Button Size'], min = 16, max = 40, step = 1, disabled = function() return not E.db.sle.raidmarkers.enable end, }, spacing = { - order = 9, + order = 8, type = 'range', name = L["Button Spacing"], min = 0, max = 10, step = 1, disabled = function() return not E.db.sle.raidmarkers.enable end, }, orientation = { - order = 10, + order = 9, type = 'select', name = L['Orientation'], disabled = function() return not E.db.sle.raidmarkers.enable end, @@ -81,12 +70,12 @@ local function configTable() }, reverse = { type = 'toggle', - order = 11, + order = 10, name = L["Reverse"], disabled = function() return not E.db.sle.raidmarkers.enable end, }, modifier = { - order = 12, + order = 11, type = 'select', name = L['Modifier Key'], desc = L['Set the modifier key for placing world markers.'], @@ -97,6 +86,25 @@ local function configTable() ['alt-'] = ALT_KEY, }, }, + visibility = { + type = 'select', + order = 12, + name = L["Visibility"], + disabled = function() return not E.db.sle.raidmarkers.enable end, + values = { + DEFAULT = L['Default'], + INPARTY = AGGRO_WARNING_IN_PARTY, + ALWAYS = L['Always Display'], + CUSTOM = L["Custom"], + }, + }, + customVisibility = { + order = 13, + type = 'input', + width = 'full', + name = L["Visibility State"], + disabled = function() return E.db.sle.raidmarkers.visibility ~= "CUSTOM" or not E.db.sle.raidmarkers.enable end, + }, }, } end -- 1.7.9.5