Quantcast

Put in options for specswitch dropdown offset.

Darth Predator [02-24-17 - 13:03]
Put in options for specswitch dropdown offset.
This closes #436
Filename
CHANGELOG.txt
ElvUI_SLE/defaults/private.lua
ElvUI_SLE/modules/sledatatexts/specswitch.lua
ElvUI_SLE/options/datatexts/datatexts_c.lua
ElvUI_SLE/options/datatexts/misc_c.lua
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f77f723..faa6c0a 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,12 +2,14 @@ v3.19
 Additions:
 - Added an option for player frame to show pvp text on the prestige icon
 - Added font options for banners' title text (e.g. world quest title)
+- Added character spesific option to alter offset of dropdown menu of specialization datatext
 Fixes:
 - Fied primary stat missing from the list on character screen
 - Fixed altoholic button not moving to button bar
 - Fixed artifact power throwing errors when a caged pet is present in bags
 - Fixed role icons missing on BGs
 - Fixed some localization being broken
+- Fixed enabling cht datatext panels causing an error

 v3.18 01/11/2017
 Additions:
diff --git a/ElvUI_SLE/defaults/private.lua b/ElvUI_SLE/defaults/private.lua
index a180a10..b663aac 100644
--- a/ElvUI_SLE/defaults/private.lua
+++ b/ElvUI_SLE/defaults/private.lua
@@ -55,6 +55,13 @@ V["sle"] = {
 		},
 	},

+	["dt"] = {
+		["specswitch"] = {
+			["xOffset"] = -15,
+			["yOffset"] = -7,
+		},
+	},
+
 	["bags"] = {
 		["transparentSlots"] = false,
 	},
diff --git a/ElvUI_SLE/modules/sledatatexts/specswitch.lua b/ElvUI_SLE/modules/sledatatexts/specswitch.lua
index e628d36..c664802 100644
--- a/ElvUI_SLE/modules/sledatatexts/specswitch.lua
+++ b/ElvUI_SLE/modules/sledatatexts/specswitch.lua
@@ -60,8 +60,7 @@ function DTP:ReplaceSpecSwitch()
 						specList[index + 1] = nil
 					end
 				end
-				-- EasyMenu(specList, menuFrame, "cursor", -15, -7, "MENU", 2)
-				EasyMenu(specList, menuFrame, "cursor", -15, 50, "MENU", 2)
+				EasyMenu(specList, menuFrame, "cursor", E.private.sle.dt.specswitch.xOffset, E.private.sle.dt.specswitch.yOffset, "MENU", 2)
 			end
 		else
 			DT.tooltip:Hide()
@@ -78,8 +77,7 @@ function DTP:ReplaceSpecSwitch()
 				end
 			end

-			-- EasyMenu(menuList, menuFrame, "cursor", -15, -7, "MENU", 2)
-			EasyMenu(menuList, menuFrame, "cursor", -15, 50, "MENU", 2)
+			EasyMenu(menuList, menuFrame, "cursor", E.private.sle.dt.specswitch.xOffset, E.private.sle.dt.specswitch.yOffset, "MENU", 2)
 		end
 	end
 end
\ No newline at end of file
diff --git a/ElvUI_SLE/options/datatexts/datatexts_c.lua b/ElvUI_SLE/options/datatexts/datatexts_c.lua
index 9c0f511..418e96c 100644
--- a/ElvUI_SLE/options/datatexts/datatexts_c.lua
+++ b/ElvUI_SLE/options/datatexts/datatexts_c.lua
@@ -111,7 +111,7 @@ local function configTable()
 		args = {
 			panels = {
 				type = "group",
-				name = L["Datatexts"],
+				name = L["DataTexts"],
 				order = 1,
 				args = {
 					header = { order = 1, type = "header", name = L["Additional Datatext Panels"] },
diff --git a/ElvUI_SLE/options/datatexts/misc_c.lua b/ElvUI_SLE/options/datatexts/misc_c.lua
index 8cb999b..8843849 100644
--- a/ElvUI_SLE/options/datatexts/misc_c.lua
+++ b/ElvUI_SLE/options/datatexts/misc_c.lua
@@ -74,6 +74,29 @@ local function configTable()
 			},
 		},
 	}
+	E.Options.args.sle.args.modules.args.datatext.args.sldatatext.args.specswitch = {
+		type = "group",
+		name = SPECIALIZATION,
+		order = 8,
+		get = function(info) return E.private.sle.dt.specswitch[ info[#info] ] end,
+		set = function(info, value) E.private.sle.dt.specswitch[ info[#info] ] = value; end,
+		args = {
+			xOffset = {
+				order = 1,
+				type = "range",
+				min = -100, max = 100, step = 1,
+				name = L["X-Offset"],
+				-- desc = L["Datatext will flash if durability shown will be equal or lower that this value. Set to -1 to disable"],
+			},
+			yOffset = {
+				order = 1,
+				type = "range",
+				min = -100, max = 100, step = 1,
+				name = L["Y-Offset"],
+				-- desc = L["Datatext will flash if durability shown will be equal or lower that this value. Set to -1 to disable"],
+			},
+		},
+	}
 end

 T.tinsert(SLE.Configs, configTable)
\ No newline at end of file