Quantcast

Updating TomTom for 3.1 including new Astrolabe

James Whitehead II [04-07-09 - 21:42]
Updating TomTom for 3.1 including new Astrolabe
Filename
TomTom_CrazyArrow.lua
TomTom_Waypoints.lua
libs/Astrolabe/Astrolabe.lua
diff --git a/TomTom_CrazyArrow.lua b/TomTom_CrazyArrow.lua
index b985cd8..3936e35 100644
--- a/TomTom_CrazyArrow.lua
+++ b/TomTom_CrazyArrow.lua
@@ -11,33 +11,6 @@ local sformat = string.format
 local L = TomTomLocals
 local ldb = LibStub("LibDataBroker-1.1")

-local GetPlayerBearing
-function GetPlayerBearing()
-	local obj; -- Remains an upvalue
-	do
-		local t = {Minimap:GetChildren()}; -- Becomes garbage
-		for k, v in pairs(t) do
-			if v:IsObjectType("Model") and not v:GetName() then
-				local model = v:GetModel():lower()
-				if model:match("interface\\minimap\\minimaparrow") then
-					obj = v; break;
-				end
-			end
-		end
-	end
-	if not obj then return; end
-
-	-- If we've found what we were looking for, rewrite function to skip the search next time.
-	GetPlayerBearing = function()
-		if GetCVar("rotateMinimap") ~= "0" then
-			return (MiniMapCompassRing:GetFacing() * -1)
-		else
-			return obj:GetFacing();
-		end
-	end
-	return GetPlayerBearing();
-end
-
 local function ColorGradient(perc, ...)
 	local num = select("#", ...)
 	local hexes = type(select(1, ...)) == "string"
@@ -191,7 +164,7 @@ local function OnUpdate(self, elapsed)
 		end

 		local angle = TomTom:GetDirectionToWaypoint(active_point)
-		local player = GetPlayerBearing()
+		local player = GetPlayerFacing()

 		angle = angle - player

@@ -439,7 +412,7 @@ wayframe:SetScript("OnEvent", function(self, event, arg1, ...)
 				counter = 0

 				local angle = TomTom:GetDirectionToWaypoint(active_point)
-				local player = GetPlayerBearing()
+				local player = GetPlayerFacing()
 				if not angle or not player then
 					feed_crazy.iconCoords = texcoords["1:1"]
 					feed_crazy.iconR = 0.2
diff --git a/TomTom_Waypoints.lua b/TomTom_Waypoints.lua
index 5ec0919..e5244bd 100644
--- a/TomTom_Waypoints.lua
+++ b/TomTom_Waypoints.lua
@@ -78,8 +78,9 @@ local function rotateArrow(self)
 	angle = angle + rad_135

 	if GetCVar("rotateMinimap") == "1" then
-		local cring = MiniMapCompassRing:GetFacing()
-		angle = angle + cring
+		--local cring = MiniMapCompassRing:GetFacing()
+        local cring = GetPlayerFacing()
+		angle = angle - cring
 	end

 	local sin,cos = math.sin(angle) * square_half, math.cos(angle) * square_half
@@ -343,8 +344,9 @@ do
 				angle = angle + rad_135

 				if GetCVar("rotateMinimap") == "1" then
-					local cring = MiniMapCompassRing:GetFacing()
-					angle = angle + cring
+					--local cring = MiniMapCompassRing:GetFacing()
+                    local cring = GetPlayerFacing()
+					angle = angle - cring
 				end

 				local sin,cos = math.sin(angle) * square_half, math.cos(angle) * square_half
diff --git a/libs/Astrolabe/Astrolabe.lua b/libs/Astrolabe/Astrolabe.lua
index e5c9143..e6ab2a1 100644
--- a/libs/Astrolabe/Astrolabe.lua
+++ b/libs/Astrolabe/Astrolabe.lua
@@ -1,7 +1,7 @@
 --[[
 Name: Astrolabe
-Revision: $Rev: 100 $
-$Date: 2008-12-21 09:07:03 +0000 (Sun, 21 Dec 2008) $
+Revision: $Rev: 104 $
+$Date: 2009-03-28 18:21:44 +0000 (Sat, 28 Mar 2009) $
 Author(s): Esamynn (esamynn at wowinterface.com)
 Inspired By: Gatherer by Norganna
              MapLibrary by Kristofer Karlsson (krka at kth.se)
@@ -42,7 +42,7 @@ Note:
 -- DO NOT MAKE CHANGES TO THIS LIBRARY WITHOUT FIRST CHANGING THE LIBRARY_VERSION_MAJOR
 -- STRING (to something unique) OR ELSE YOU MAY BREAK OTHER ADDONS THAT USE THIS LIBRARY!!!
 local LIBRARY_VERSION_MAJOR = "Astrolabe-0.4"
-local LIBRARY_VERSION_MINOR = tonumber(string.match("$Revision: 100 $", "(%d+)") or 1)
+local LIBRARY_VERSION_MINOR = tonumber(string.match("$Revision: 104 $", "(%d+)") or 1)

 if not DongleStub then error(LIBRARY_VERSION_MAJOR .. " requires DongleStub.") end
 if not DongleStub:IsNewerVersion(LIBRARY_VERSION_MAJOR, LIBRARY_VERSION_MINOR) then return end
@@ -367,8 +367,7 @@ end
 local minimapRotationEnabled = false;
 local minimapShape = false;

-local MinimapCompassRing = MiniMapCompassRing;
-local minimapRotationOffset = -MinimapCompassRing:GetFacing()
+local minimapRotationOffset = GetPlayerFacing();


 local function placeIconOnMinimap( minimap, minimapZoom, mapWidth, mapHeight, icon, dist, xDist, yDist )
@@ -489,7 +488,7 @@ function Astrolabe:PlaceIconOnMinimap( icon, continent, zone, xPos, yPos )

 	minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0"
 	if ( minimapRotationEnabled ) then
-		minimapRotationOffset = -MinimapCompassRing:GetFacing()
+		minimapRotationOffset = GetPlayerFacing();
 	end

 	-- check Minimap Shape
@@ -568,7 +567,7 @@ do

 				minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0"
 				if ( minimapRotationEnabled ) then
-					minimapRotationOffset = -MinimapCompassRing:GetFacing()
+					minimapRotationOffset = GetPlayerFacing();
 				end

 				-- check current frame rate
@@ -693,7 +692,7 @@ do
 			if ( C and C >= 0 ) then
 				minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0"
 				if ( minimapRotationEnabled ) then
-					minimapRotationOffset = -MinimapCompassRing:GetFacing()
+					minimapRotationOffset = GetPlayerFacing();
 				end

 				-- check current frame rate