1
0
Bifurcation 0

A bunch of changes dealing with the replacement of Astrolabe.lua.

Cette révision appartient à :
Nathanial.C.Jones 2013-01-04 01:03:20 +00:00
Parent 302d44b8ac
révision cea96d1c2b
8 fichiers modifiés avec 823 ajouts et 855 suppressions

Voir le fichier

@ -84,22 +84,23 @@ end
local msfires = {desc = QHText("FIND_CUSTOM_LOCATION"), tracker_desc = QHText("FIND_CUSTOM_LOCATION")}
local function QH_FindCoord(locx, locy, locz, label)
if type(locz) ~= "number" then -- If it is a number, we are probably doing an elder right now.
label = locz .. " (" .. locx .. ", " .. locy .. ")"
local function QH_FindCoord(locx, locy, locm, locf, label)
-- Note: this part will not work until something is done about QuestHelper_NameLookup
if type(locm) ~= "number" then -- If it is a number, we are probably doing an elder right now.
label = locm .. " (" .. locx .. ", " .. locy .. ")"
for z, nam in pairs(QuestHelper_NameLookup) do
if nam:lower():find(locz:lower()) then
locz = z
if nam:lower():find(locm:lower()) then
locm = z
break
end
end
end
if type(locz) == "number" then
if type(locm) == "number" then
if not custom_find[label] then
local ec, ez = unpack(QuestHelper_ZoneLookup[locz])
local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(ec, ez, locx / 100, locy / 100)
local node = {loc = {x = x, y = y, p = locz, c = QuestHelper_ParentLookup[locz]}, why = {desc = label, tracker_desc = label}, map_desc = {label}, tracker_desc = label, tracker_hidden = true}
local em, ef = locm, locf
local x, y = locx / 100, locy / 100
local node = {loc = {x = x, y = y, m = em, f = ef}, why = {desc = label, tracker_desc = label}, map_desc = {label}, tracker_desc = label, tracker_hidden = true}
local cluster = {node}
node.cluster = cluster
@ -144,7 +145,7 @@ local elders = {
["Horde"] = { -- Achievement 914
["Darkhorn"] = {321, 52, 60, 8677, 1991}, --"Orgrimmar 52 60",
["Wheathoof"] = {362, 73.0, 23.3, 8678, 1993}, --"Thunder Bluff 73.0 23.3",
["Darkcore"] = {382, 67, 38, 8648, 1992}, --"Undercity 67 38"
["Darkcore"] = {382, 67, 38, 8648, 1992}, --"Undercity 67 38" -- Might have a floor.
},
["Kalimdor"] = { -- Achievement 911
["Bladeleaf"] = { 41, 56.8, 53.1, 8715, 1951}, --"Teldrassil 56.8 53.1",
@ -219,6 +220,8 @@ local elders = {
["Firebeard"] = {700, 51, 71, 29737, 18161}, -- Dunward Town Square, Dunward Ruins, Twilight Highlands
["Darkfeather"] = {700, 52, 33, 29736, 18162} -- Thundermar Ruins, Twilight Highlands
},
["Pandaria"] = { -- Unknown atm.
},
--[===[ Placeholder for Elders of the Dungeons. If enabled prior to 2013, stored coordinates should be the map ID of the zone where the instance is located and the coordinates of the entrance. With any luck, by 2013 dungeons will be mapable. Coordinates listed in comment after each elder need to have floor numbers determined, where necessary, ASAP.
["Dungeons"] = { -- Achievement 910
["Wildmane"] = {,,,8676, 1910}, -- Zul'Farrak 34.52 39.35
@ -244,9 +247,9 @@ local function UpdateElders()
local elder, elderinfo
local qid = GetQuestID()
for elder, elderinfo in pairs(trackedElders) do
local z, x, y, id = unpack(elderinfo)
local m, x, y, id = unpack(elderinfo)
if id == qid then
QH_FindCoord(x, y, z, elder)
QH_FindCoord(x, y, m, 0, elder)
trackedElders[elder] = nil
return
end
@ -259,7 +262,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
if elder_or_achievement == "CLEAR" then
for elder, elderinfo in pairs(trackedElders) do
local z, x, y = unpack(elderinfo)
QH_FindCoord(x, y, z, elder)
QH_FindCoord(x, y, m, 0, elder)
end
trackedElders = {}
@ -276,39 +279,39 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
end
for elder, elder_info in pairs(eldrs) do
local locz, locx, locy, qid, aid = unpack(elder_info)
local locm, locx, locy, qid, aid = unpack(elder_info)
local okToAdd = true
if forAchievement then
if aid then
local _, _, completed = GetAchievementCriteriaInfo(aid)
if completed then okToAdd = false end
end
if aid then
local _, _, completed = GetAchievementCriteriaInfo(aid)
if completed then okToAdd = false end
end
elseif qid and QHQuestsCompleted and QHQuestsCompleted[qid] then
okToAdd = false
end
if okToAdd then
if not all_elders then
if not all_elders then
if achievement_match then -- just add it
QH_FindCoord(locx, locy, locz, elder)
if trackedElders[elder] then trackedElders[elder] = nil
QH_FindCoord(locx, locy, locm, 0, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
elseif elder_or_achievement == string.upper(elder) then -- We have input and it's not an achievement, so it must be an elder.
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
elseif elder_or_achievement == string.upper(elder) then -- We have input and it's not an achievement, so it must be an elder.
elder_match = true
QH_FindCoord(locx, locy, locz, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
QH_FindCoord(locx, locy, locm, 0, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info
elderCount = elderCount + 1
end
break -- We've found him or her.
end -- No need for else here. We alread know we don't need everything so we either have an achievement or we have an elder.
else -- We came in without an input, therefore we add all.
QH_FindCoord(locx, locy, locz, elder)
QH_FindCoord(locx, locy, locm, 0, elder)
if trackedElders[elder] then trackedElders[elder] = nil
else
trackedElders[elder] = elder_info

Voir le fichier

@ -8,24 +8,28 @@ local radius = ofs / 1.166666666666667;
local Minimap = _G.Minimap
-- These conversions are nasty, and this entire section needs a serious cleanup.
local function GetCurrentMapMF()
return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
end
local function convertLocation(p)
QuestHelper: Assert(p, "Wait. What? This is checked before calling this function.")
QuestHelper: Assert(p.c, "p.c is nil")
QuestHelper: Assert(p.x, "p.x is nil")
QuestHelper: Assert(p.y, "p.y is nil")
return QuestHelper.Astrolabe:FromAbsoluteContinentPosition(p.c, p.x, p.y)
QuestHelper: Assert(p.m, "No Map ID")
QuestHelper: Assert(p.f, "No Floor")
QuestHelper: Assert(p.x, "No X")
QuestHelper: Assert(p.y, "No Y")
return p.m, p.f, p.x, p.y --QuestHelper.Astrolabe:FromAbsoluteContinentPosition(p.c, p.x, p.y)
end
local function convertLocationToScreen(p, c, z)
local pc, _, px, py = convertLocation(p)
local ox, oy = QuestHelper.Astrolabe:TranslateWorldMapPosition(pc, 0, px, py, c, z)
local function convertLocationToScreen(p, m, f)
local pm, _, px, py = convertLocation(p)
local ox, oy = QuestHelper.Astrolabe:TranslateWorldMapPosition(pm, 0, px, py, m, f)
--QuestHelper:TextOut(string.format("%f/%f/%f to %f/%f/%f to %f/%f %f/%f", p.c, p.x, p.y, pc, px, py, c, z, ox, oy))
return ox, oy
end
local function convertRawToScreen(tc, x, y, c, z)
local rc, _, rx, ry = QuestHelper.Astrolabe:FromAbsoluteContinentPosition(tc, x, y)
return QuestHelper.Astrolabe:TranslateWorldMapPosition(rc, 0, rx, ry, c, z)
local function convertRawToScreen(tm, x, y, m, f)
local rm, _, rx, ry = tm, x, y --QuestHelper.Astrolabe:FromAbsoluteContinentPosition(tc, x, y)
return QuestHelper.Astrolabe:TranslateWorldMapPosition(rm, 0, rx, ry, m, f)
end
local scrolf = CreateFrame("SCROLLFRAME", nil, WorldMapButton)
@ -150,9 +154,9 @@ function QuestHelper:CreateWorldMapWalker()
local w, h = QuestHelper.map_overlay:GetWidth(), -QuestHelper.map_overlay:GetHeight()
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
local m, f = GetCurrentMapMF()
local last_x, last_y = self.frame.Astrolabe:TranslateWorldMapPosition(self.frame.c, self.frame.z, self.frame.x, self.frame.y, c, z)
local last_x, last_y = self.frame.Astrolabe:TranslateWorldMapPosition(self.frame.m, self.frame.f, self.frame.x, self.frame.y, m, f)
local remainder = self.phase
for i, pos in ipairs(points) do
@ -212,7 +216,7 @@ function QuestHelper:CreateWorldMapWalker()
while #points > 0 do self.frame:ReleaseTable(table.remove(points)) end
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
local m, f = GetCurrentMapMF()
for i, obj in ipairs(self.route) do
--QuestHelper:TextOut(string.format("%s", tostring(obj)))
@ -229,7 +233,7 @@ function QuestHelper:CreateWorldMapWalker()
obj.travel_time = travel_time]]
if i > 1 then -- skip the start location
local t = self.frame:CreateTable()
t[1], t[2] = convertLocationToScreen(obj.loc, c, z)
t[1], t[2] = convertLocationToScreen(obj.loc, m, f)
table.insert(points, t)
@ -287,7 +291,7 @@ end
function QuestHelper:GetOverlapObjectives(obj)
local w, h = self.map_overlay:GetWidth(), self.map_overlay:GetHeight()
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
local m, f = GetCurrentMapMF()
local list = self.overlap_list
@ -314,7 +318,7 @@ function QuestHelper:GetOverlapObjectives(obj)
if o == obj then
table.insert(list, o)
else
local x, y = convertLocationToScreen(o.loc, c, z)
local x, y = convertLocationToScreen(o.loc, m, f)
if x and y and x > 0 and y > 0 and x < 1 and y < 1 then
x, y = x*w, y*h
@ -528,7 +532,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
local triangle_opacity = 0.6
function icon:CreateTriangles(solid, tritarget, tristartat, linetarget, linestartat, parent)
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
local m, f = GetCurrentMapMF()
local function makeline(ax, ay, bx, by)
local tri = linetarget[linestartat]
@ -545,10 +549,10 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
for _, v in ipairs(solid) do
local adjx, adjy = v[1], v[2]
local x, y = convertRawToScreen(v.continent, v[1], v[2], c, z)
local x, y = convertRawToScreen(v.map, v[1], v[2], m, f)
--print("matchup", c, v.continent, x, y)
if x and y then
local lx, ly = convertRawToScreen(v.continent, adjx + v[3], adjy + v[4], c, z)
local lx, ly = convertRawToScreen(v.map, adjx + v[3], adjy + v[4], m, f)
local linemode = false
local lidx = 5
@ -557,13 +561,13 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
if v[lidx] == "d" then
QuestHelper: Assert(type(lidx) == "number") -- what
lidx = lidx + 1
x, y = convertRawToScreen(v.continent, adjx + v[lidx], adjy + v[lidx + 1], c, z)
lx, ly = convertRawToScreen(v.continent, adjx + v[lidx + 2], adjy + v[lidx + 3], c, z)
x, y = convertRawToScreen(v.map, adjx + v[lidx], adjy + v[lidx + 1], m, f)
lx, ly = convertRawToScreen(v.map, adjx + v[lidx + 2], adjy + v[lidx + 3], m, f)
lidx = lidx + 4
elseif v[lidx] == "l" then
linemode = true
lidx = lidx + 1
x, y = convertRawToScreen(v.continent, adjx + v[lidx], adjy + v[lidx + 1], c, z)
x, y = convertRawToScreen(v.map, adjx + v[lidx], adjy + v[lidx + 1], m, f)
lx, ly = x, y
lidx = lidx + 2
else
@ -571,7 +575,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
end
else
if not linemode then
local tx, ty = convertRawToScreen(v.continent, adjx + v[lidx], adjy + v[lidx + 1], c, z)
local tx, ty = convertRawToScreen(v.map, adjx + v[lidx], adjy + v[lidx + 1], m, f)
local tri = tritarget[tristartat]
if not tri then
@ -587,7 +591,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
lx, ly = tx, ty
lidx = lidx + 2
else
local tx, ty = convertRawToScreen(v.continent, adjx + v[lidx], adjy + v[lidx + 1], c, z)
local tx, ty = convertRawToScreen(v.map, adjx + v[lidx], adjy + v[lidx + 1], m, f)
makeline(x, y, tx, ty)
@ -608,8 +612,8 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
function icon:SetGlow(list)
local w, h = QuestHelper.map_overlay:GetWidth(), QuestHelper.map_overlay:GetHeight()
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
local zw = QuestHelper.Astrolabe:GetZoneWidth(c, z)
local m, f = GetCurrentMapMF()
local _, _, zw = QuestHelper.Astrolabe:GetMapInfo(m, f)
local solids = {}
@ -620,7 +624,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
--print("solidified", #v.cluster.solid)
solids[v.cluster.solid] = true
else
local x, y = convertLocationToScreen(v.loc, c, z)
local x, y = convertLocationToScreen(v.loc, m, f)
if x and y then
if not self.glow_list then
self.glow_list = QuestHelper:CreateTable()
@ -700,8 +704,8 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
if self.next and self.objective and self.objective.cluster.solid and QuestHelper_Pref.zones == "next" then
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
if self.tri_c ~= c or self.tri_z ~= z then
local m, f = GetCurrentMapMF()
if self.tri_m ~= m or self.tri_f ~= f then
-- not entirely happy with this being here, but, welp
if not self.local_triangle_list then
self.local_triangle_list = QuestHelper:CreateTable()
@ -725,7 +729,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
end
end
self.tri_c, self.tri_z = c, z
self.tri_m, self.tri_f = m, f
else
if self.local_triangle_list then
while #self.local_triangle_list > 0 do
@ -804,7 +808,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
end
if self.glow_list then
for _, tri in ipairs(self.glow_list) do
tri:SetVertexColor(triangle_r, triangle_g, triangle_b, self.glow_pct*triangle_opacity)
tri:SetVertexColor(triangle_r, triangle_g, triangle_b, self.glow_pct*triangle_opacity)
end
end
if self.local_triangle_list then
@ -884,7 +888,7 @@ function QuestHelper:CreateWorldMapMinidad(objective, nxt)
self.dot:SetAllPoints()
self.dot:SetDrawLayer("BACKGROUND")
QuestHelper.Astrolabe:PlaceIconOnWorldMap(QuestHelper.map_overlay, self, QuestHelper.Astrolabe:FromAbsoluteContinentPosition(QuestHelper_ParentLookup[self.objective.p], self.objective.x, self.objective.y))
QuestHelper.Astrolabe:PlaceIconOnWorldMap(QuestHelper.map_overlay, self, self.objective.m, self.objective.f, self.objective.x, self.objective.y)
else
self.objective = nil
self:Hide()
@ -909,7 +913,7 @@ function QuestHelper:CreateWorldMapMinidad(objective, nxt)
function icon:OnEvent()
if self.objective then
QuestHelper.Astrolabe:PlaceIconOnWorldMap(QuestHelper.map_overlay, self, QuestHelper.Astrolabe:FromAbsoluteContinentPosition(QuestHelper_ParentLookup[self.objective.p], self.objective.x, self.objective.y))
QuestHelper.Astrolabe:PlaceIconOnWorldMap(QuestHelper.map_overlay, self, self.objective.m, self.objective.f, self.objective.x, self.objective.y)
else
self.objective = nil
self:Hide()
@ -984,12 +988,14 @@ function QuestHelper:InvokeWaypointCallbacks(c, z, x, y, desc)
end
end
--[[ According to grep, there are no calls to this function.
function QuestHelper:SetMinimapObject(minimap)
Minimap = minimap
QuestHelper.Astrolabe:SetMinimapObject(minimap)
QuestHelper.minimap_marker:SetParent(minimap)
QuestHelper.Astrolabe.processingFrame:SetParent(minimap)
end
--]]
--[[ Small parts of the arrow rendering code are thanks to Tomtom, with the following license:
@ -1102,7 +1108,7 @@ function QuestHelper:CreateMipmapDodad()
if edge then
local angle = QuestHelper.Astrolabe:GetDirectionToIcon(self)
if GetCVar("rotateMinimap") == "1" then
angle = angle + QuestHelper.Astrolabe:GetFacing()
angle = angle - GetPlayerFacing()
end
if elapsed then

Voir le fichier

@ -110,8 +110,8 @@ function rescan()
end
QH_AddCompletionNotifier(rescan)
QH_Event("WORLD_MAP_UPDATE", function ()
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
QH_Event("WORLD_MAP_UPDATE", function () -- NOTE: WILL NOT WORK UNTIL UPGRADE.LUA IS FIXED
local m, f = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
--print(c, z)
if not QuestHelper_IndexLookup[c] or not QuestHelper_IndexLookup[c][z] then return end
QuestHelper: Assert(QuestHelper_IndexLookup[c])

Voir le fichier

@ -511,7 +511,7 @@ end
-- NEEDS CONVERSION FOR Map, Floor.
local function AddLoc(self, index, x, y, w, why)
--[[ assert(not self.setup) ]]

Voir le fichier

@ -451,44 +451,11 @@ end
function load_graph_links()
local function convert_coordinate(coord)
QuestHelper: Assert(coord[1] and coord[2] and coord[3])
--[==[
-- I hate Blizzard... They can't make up their mind weather we are on TwilightHighlands or TwilightHiglands_terrain1, but we only seem to be on one or the other.
if coord[1] == 177 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 184
elseif coord[1] == 184 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 177
end
-- I hate Blizzard... They can't make up their mind weather we are on Hyjal or Hyjal_terrain1, but we only seem to be on one or the other.
if coord[1] == 198 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 185
elseif coord[1] == 185 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 198
end
-- I hate Blizzard... They can't make up their mind weather we are on Uldum or Uldum_terrain1, but we only seem to be on one or the other.
if coord[1] == 164 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 210
elseif coord[1] == 210 and not QuestHelper_ZoneLookup[coord[1]] then
coord[1] = 164
end
-- I hate Blizzard... They can't make up their mind whether we are on LostIsles, LostIsles_terrain1 or LostIsles_terrain2, but we only seem to be on one.
-- Create a lookup table.
local converter = {}
converter[181] = function() return convertLostIsles(181, 208, 209) end
converter[208] = function() return convertLostIsles(208, 181, 209) end
converter[209] = function() return convertLostIsles(209, 181, 208) end
-- Use the lookup table to get the real coordinate.
if converter[coord[1]] then coord[1] = converter[coord[1]]() end
]==]
local QHZL = QuestHelper_ZoneLookup
QuestHelper: Assert(QuestHelper_ZoneLookup[coord[1]], string.format("Coord[1] = %d", coord[1]))
local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(QuestHelper_ZoneLookup[coord[1]][1], QuestHelper_ZoneLookup[coord[1]][2], coord[2], coord[3])
-- QuestHelper: Assert(QuestHelper_ZoneLookup[coord[1]], string.format("Coord[1] = %d", coord[1]))
-- local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(QuestHelper_ZoneLookup[coord[1]][1], QuestHelper_ZoneLookup[coord[1]][2], coord[2], coord[3])
QuestHelper: Assert(c)
return {x = x, y = y, p = coord[1], c = c}
return {x = coord[2], y = coord[3], m = coord[1], f = coord[4] or 0}
end
local function do_routes(routes)
@ -499,8 +466,8 @@ QuestHelper:Assert(v[2], tostring(k) .. " is the key, v[2]. v[1] is " .. tostrin
local src = convert_coordinate(v[1])
local dst = convert_coordinate(v[2])
QuestHelper: Assert(src.x and dst.x)
src.map_desc = {QHFormat("WAYPOINT_REASON", QuestHelper_NameLookup[v[2][1]])}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QuestHelper_NameLookup[v[1][1]])}
src.map_desc = {QHFormat("WAYPOINT_REASON", "SOURCE")} --QuestHelper_NameLookup[v[2][1]])}
dst.map_desc = {QHFormat("WAYPOINT_REASON", "DEST")} --QuestHelper_NameLookup[v[1][1]])}
local rev_cost = v[3]
if v[4] then rev_cost = nil end
@ -531,8 +498,8 @@ QuestHelper:Assert(v[4], tostring(k) .. " is the key, v[4]-2.")
local src = convert_coordinate({v[1], v[3], v[4]})
local dst = convert_coordinate({v[1], v[3], v[4]})
dst.p = v[2]
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[v[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[v[1]]))}
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "BORDER SOURCE"))} --QuestHelper_NameLookup[v[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "BORDER DEST"))} --QuestHelper_NameLookup[v[1]]))}
QH_Graph_Plane_Makelink("static_transition", src, dst, 0, 0)
end
@ -541,8 +508,8 @@ QuestHelper:Assert(dark_portal_route[1], "DPR1")
QuestHelper:Assert(dark_portal_route[2], "DPR2")
local src = convert_coordinate(dark_portal_route[1])
local dst = convert_coordinate(dark_portal_route[2])
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[dark_portal_route[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[dark_portal_route[1]]))}
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "DKPTL SOURCE"))} --QuestHelper_NameLookup[dark_portal_route[2]]))}
dst.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", "DKPTL DEST"))} --QuestHelper_NameLookup[dark_portal_route[1]]))}
QH_Graph_Plane_Makelink("dark_portal", src, dst, 15, 15)
end
end

