From 7e4cafae2ec91358d3139853b783bdb99c924d74 Mon Sep 17 00:00:00 2001 From: Logan Payton Date: Fri, 18 May 2018 01:04:02 -0400 Subject: [PATCH] Show aura config on player without throwing errors --- ElvUI/Settings/Global.lua | 5 + ElvUI_Config/UnitFrames.lua | 195 ++++++++++++++++++------------------ 2 files changed, 102 insertions(+), 98 deletions(-) diff --git a/ElvUI/Settings/Global.lua b/ElvUI/Settings/Global.lua index 672e99f..1cc7a86 100644 --- a/ElvUI/Settings/Global.lua +++ b/ElvUI/Settings/Global.lua @@ -21,6 +21,11 @@ G["classtimer"] = {} G["nameplates"] = {} +G["unitframe"] = { + ["specialFilters"] = {}, + ["aurafilters"] = {} +} + G["chat"] = { ["classColorMentionExcludedNames"] = {} } diff --git a/ElvUI_Config/UnitFrames.lua b/ElvUI_Config/UnitFrames.lua index b3713a6..eca64d5 100644 --- a/ElvUI_Config/UnitFrames.lua +++ b/ElvUI_Config/UnitFrames.lua @@ -340,53 +340,53 @@ local function GetOptionsTable_AuraBars(friendlyOnly, updateFunc, groupName) updateFunc(UF, groupName) end, } - config.args.filters.args.filterPriority = { - order = 22, - dragdrop = true, - type = "multiselect", - name = L["Filter Priority"], - dragOnLeave = function() end, --keep this here - dragOnEnter = function(info, value) - carryFilterTo = info.obj.value - end, - dragOnMouseDown = function(info, value) - carryFilterFrom, carryFilterTo = info.obj.value, nil - end, - dragOnMouseUp = function(info, value) - filterPriority("aurabar", groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot - carryFilterFrom, carryFilterTo = nil, nil - end, - dragOnClick = function(info, value) - filterPriority("aurabar", groupName, carryFilterFrom, true) - end, - stateSwitchGetText = function(button, text, value) - local friend, enemy = match(text, "^Friendly:([^,]*)"), match(text, "^Enemy:([^,]*)") - return (friend and format("|cFF33FF33%s|r %s", L["Friend"], friend)) or (enemy and format("|cFFFF3333%s|r %s", L["Enemy"], enemy)) - end, - stateSwitchOnClick = function(info, value) - filterPriority("aurabar", groupName, carryFilterFrom, nil, nil, true) - end, - values = function() - local str = E.db.unitframe.units[groupName].aurabar.priority - if str == "" then return nil end - return {strsplit(",",str)} - end, - get = function(info, value) - local str = E.db.unitframe.units[groupName].aurabar.priority - if str == "" then return nil end - local tbl = {strsplit(",",str)} - return tbl[value] - end, - set = function(info, value) - E.db.unitframe.units[groupName].aurabar[ info[getn(info)] ] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable - updateFunc(UF, groupName) - end - } - config.args.filters.args.spacer1 = { - order = 23, - type = "description", - name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."], - } + -- config.args.filters.args.filterPriority = { + -- order = 22, + -- dragdrop = true, + -- type = "multiselect", + -- name = L["Filter Priority"], + -- dragOnLeave = function() end, --keep this here + -- dragOnEnter = function(info, value) + -- carryFilterTo = info.obj.value + -- end, + -- dragOnMouseDown = function(info, value) + -- carryFilterFrom, carryFilterTo = info.obj.value, nil + -- end, + -- dragOnMouseUp = function(info, value) + -- filterPriority("aurabar", groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot + -- carryFilterFrom, carryFilterTo = nil, nil + -- end, + -- dragOnClick = function(info, value) + -- filterPriority("aurabar", groupName, carryFilterFrom, true) + -- end, + -- stateSwitchGetText = function(button, text, value) + -- local friend, enemy = match(text, "^Friendly:([^,]*)"), match(text, "^Enemy:([^,]*)") + -- return (friend and format("|cFF33FF33%s|r %s", L["Friend"], friend)) or (enemy and format("|cFFFF3333%s|r %s", L["Enemy"], enemy)) + -- end, + -- stateSwitchOnClick = function(info, value) + -- filterPriority("aurabar", groupName, carryFilterFrom, nil, nil, true) + -- end, + -- values = function() + -- local str = E.db.unitframe.units[groupName].aurabar.priority + -- if str == "" then return nil end + -- return {strsplit(",",str)} + -- end, + -- get = function(info, value) + -- local str = E.db.unitframe.units[groupName].aurabar.priority + -- if str == "" then return nil end + -- local tbl = {strsplit(",",str)} + -- return tbl[value] + -- end, + -- set = function(info, value) + -- E.db.unitframe.units[groupName].aurabar[ info[getn(info)] ] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable + -- updateFunc(UF, groupName) + -- end + -- } + -- config.args.filters.args.spacer1 = { + -- order = 23, + -- type = "description", + -- name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."], + -- } return config end @@ -589,53 +589,53 @@ local function GetOptionsTable_Auras(friendlyUnitOnly, auraType, isGroupFrame, u updateFunc(UF, groupName, numUnits) end, } - config.args.filters.args.filterPriority = { - order = 22, - dragdrop = true, - type = "multiselect", - name = L["Filter Priority"], - dragOnLeave = function() end, --keep this here - dragOnEnter = function(info, value) - carryFilterTo = info.obj.value - end, - dragOnMouseDown = function(info, value) - carryFilterFrom, carryFilterTo = info.obj.value, nil - end, - dragOnMouseUp = function(info, value) - filterPriority(auraType, groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot - carryFilterFrom, carryFilterTo = nil, nil - end, - dragOnClick = function(info, value) - filterPriority(auraType, groupName, carryFilterFrom, true) - end, - stateSwitchGetText = function(button, text, value) - local friend, enemy = match(text, "^Friendly:([^,]*)"), match(text, "^Enemy:([^,]*)") - return (friend and format("|cFF33FF33%s|r %s", L["Friend"], friend)) or (enemy and format("|cFFFF3333%s|r %s", L["Enemy"], enemy)) - end, - stateSwitchOnClick = function(info, value) - filterPriority(auraType, groupName, carryFilterFrom, nil, nil, true) - end, - values = function() - local str = E.db.unitframe.units[groupName][auraType].priority - if str == "" then return nil end - return {strsplit(",",str)} - end, - get = function(info, value) - local str = E.db.unitframe.units[groupName][auraType].priority - if str == "" then return nil end - local tbl = {strsplit(",",str)} - return tbl[value] - end, - set = function(info, value) - E.db.unitframe.units[groupName][auraType][ info[getn(info)] ] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable - updateFunc(UF, groupName, numUnits) - end - } - config.args.filters.args.spacer1 = { - order = 23, - type = "description", - name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."], - } + -- config.args.filters.args.filterPriority = { + -- order = 22, + -- dragdrop = true, + -- type = "multiselect", + -- name = L["Filter Priority"], + -- dragOnLeave = function() end, --keep this here + -- dragOnEnter = function(info, value) + -- carryFilterTo = info.obj.value + -- end, + -- dragOnMouseDown = function(info, value) + -- carryFilterFrom, carryFilterTo = info.obj.value, nil + -- end, + -- dragOnMouseUp = function(info, value) + -- filterPriority(auraType, groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot + -- carryFilterFrom, carryFilterTo = nil, nil + -- end, + -- dragOnClick = function(info, value) + -- filterPriority(auraType, groupName, carryFilterFrom, true) + -- end, + -- stateSwitchGetText = function(button, text, value) + -- local friend, enemy = match(text, "^Friendly:([^,]*)"), match(text, "^Enemy:([^,]*)") + -- return (friend and format("|cFF33FF33%s|r %s", L["Friend"], friend)) or (enemy and format("|cFFFF3333%s|r %s", L["Enemy"], enemy)) + -- end, + -- stateSwitchOnClick = function(info, value) + -- filterPriority(auraType, groupName, carryFilterFrom, nil, nil, true) + -- end, + -- values = function() + -- local str = E.db.unitframe.units[groupName][auraType].priority + -- if str == "" then return nil end + -- return {strsplit(",",str)} + -- end, + -- get = function(info, value) + -- local str = E.db.unitframe.units[groupName][auraType].priority + -- if str == "" then return nil end + -- local tbl = {strsplit(",",str)} + -- return tbl[value] + -- end, + -- set = function(info, value) + -- E.db.unitframe.units[groupName][auraType][ info[getn(info)] ] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable + -- updateFunc(UF, groupName, numUnits) + -- end + -- } + -- config.args.filters.args.spacer1 = { + -- order = 23, + -- type = "description", + -- name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."], + -- } return config end @@ -861,7 +861,6 @@ local function GetOptionsTable_Castbar(hasTicks, updateFunc, groupName, numUnits return config end - local function GetOptionsTable_InformationPanel(updateFunc, groupName, numUnits) local config = { @@ -2734,10 +2733,10 @@ E.Options.args.unitframe.args.player = { power = GetOptionsTable_Power(true, UF.CreateAndUpdateUF, "player", nil, true), name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "player"), portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "player"), - --buffs = GetOptionsTable_Auras(true, "buffs", false, UF.CreateAndUpdateUF, "player"), - --debuffs = GetOptionsTable_Auras(true, "debuffs", false, UF.CreateAndUpdateUF, "player"), + buffs = GetOptionsTable_Auras(true, "buffs", false, UF.CreateAndUpdateUF, "player"), + debuffs = GetOptionsTable_Auras(true, "debuffs", false, UF.CreateAndUpdateUF, "player"), castbar = GetOptionsTable_Castbar(true, UF.CreateAndUpdateUF, "player"), - --aurabar = GetOptionsTable_AuraBars(true, UF.CreateAndUpdateUF, "player"), + aurabar = GetOptionsTable_AuraBars(true, UF.CreateAndUpdateUF, "player"), raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "player"), classbar = { order = 1000,