Quantcast

Add some code in allowing the main tooltip to be repositioned.

ackis [02-04-09 - 18:18]
Add some code in allowing the main tooltip to be repositioned.
Filename
ARLConfig.lua
ARLFrame.lua
AckisRecipeList.lua
Locals/ARLLocals-enUS.lua
diff --git a/ARLConfig.lua b/ARLConfig.lua
index 6b16a9d..de69d4e 100644
--- a/ARLConfig.lua
+++ b/ARLConfig.lua
@@ -1120,8 +1120,17 @@ local function fullOptions()
 										if ( arlTooltip2 ) then arlTooltip:SetScale( v ) end
 									  end,
 						},
+						acquiretooltiplocation = {
+							order	= 33,
+							type	= "select",
+							name	= L["Tooltip (Acquire) Position"],
+							desc	= L["ACQUIRETOOLTIPPOSITION_DESC"],
+							get		= function() return addon.db.profile.acquiretooltiplocation end,
+							set		= function(info,name) addon.db.profile.acquiretooltiplocation = name end,
+							values	= function() return {Right = L["Right"], Left = L["Left"], Top = L["Top"], Bottom = L["Bottom"], Off = L["Off"], Mouse = L["Mouse"]} end,
+						},
 						spelltooltiplocation = {
-							order	= 32,
+							order	= 34,
 							type	= "select",
 							name	= L["Tooltip (Recipe) Position"],
 							desc	= L["SPELLTOOLTIPPOSITION_DESC"],
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 01c0c1c..69b90f4 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -477,15 +477,15 @@ local function GenerateTooltipContent(owner, rIndex, playerFaction, exclude)
 	local clr1, clr2 = "", ""

 	arlTooltip:ClearLines()
-	arlTooltip:SetOwner(owner, "ANCHOR_RIGHT")
+	--arlTooltip:SetOwner(owner, "ANCHOR_RIGHT")
+	arlTooltip:SetOwner(owner)
+
 	gttAdd(0, 1, 0, 0, recipeDB[rIndex]["Name"], addon:hexcolor("HIGH"))

 	-- check if the recipe is excluded
 	if (exclude[rIndex] == true) then
-
 		clr1 = addon:hexcolor("RED")
 		gttAdd(0, -1, 1, 0, L["RECIPE_EXCLUDED"], clr1)
-
 	end

 	-- Add in skill level requirement, colored correctly
@@ -770,11 +770,12 @@ local function GenerateTooltipContent(owner, rIndex, playerFaction, exclude)
 	local spelltooltiplocation = addon.db.profile.spelltooltiplocation

 	if (spelltooltiplocation ~= L["Off"]) and (spelllink) then
-		arlTooltip2:SetOwner(arlTooltip, "ANCHOR_NONE")
+		--arlTooltip2:SetOwner(arlTooltip, "ANCHOR_NONE")
+		arlTooltip2:SetOwner(arlTooltip)
 		if (spelltooltiplocation == L["Top"]) then
-			arlTooltip2:SetPoint("BOTTOM", arlTooltip, "TOP")
+			arlTooltip2:SetPoint("BOTTOMLEFT", arlTooltip, "TOPLEFT")
 		elseif (spelltooltiplocation == L["Bottom"]) then
-			arlTooltip2:SetPoint("TOP", arlTooltip, "BOTTOM")
+			arlTooltip2:SetPoint("TOPLEFT", arlTooltip, "BOTTOMLEFT")
 		elseif (spelltooltiplocation == L["Left"]) then
 			arlTooltip2:SetPoint("TOPRIGHT", arlTooltip, "TOPLEFT")
 		elseif (spelltooltiplocation == L["Right"]) then
@@ -786,7 +787,23 @@ local function GenerateTooltipContent(owner, rIndex, playerFaction, exclude)
 		arlTooltip2:Hide()
 	end

-	arlTooltip:Show()
+	local acquiretooltiplocation = addon.db.profile.acquiretooltiplocation
+
+	if (acquiretooltiplocation == L["Off"]) then
+		arlTooltip:Hide()
+	else
+		if (acquiretooltiplocation == L["Right"]) then
+			arlTooltip:SetPoint("TOPLEFT", owner, "TOPRIGHT")
+		elseif (acquiretooltiplocation == L["Left"]) then
+			arlTooltip:SetPoint("TOPRIGHT", owner, "TOPLEFT")
+		elseif (acquiretooltiplocation == L["Top"]) then
+			arlTooltip1:SetPoint("BOTTOMLEFT", owner, "TOPLEFT")
+		elseif (acquiretooltiplocation == L["Bottom"]) then
+			arlTooltip1:SetPoint("TOPLEFT", owner, "BOTTOMLEFT")
+		--elseif (acquiretooltiplocation == L["Mouse"]) then
+		end
+		arlTooltip:Show()
+	end

 end

diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index 546fe5e..82af819 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -135,6 +135,7 @@ function addon:OnInitialize()
 			ignoreexclusionlist = false,
 			scanbuttonlocation = L["Right"],
 			spelltooltiplocation = L["Right"],
+			acquiretooltiplocation = L["Mouse"],

 			-- Recipe Exclusion
 			exclusionlist = {},
diff --git a/Locals/ARLLocals-enUS.lua b/Locals/ARLLocals-enUS.lua
index a71d714..5cca217 100644
--- a/Locals/ARLLocals-enUS.lua
+++ b/Locals/ARLLocals-enUS.lua
@@ -92,6 +92,8 @@ L["Tooltip Scale"]			= true
 L["TOOLTIP_SCALE_DESC"]		= "Changes the scale of the ARL tooltip. Ranges from .5 to 1.5 (.9 is default)"
 L["Tooltip (Recipe) Position"] = true
 L["SPELLTOOLTIPPOSITION_DESC"] = "Changes the location of the tooltip containing the recipe information."
+L["Tooltip (Acquire) Position"] = true
+L["ACQUIRETOOLTIPPOSITION_DESC"] = "Changes the location of the tooltip containing the acquire information."
 L["Sorting"]				= true
 L["Sort"]					= true
 L["Display"]				= true
@@ -102,6 +104,7 @@ L["Left"]					= true
 L["Off"]					= true
 L["Top"]					= true
 L["Bottom"]					= true
+L["Mouse"]					= true
 L["Name"]					= true
 L["Skill"]					= true
 L["Location"]				= true