Voir le fichier

@ -182,7 +182,7 @@ QH_OnUpdate(function()
local rotatey = (GetCVar("rotateMinimap") == "0") and 0 or GetPlayerFacing()
rotatey = rotatey * 180 / 3.14159
-- WILL FAIL HERE.
local mapdiam = QuestHelper.Astrolabe:GetMapDiameter()
local minimap = QuestHelper.Astrolabe:GetMinimapObject()
local mapwid, maphei = minimap:GetWidth(), minimap:GetHeight()

Voir le fichier

@ -857,7 +857,7 @@ function Routing:RouteUpdateRoutine()
if not pos[1] -- Need a valid position, in case the player was dead when they loaded the game.
or not UnitIsDeadOrGhost("player") then
-- Don't update the player's position if they're dead, assume they'll be returning to their corpse.
pos[3], pos[4] = qh.Astrolabe:TranslateWorldMapPosition(qh.c, qh.z, qh.x, qh.y, qh.c, 0)
pos[3], pos[4] = qh.Astrolabe:TranslateWorldMapPosition(qh.m, qh.f, qh.x, qh.y, qh.m, 0)
--[[ assert(pos[3]) ]]
--[[ assert(pos[4]) ]]
pos[1] = qh.zone_nodes[qh.i]

Voir le fichier

@ -257,20 +257,13 @@ function QuestHelper:PercentString(pct)
end
function QuestHelper:PlayerPosition()
return self.i, self.x, self.y
return self.m, self.f, self.x, self.y
end
function QuestHelper:UnitPosition(unit)
local c, z, x, y = self.Astrolabe:GetUnitPosition(unit,true)
if c then
if z == 0 then
SetMapToCurrentZone()
z = GetCurrentMapZone()
if z ~= 0 then
x, y = self.Astrolabe:TranslateWorldMapPosition(c, 0, x, y, c, z)
end
end
return QuestHelper_IndexLookup[c][z], x, y
local m, f, x, y = self.Astrolabe:GetUnitPosition(unit,true)
if m then
return m, f, x, y
else
return self:PlayerPosition()
end
@ -290,14 +283,13 @@ function QuestHelper:Location_AbsoluteString(delayed, c, x, y)
return ("[|cffffffff%s/%s,%s,%s|r]"):format(delayed and "D" or "c", c and string.format("%d", c) or tostring(c), x and string.format("%.3f", x) or tostring(x), y and string.format("%.3f", y) or tostring(y))
end
function QuestHelper:Distance(i1, x1, y1, i2, x2, y2)
local p1, p2 = QuestHelper_ZoneLookup[i1], QuestHelper_ZoneLookup[i2]
return self.Astrolabe:ComputeDistance(p1[1], p1[2], x1, y1, p2[1], p2[2], x2, y2) or 10000
function QuestHelper:Distance(m1, x1, y1, m2, x2, y2)
return self.Astrolabe:ComputeDistance(m1, 0, x1, y1, m2, 0, x2, y2) or 10000
end
function QuestHelper:AppendPosition(list, index, x, y, w, min_dist)
if not x or not y or (x == 0 and y == 0) or x <= -0.1 or y <= -0.1 or x >= 1.1 or y >= 1.1 then
local nc, nz, nx, ny = self.Astrolabe:GetCurrentPlayerPosition()
local nm, nf, nx, ny = self.Astrolabe:GetCurrentPlayerPosition()
--self:AppendNotificationError("2008-10-6 nil-position", string.format("nilposition, %s %s %s %s vs %s %s", tostring(nc), tostring(nz), tostring(nx), tostring(ny), tostring(x), tostring(y))) -- We're just not worrying about this too much anymore. Slash and burn.
return list -- This isn't a real position.
end