Quantcast

Tooltip Adjustments

Repooc [08-16-14 - 02:48]
Tooltip Adjustments
Filename
ElvUI_SLE/modules/tooltip.lua
ElvUI_SLE/options/tooltip_c.lua
diff --git a/ElvUI_SLE/modules/tooltip.lua b/ElvUI_SLE/modules/tooltip.lua
index 0f06c73..fab1e89 100644
--- a/ElvUI_SLE/modules/tooltip.lua
+++ b/ElvUI_SLE/modules/tooltip.lua
@@ -7,9 +7,10 @@ P['tooltip']['overrideCombat'] = false
 local iconPath = [[Interface\AddOns\ElvUI_SLE\media\textures\]]

 local function AnchorFrameToMouse()
-	if not E.db.tooltip.cursorAnchor then return end
+	if not E.db.tooltip.cursorAnchor or (E.db.sle.tooltip.xOffset == 0 and E.db.sle.tooltip.yOffset == 0) then return end
+
 	local frame = GameTooltip
-	if frame:GetAnchorType() ~= "ANCHOR_CURSOR" then return end
+	--if frame:GetAnchorType() ~= "ANCHOR_CURSOR" then return end

 	local x, y = GetCursorPosition();
 	local scale = frame:GetEffectiveScale();
@@ -37,7 +38,6 @@ local function SetDefaultAnchor(self, tt, parent)
 end

 local function OnTooltipSetUnit(self, tt)
-	if not E.db.sle.tooltip.enable then return end
 	if not E.db.sle.tooltip.showFaction then return end

 	local unit = select(2, tt:GetUnit())
@@ -57,6 +57,6 @@ local function Init()

 	--if not E.db.tooltip.cursorAnchor then return end
 	hooksecurefunc(TT, "CheckBackdropColor", AnchorFrameToMouse)
-	hooksecurefunc(TT, "GameTooltip_SetDefaultAnchor", SetDefaultAnchor)
+	--hooksecurefunc(TT, "GameTooltip_SetDefaultAnchor", SetDefaultAnchor)
 end
 hooksecurefunc(TT, "Initialize", Init)
\ No newline at end of file
diff --git a/ElvUI_SLE/options/tooltip_c.lua b/ElvUI_SLE/options/tooltip_c.lua
index 9f1e447..6a63aa0 100644
--- a/ElvUI_SLE/options/tooltip_c.lua
+++ b/ElvUI_SLE/options/tooltip_c.lua
@@ -4,7 +4,8 @@ local function configTable()
 	E.Options.args.sle.args.options.args.general.args.tooltip = {
 		order = 10,
 		type = "group",
-		get = function(info) return E.db.tooltip[ info[#info] ] end,
+		get = function(info) return E.db.sle.tooltip[ info[#info] ] end,
+		disabled = function() return not E.private.tooltip.enable end,
 		name = L["Tooltip"],
 		args = {
 			header = {
@@ -17,36 +18,43 @@ local function configTable()
 				type = 'description',
 				name = L["Tooltip enhancements"],
 			},
-			tooltipicon = {
-				order = 3,
+			space1 = {
+				order = 4,
+				type = 'description',
+				name = "",
+			},
+			showFaction = {
+				order = 5,
 				type = 'toggle',
 				name = L["Faction Icon"],
 				desc = L["Show faction icon to the left of player's name on tooltip."],
-				get = function(info) return E.db.sle.tooltipicon end,
-				set = function(info, value) E.db.sle.tooltipicon = value end,
+				--get = function(info) return E.db.sle.tooltip.showFaction end,
+				set = function(info, value) E.db.sle.tooltip.showFaction = value end,
 			},
 			offset = {
 				type = "group",
 				name = L["Tooltip Cursor Offset"],
-				order = 4,
+				order = 6,
 				guiInline = true,
-				disabled = function() return not E.private.tooltip.enable or (not E.db.tooltip.cursorAnchor and E.private.tooltip.enable) end,
+				disabled = function() return not E.private.tooltip.enable or not E.db.tooltip.cursorAnchor end,
 				args = {
-					mouseOffsetX = {
+					xOffset = {
 						order = 31,
 						type = 'range',
 						name = L["Tooltip X-offset"],
 						desc = L["Offset the tooltip on the X-axis."],
 						min = -200, max = 200, step = 1,
-						set = function(info, value) E.db.tooltip[ info[#info] ] = value end,
+						--get = function(info) return E.db.sle.tooltip.xOffset end,
+						set = function(info, value) E.db.sle.tooltip[ info[#info] ] = value end,
 					},
-					mouseOffsetY = {
+					yOffset = {
 						order = 32,
 						type = 'range',
 						name = L["Tooltip Y-offset"],
 						desc = L["Offset the tooltip on the Y-axis."],
 						min = -200, max = 200, step = 1,
-						set = function(info, value) E.db.tooltip[ info[#info] ] = value end,
+						--get = function(info) return E.db.sle.tooltip.yOffset
+						set = function(info, value) E.db.sle.tooltip[ info[#info] ] = value end,
 					},
 				},
 			},