Quantcast

New option!

Darthpred [07-24-16 - 18:48]
New option!
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/locales/english.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/nameplates.lua
ElvUI_SLE/options/nameplates_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index b25cff8..564bdfd 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -345,9 +345,10 @@ P["sle"] = {
 		},
 	},
 	--Nameplate Options
-	["nameplate"] = {
+	["nameplates"] = {
 		["showthreat"] = false,
 		["targetcount"] = false,
+		["visibleRange"] = 60,
 	},
 	--Loot
 	["loot"] = {
diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua
index aabc82a..a633678 100644
--- a/ElvUI_SLE/locales/english.lua
+++ b/ElvUI_SLE/locales/english.lua
@@ -559,6 +559,8 @@ L["Target Count"] = true
 L["Display the number of party / raid members targetting the nameplate unit."] = true
 L["Threat Text"] = true
 L["Display threat level as text on targeted, boss or mouseover nameplate."] = true
+L["Visibility Range"] = true
+L["Sets the maximum range to the unit on which its nameplate will be shown."] = true

 --Professions
 L["Deconstruct Mode"] = true
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 2cd1cb0..d426a46 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -551,6 +551,8 @@ L["Target Count"] = "Число выделений"
 L["Display the number of party / raid members targetting the nameplate unit."] = "Показывать количество членов группы/рейда, выбравших в цель этот юнит."
 L["Threat Text"] = "Текст угрозы"
 L["Display threat level as text on targeted, boss or mouseover nameplate."] = "Отображает текст угрозы на индикаторе цели, босса или юнита под курсором."
+L["Visibility Range"] = "Дальность видимости"
+L["Sets the maximum range to the unit on which its nameplate will be shown."] = "Устанавливает максимальное расстояние до юнита, на котором будет показываться его индикатор."

 --Professions
 L["Deconstruct Mode"] = "Режим распыления"
diff --git a/ElvUI_SLE/modules/nameplates.lua b/ElvUI_SLE/modules/nameplates.lua
index ebc36fc..911e070 100644
--- a/ElvUI_SLE/modules/nameplates.lua
+++ b/ElvUI_SLE/modules/nameplates.lua
@@ -116,16 +116,22 @@ function N:StartRosterUpdate()
 	end
 end

+function N:PlateRange()
+	SetCVar("nameplateMaxDistance", N.db.visibleRange or 60)
+end
+
 function N:Initialize()
 	if not SLE.initialized or not E.private.nameplates.enable then return end
-	N.db = E.db.sle.nameplate
-	N.viewPort = NP.viewPort
+	if E.db.sle.nameplate then E.db.sle.nameplates = E.db.sle.nameplate; E.db.sle.nameplate = nil end
+	N.db = E.db.sle.nameplates
 	self:RegisterEvent("GROUP_ROSTER_UPDATE", "StartRosterUpdate")
 	self:RegisterEvent("UNIT_TARGET", "UpdateCount")
+	N:PlateRange()

 	E:Delay(.3, function() N:UpdateCount(nil,"player", true) end)
 	function N:ForUpdateAll()
-		N.db = E.db.sle.nameplate
+		N.db = E.db.sle.nameplates
+		N:PlateRange()
 	end
 end

diff --git a/ElvUI_SLE/options/nameplates_c.lua b/ElvUI_SLE/options/nameplates_c.lua
index 0a8dbee..5e7c12f 100644
--- a/ElvUI_SLE/options/nameplates_c.lua
+++ b/ElvUI_SLE/options/nameplates_c.lua
@@ -7,8 +7,8 @@ local function configTable()
 		name = L["NamePlates"],
 		order = 14,
 		disabled = function() return not E.private.nameplates.enable end,
-		get = function(info) return E.db.sle.nameplate[ info[#info] ] end,
-		set = function(info, value) E.db.sle.nameplate[ info[#info] ] = value; E:GetModule('NamePlates'):ConfigureAll() end,
+		get = function(info) return E.db.sle.nameplates[ info[#info] ] end,
+		set = function(info, value) E.db.sle.nameplates[ info[#info] ] = value; E:GetModule('NamePlates'):ConfigureAll() end,
 		args = {
 			header = {
 				order = 1,
@@ -27,6 +27,14 @@ local function configTable()
 				name = L["Threat Text"],
 				desc = L["Display threat level as text on targeted, boss or mouseover nameplate."],
 			},
+			visibleRange = {
+				type = "range",
+				order = 4,
+				name = L["Visibility Range"],
+				desc = L["Sets the maximum range to the unit on which its nameplate will be shown."],
+				min = 1, max = 100, step = 1,
+				set = function(info, value) E.db.sle.nameplates[ info[#info] ] = value; SLE:GetModule('Nameplates'):PlateRange() end,
+			},
 		},
 	}
 end