Commit d53baaf6 authored by Azilroka's avatar Azilroka

Revert this stuff.. Keep it in the profiles.

parent aa673f30
......@@ -1780,6 +1780,29 @@ function E:DBConversions()
if E.global.uiScaleInformed then E.global.uiScaleInformed = nil end
if E.global.nameplatesResetInformed then E.global.nameplatesResetInformed = nil end
if E.global.userInformedNewChanges1 then E.global.userInformedNewChanges1 = nil end
-- cvar nameplate visibility stuff
if E.db.nameplates.visibility.nameplateShowAll ~= nil then
E.db.nameplates.visibility.showAll = E.db.nameplates.visibility.nameplateShowAll
E.db.nameplates.visibility.nameplateShowAll = nil
end
if E.db.nameplates.units.FRIENDLY_NPC.showAlways ~= nil then
E.db.nameplates.visibility.friendly.npcs = E.db.nameplates.units.FRIENDLY_NPC.showAlways
E.db.nameplates.units.FRIENDLY_NPC.showAlways = nil
end
if E.db.nameplates.units.FRIENDLY_PLAYER.minions ~= nil then
E.db.nameplates.visibility.friendly.minions = E.db.nameplates.units.FRIENDLY_PLAYER.minions
E.db.nameplates.units.FRIENDLY_PLAYER.minions = nil
end
if E.db.nameplates.units.ENEMY_NPC.minors ~= nil then
E.db.nameplates.visibility.enemy.minus = E.db.nameplates.units.ENEMY_NPC.minors
E.db.nameplates.units.ENEMY_NPC.minors = nil
end
if E.db.nameplates.units.ENEMY_PLAYER.minions ~= nil or E.db.nameplates.units.ENEMY_NPC.minions ~= nil then
E.db.nameplates.visibility.enemy.minions = E.db.nameplates.units.ENEMY_PLAYER.minions or E.db.nameplates.units.ENEMY_NPC.minions
E.db.nameplates.units.ENEMY_PLAYER.minions = nil
E.db.nameplates.units.ENEMY_NPC.minions = nil
end
end
local CPU_USAGE = {}
......
......@@ -4,8 +4,6 @@ local NP = E:GetModule('NamePlates')
local _G = _G
local pairs, unpack = pairs, unpack
local CreateFrame = CreateFrame
local GetCVar = GetCVar
local GetCVarBool = GetCVarBool
function NP:Construct_QuestIcons(nameplate)
local QuestIcons = CreateFrame('Frame', nameplate:GetDebugName()..'QuestIcons', nameplate)
......@@ -218,7 +216,7 @@ end
function NP:Update_Fader(nameplate)
local db = NP.db.units[nameplate.frameType]
if (nameplate.frameType ~= 'PLAYER') or nameplate.frameType == 'PLAYER' and GetCVarBool('NameplatePersonalShowAlways') then
if (not db.visibility) or db.visibility.showAlways then
if nameplate:IsElementEnabled('Fader') then
nameplate:DisableElement('Fader')
......@@ -240,9 +238,9 @@ function NP:Update_Fader(nameplate)
nameplate.Fader:SetOption('Casting', true)
end
nameplate.Fader:SetOption('PlayerTarget', GetCVarBool('NameplatePersonalShowWithTarget'))
nameplate.Fader:SetOption('Combat', GetCVarBool('NameplatePersonalShowInCombat'))
nameplate.Fader:SetOption('Delay', GetCVar('NameplatePersonalHideDelayAlpha'))
nameplate.Fader:SetOption('PlayerTarget', db.visibility.showWithTarget)
nameplate.Fader:SetOption('Combat', db.visibility.showInCombat)
nameplate.Fader:SetOption('Delay', db.visibility.hideDelay)
nameplate.Fader:ForceUpdate()
end
......
......@@ -15,7 +15,6 @@ local hooksecurefunc = hooksecurefunc
local CreateFrame = CreateFrame
local GetCVar = GetCVar
local GetCVarDefault = GetCVarDefault
local GetCVarBool = GetCVarBool
local GetInstanceInfo = GetInstanceInfo
local GetNumGroupMembers = GetNumGroupMembers
local GetNumSubgroupMembers = GetNumSubgroupMembers
......@@ -107,19 +106,27 @@ function NP:SetCVars()
SetCVar('nameplateOtherBottomInset', -1)
end
SetCVar('nameplateMaxDistance', NP.db.loadDistance)
SetCVar('nameplateMotion', NP.db.motionType == 'STACKED' and 1 or 0)
SetCVar('NameplatePersonalShowAlways', NP.db.units.PLAYER.visibility.showAlways and 1 or 0)
SetCVar('NameplatePersonalShowInCombat', NP.db.units.PLAYER.visibility.showInCombat and 1 or 0)
SetCVar('NameplatePersonalShowWithTarget', NP.db.units.PLAYER.visibility.showWithTarget and 1 or 0)
SetCVar('NameplatePersonalHideDelayAlpha', NP.db.units.PLAYER.visibility.hideDelay)
-- the order of these is important !!
SetCVar('nameplateShowAll', GetCVar('nameplateShowAll'))
SetCVar('nameplateShowAll', NP.db.visibility.showAll and 1 or 0)
SetCVar('nameplateShowSelf', (NP.db.units.PLAYER.useStaticPosition or not NP.db.units.PLAYER.enable) and 0 or 1)
SetCVar('nameplateShowEnemyMinions', GetCVar('nameplateShowEnemyMinions'))
SetCVar('nameplateShowEnemyGuardians', GetCVar('nameplateShowEnemyGuardians'))
SetCVar('nameplateShowEnemyMinus', GetCVar('nameplateShowEnemyMinus'))
SetCVar('nameplateShowEnemyPets', GetCVar('nameplateShowEnemyPets'))
SetCVar('nameplateShowEnemyTotems', GetCVar('nameplateShowEnemyTotems'))
SetCVar('nameplateShowFriendlyMinions', GetCVar('nameplateShowFriendlyMinions'))
SetCVar('nameplateShowFriendlyGuardians', GetCVar('nameplateShowFriendlyGuardians'))
SetCVar('nameplateShowFriendlyNPCs', GetCVar('nameplateShowFriendlyNPCs'))
SetCVar('nameplateShowFriendlyPets', GetCVar('nameplateShowFriendlyPets'))
SetCVar('nameplateShowFriendlyTotems', GetCVar('nameplateShowFriendlyTotems'))
SetCVar('nameplateShowEnemyMinions', NP.db.visibility.enemy.minions and 1 or 0)
SetCVar('nameplateShowEnemyGuardians', NP.db.visibility.enemy.guardians and 1 or 0)
SetCVar('nameplateShowEnemyMinus', NP.db.visibility.enemy.minus and 1 or 0)
SetCVar('nameplateShowEnemyPets', NP.db.visibility.enemy.pets and 1 or 0)
SetCVar('nameplateShowEnemyTotems', NP.db.visibility.enemy.totems and 1 or 0)
SetCVar('nameplateShowFriendlyMinions', NP.db.visibility.friendly.minions and 1 or 0)
SetCVar('nameplateShowFriendlyGuardians', NP.db.visibility.friendly.guardians and 1 or 0)
SetCVar('nameplateShowFriendlyNPCs', NP.db.visibility.friendly.npcs and 1 or 0)
SetCVar('nameplateShowFriendlyPets', NP.db.visibility.friendly.pets and 1 or 0)
SetCVar('nameplateShowFriendlyTotems', NP.db.visibility.friendly.totems and 1 or 0)
end
function NP:PLAYER_REGEN_DISABLED()
......
......@@ -437,7 +437,9 @@ P.nameplates = {
font = 'PT Sans Narrow',
fontOutline = 'OUTLINE',
fontSize = 11,
loadDistance = 40,
lowHealthThreshold = 0.4,
motionType = 'STACKED',
nameColoredGlow = false,
showEnemyCombat = 'DISABLED',
showFriendlyCombat = 'DISABLED',
......@@ -452,6 +454,23 @@ P.nameplates = {
useThreatColor = true,
indicator = false,
},
visibility = {
showAll = true,
enemy = {
guardians = false,
minions = false,
minus = true,
pets = false,
totems = false,
},
friendly = {
guardians = false,
minions = false,
npcs = true,
pets = false,
totems = false,
},
},
cutaway = {
health = {
enabled = false,
......
......@@ -19,7 +19,6 @@ local GetSpellInfo = GetSpellInfo
local GetTalentInfo = GetTalentInfo
local SetCVar = SetCVar
local GetCVar = GetCVar
local GetCVarBool = GetCVarBool
local raidTargetIcon = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_%s:0|t %s"
local selectedNameplateFilter
......@@ -4312,11 +4311,9 @@ E.Options.args.nameplate = {
order = 1,
name = L["UNIT_NAMEPLATES_TYPES"],
desc = L["Set to either stack nameplates vertically or allow them to overlap."],
get = function() return tonumber(GetCVar('nameplateMotion')) end,
set = function(_, value) SetCVar('nameplateMotion', value) end,
values = {
[0] = L["UNIT_NAMEPLATES_TYPE_1"],
[1] = L["UNIT_NAMEPLATES_TYPE_2"],
['STACKED'] = L["UNIT_NAMEPLATES_TYPE_2"],
['OVERLAP'] = L["UNIT_NAMEPLATES_TYPE_1"],
},
},
showEnemyCombat = {
......@@ -4359,8 +4356,6 @@ E.Options.args.nameplate = {
name = L["Load Distance"],
desc = L["Only load nameplates for units within this range."],
min = 10, max = 100, step = 1,
get = function() return tonumber(GetCVar('nameplateMaxDistance')) end,
set = function(_, value) SetCVar('nameplateMaxDistance', value) end,
},
overlapV = {
order = 7,
......@@ -4437,45 +4432,44 @@ E.Options.args.nameplate = {
customWidth = 250,
name = L["UNIT_NAMEPLATES_AUTOMODE"],
desc = L["This option controls the Blizzard setting for whether or not the Nameplates should be shown."],
get = function() return GetCVarBool('nameplateShowAll') end,
set = function(info, value) SetCVar('nameplateShowAll', value == true and 1 or 0) NP:ConfigureAll() end,
get = function(info) return E.db.nameplates.visibility.showAll end,
set = function(info, value) E.db.nameplates.visibility.showAll = value; NP:SetCVars() NP:ConfigureAll() end,
},
showAlways = {
order = 1,
type = "toggle",
name = L["Always Show Player"],
get = function(info) return GetCVarBool('NameplatePersonalShowAlways') end,
set = function(_, value) SetCVar('NameplatePersonalShowAlways', value == true and 1 or 0) NP:ConfigureAll() end,
disabled = function() return not E.db.nameplates.units.PLAYER.enable end,
get = function(info) return E.db.nameplates.units.PLAYER.visibility.showAlways end,
set = function(info, value) E.db.nameplates.units.PLAYER.visibility.showAlways = value; NP:SetCVars() NP:ConfigureAll() end,
},
playerVisibility = {
order = 2,
type = "group",
guiInline = true,
name = L["Player"],
disabled = function() return GetCVarBool('NameplatePersonalShowAlways') end,
get = function(info) return E.db.nameplates.units.PLAYER.visibility[info[#info]] end,
set = function(info, value) E.db.nameplates.units.PLAYER.visibility[info[#info]] = value; NP:SetCVars(); NP:ConfigureAll() end,
args = {
showInCombat = {
order = 2,
type = "toggle",
name = L["Show In Combat"],
get = function(info) return GetCVarBool('NameplatePersonalShowInCombat') end,
set = function(_, value) SetCVar('NameplatePersonalShowInCombat', value == true and 1 or 0) NP:ConfigureAll() end,
disabled = function() return not E.db.nameplates.units.PLAYER.enable or E.db.nameplates.units.PLAYER.visibility.showAlways end,
},
showWithTarget = {
order = 2,
type = "toggle",
name = L["Show With Target"],
desc = L["When using Static Position, this option also requires the target to be attackable."],
get = function(info) return GetCVarBool('NameplatePersonalShowWithTarget') end,
set = function(_, value) SetCVar('NameplatePersonalShowWithTarget', value == true and 1 or 0) NP:ConfigureAll() end,
disabled = function() return not E.db.nameplates.units.PLAYER.enable or E.db.nameplates.units.PLAYER.visibility.showAlways end,
},
hideDelay = {
order = 4,
type = "range",
name = L["Hide Delay"],
min = 0, max = 20, step = 1,
get = function(info) return tonumber(GetCVar('NameplatePersonalHideDelayAlpha')) end,
set = function(_, value) SetCVar('NameplatePersonalHideDelayAlpha', value) NP:ConfigureAll() end,
disabled = function() return not E.db.nameplates.units.PLAYER.enable or E.db.nameplates.units.PLAYER.visibility.showAlways end,
},
},
},
......@@ -4484,35 +4478,33 @@ E.Options.args.nameplate = {
order = 3,
guiInline = true,
name = L["Enemy"],
disabled = function() return not GetCVarBool('nameplateShowAll') end,
get = function(info) return GetCVarBool(info[#info]) end,
set = function(info, value)
SetCVar(info[#info], value == true and 1 or 0)
NP:SetCVars()
NP:ConfigureAll()
end,
disabled = function() return not E.db.nameplates.visibility.showAll end,
get = function(info) return E.db.nameplates.visibility.enemy[info[#info]] end,
set = function(info, value) E.db.nameplates.visibility.enemy[info[#info]] = value;
NP:SetCVars();
NP:ConfigureAll() end,
args = {
nameplateShowEnemyGuardians = {
guardians = {
type = "toggle",
order = 1,
name = L["Guardians"],
},
nameplateShowEnemyMinions = {
minions = {
type = "toggle",
order = 2,
name = L["Minions"],
},
nameplateShowEnemyMinus = {
minus = {
type = "toggle",
order = 3,
name = L["Minus"],
},
nameplateShowEnemyPets = {
pets = {
type = "toggle",
order = 4,
name = L["Pets"],
},
nameplateShowEnemyTotems = {
totems = {
type = "toggle",
order = 5,
name = L["Totems"],
......@@ -4524,35 +4516,34 @@ E.Options.args.nameplate = {
order = 4,
guiInline = true,
name = L["Friendly"],
disabled = function() return not GetCVarBool('nameplateShowAll') end,
get = function(info) return GetCVarBool(info[#info]) end,
set = function(info, value)
SetCVar(info[#info], value == true and 1 or 0)
disabled = function() return not E.db.nameplates.visibility.showAll end,
get = function(info) return E.db.nameplates.visibility.friendly[info[#info]] end,
set = function(info, value) E.db.nameplates.visibility.friendly[info[#info]] = value;
NP:SetCVars()
NP:ConfigureAll()
end,
args = {
nameplateShowFriendlyGuardians = {
guardians = {
type = "toggle",
order = 1,
name = L["Guardians"],
},
nameplateShowFriendlyMinions = {
minions = {
type = "toggle",
order = 2,
name = L["Minions"],
},
nameplateShowFriendlyNPCs = {
npcs = {
type = "toggle",
order = 3,
name = L["NPC"],
},
nameplateShowFriendlyPets = {
pets = {
type = "toggle",
order = 4,
name = L["Pets"],
},
nameplateShowFriendlyTotems = {
totems = {
type = "toggle",
order = 5,
name = L["Totems"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment