A bunch of changes dealing with the replacement of Astrolabe.lua.
Cette révision appartient à :
Parent
302d44b8ac
révision
cea96d1c2b
|
@ -84,22 +84,23 @@ end
|
||||||
|
|
||||||
local msfires = {desc = QHText("FIND_CUSTOM_LOCATION"), tracker_desc = QHText("FIND_CUSTOM_LOCATION")}
|
local msfires = {desc = QHText("FIND_CUSTOM_LOCATION"), tracker_desc = QHText("FIND_CUSTOM_LOCATION")}
|
||||||
|
|
||||||
local function QH_FindCoord(locx, locy, locz, label)
|
local function QH_FindCoord(locx, locy, locm, locf, label)
|
||||||
if type(locz) ~= "number" then -- If it is a number, we are probably doing an elder right now.
|
-- Note: this part will not work until something is done about QuestHelper_NameLookup
|
||||||
label = locz .. " (" .. locx .. ", " .. locy .. ")"
|
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
|
for z, nam in pairs(QuestHelper_NameLookup) do
|
||||||
if nam:lower():find(locz:lower()) then
|
if nam:lower():find(locm:lower()) then
|
||||||
locz = z
|
locm = z
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(locz) == "number" then
|
if type(locm) == "number" then
|
||||||
if not custom_find[label] then
|
if not custom_find[label] then
|
||||||
local ec, ez = unpack(QuestHelper_ZoneLookup[locz])
|
local em, ef = locm, locf
|
||||||
local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(ec, ez, locx / 100, locy / 100)
|
local x, y = 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 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}
|
local cluster = {node}
|
||||||
node.cluster = cluster
|
node.cluster = cluster
|
||||||
|
|
||||||
|
@ -144,7 +145,7 @@ local elders = {
|
||||||
["Horde"] = { -- Achievement 914
|
["Horde"] = { -- Achievement 914
|
||||||
["Darkhorn"] = {321, 52, 60, 8677, 1991}, --"Orgrimmar 52 60",
|
["Darkhorn"] = {321, 52, 60, 8677, 1991}, --"Orgrimmar 52 60",
|
||||||
["Wheathoof"] = {362, 73.0, 23.3, 8678, 1993}, --"Thunder Bluff 73.0 23.3",
|
["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
|
["Kalimdor"] = { -- Achievement 911
|
||||||
["Bladeleaf"] = { 41, 56.8, 53.1, 8715, 1951}, --"Teldrassil 56.8 53.1",
|
["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
|
["Firebeard"] = {700, 51, 71, 29737, 18161}, -- Dunward Town Square, Dunward Ruins, Twilight Highlands
|
||||||
["Darkfeather"] = {700, 52, 33, 29736, 18162} -- Thundermar 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.
|
--[===[ 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
|
["Dungeons"] = { -- Achievement 910
|
||||||
["Wildmane"] = {,,,8676, 1910}, -- Zul'Farrak 34.52 39.35
|
["Wildmane"] = {,,,8676, 1910}, -- Zul'Farrak 34.52 39.35
|
||||||
|
@ -244,9 +247,9 @@ local function UpdateElders()
|
||||||
local elder, elderinfo
|
local elder, elderinfo
|
||||||
local qid = GetQuestID()
|
local qid = GetQuestID()
|
||||||
for elder, elderinfo in pairs(trackedElders) do
|
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
|
if id == qid then
|
||||||
QH_FindCoord(x, y, z, elder)
|
QH_FindCoord(x, y, m, 0, elder)
|
||||||
trackedElders[elder] = nil
|
trackedElders[elder] = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -259,7 +262,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
|
||||||
if elder_or_achievement == "CLEAR" then
|
if elder_or_achievement == "CLEAR" then
|
||||||
for elder, elderinfo in pairs(trackedElders) do
|
for elder, elderinfo in pairs(trackedElders) do
|
||||||
local z, x, y = unpack(elderinfo)
|
local z, x, y = unpack(elderinfo)
|
||||||
QH_FindCoord(x, y, z, elder)
|
QH_FindCoord(x, y, m, 0, elder)
|
||||||
end
|
end
|
||||||
|
|
||||||
trackedElders = {}
|
trackedElders = {}
|
||||||
|
@ -276,7 +279,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
|
||||||
end
|
end
|
||||||
|
|
||||||
for elder, elder_info in pairs(eldrs) do
|
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
|
local okToAdd = true
|
||||||
if forAchievement then
|
if forAchievement then
|
||||||
if aid then
|
if aid then
|
||||||
|
@ -290,7 +293,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
|
||||||
|
|
||||||
if not all_elders then
|
if not all_elders then
|
||||||
if achievement_match then -- just add it
|
if achievement_match then -- just add it
|
||||||
QH_FindCoord(locx, locy, locz, elder)
|
QH_FindCoord(locx, locy, locm, 0, elder)
|
||||||
if trackedElders[elder] then trackedElders[elder] = nil
|
if trackedElders[elder] then trackedElders[elder] = nil
|
||||||
else
|
else
|
||||||
trackedElders[elder] = elder_info
|
trackedElders[elder] = elder_info
|
||||||
|
@ -298,7 +301,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
|
||||||
end
|
end
|
||||||
elseif elder_or_achievement == string.upper(elder) then -- We have input and it's not an achievement, so it must be an elder.
|
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
|
elder_match = true
|
||||||
QH_FindCoord(locx, locy, locz, elder)
|
QH_FindCoord(locx, locy, locm, 0, elder)
|
||||||
if trackedElders[elder] then trackedElders[elder] = nil
|
if trackedElders[elder] then trackedElders[elder] = nil
|
||||||
else
|
else
|
||||||
trackedElders[elder] = elder_info
|
trackedElders[elder] = elder_info
|
||||||
|
@ -308,7 +311,7 @@ local function QH_FindElders(elder_or_achievement, all_elders, forAchievement)
|
||||||
break -- We've found him or her.
|
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.
|
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.
|
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
|
if trackedElders[elder] then trackedElders[elder] = nil
|
||||||
else
|
else
|
||||||
trackedElders[elder] = elder_info
|
trackedElders[elder] = elder_info
|
||||||
|
|
|
@ -8,24 +8,28 @@ local radius = ofs / 1.166666666666667;
|
||||||
local Minimap = _G.Minimap
|
local Minimap = _G.Minimap
|
||||||
|
|
||||||
-- These conversions are nasty, and this entire section needs a serious cleanup.
|
-- These conversions are nasty, and this entire section needs a serious cleanup.
|
||||||
|
local function GetCurrentMapMF()
|
||||||
|
return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
|
||||||
|
end
|
||||||
local function convertLocation(p)
|
local function convertLocation(p)
|
||||||
QuestHelper: Assert(p, "Wait. What? This is checked before calling this function.")
|
QuestHelper: Assert(p, "Wait. What? This is checked before calling this function.")
|
||||||
QuestHelper: Assert(p.c, "p.c is nil")
|
QuestHelper: Assert(p.m, "No Map ID")
|
||||||
QuestHelper: Assert(p.x, "p.x is nil")
|
QuestHelper: Assert(p.f, "No Floor")
|
||||||
QuestHelper: Assert(p.y, "p.y is nil")
|
QuestHelper: Assert(p.x, "No X")
|
||||||
return QuestHelper.Astrolabe:FromAbsoluteContinentPosition(p.c, p.x, p.y)
|
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
|
end
|
||||||
|
|
||||||
local function convertLocationToScreen(p, c, z)
|
local function convertLocationToScreen(p, m, f)
|
||||||
local pc, _, px, py = convertLocation(p)
|
local pm, _, px, py = convertLocation(p)
|
||||||
local ox, oy = QuestHelper.Astrolabe:TranslateWorldMapPosition(pc, 0, px, py, c, z)
|
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))
|
--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
|
return ox, oy
|
||||||
end
|
end
|
||||||
|
|
||||||
local function convertRawToScreen(tc, x, y, c, z)
|
local function convertRawToScreen(tm, x, y, m, f)
|
||||||
local rc, _, rx, ry = QuestHelper.Astrolabe:FromAbsoluteContinentPosition(tc, x, y)
|
local rm, _, rx, ry = tm, x, y --QuestHelper.Astrolabe:FromAbsoluteContinentPosition(tc, x, y)
|
||||||
return QuestHelper.Astrolabe:TranslateWorldMapPosition(rc, 0, rx, ry, c, z)
|
return QuestHelper.Astrolabe:TranslateWorldMapPosition(rm, 0, rx, ry, m, f)
|
||||||
end
|
end
|
||||||
|
|
||||||
local scrolf = CreateFrame("SCROLLFRAME", nil, WorldMapButton)
|
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 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
|
local remainder = self.phase
|
||||||
|
|
||||||
for i, pos in ipairs(points) do
|
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
|
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
|
for i, obj in ipairs(self.route) do
|
||||||
--QuestHelper:TextOut(string.format("%s", tostring(obj)))
|
--QuestHelper:TextOut(string.format("%s", tostring(obj)))
|
||||||
|
@ -229,7 +233,7 @@ function QuestHelper:CreateWorldMapWalker()
|
||||||
obj.travel_time = travel_time]]
|
obj.travel_time = travel_time]]
|
||||||
if i > 1 then -- skip the start location
|
if i > 1 then -- skip the start location
|
||||||
local t = self.frame:CreateTable()
|
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)
|
table.insert(points, t)
|
||||||
|
|
||||||
|
@ -287,7 +291,7 @@ end
|
||||||
|
|
||||||
function QuestHelper:GetOverlapObjectives(obj)
|
function QuestHelper:GetOverlapObjectives(obj)
|
||||||
local w, h = self.map_overlay:GetWidth(), self.map_overlay:GetHeight()
|
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
|
local list = self.overlap_list
|
||||||
|
|
||||||
|
@ -314,7 +318,7 @@ function QuestHelper:GetOverlapObjectives(obj)
|
||||||
if o == obj then
|
if o == obj then
|
||||||
table.insert(list, o)
|
table.insert(list, o)
|
||||||
else
|
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
|
if x and y and x > 0 and y > 0 and x < 1 and y < 1 then
|
||||||
x, y = x*w, y*h
|
x, y = x*w, y*h
|
||||||
|
@ -528,7 +532,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
local triangle_opacity = 0.6
|
local triangle_opacity = 0.6
|
||||||
|
|
||||||
function icon:CreateTriangles(solid, tritarget, tristartat, linetarget, linestartat, parent)
|
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 function makeline(ax, ay, bx, by)
|
||||||
local tri = linetarget[linestartat]
|
local tri = linetarget[linestartat]
|
||||||
|
@ -545,10 +549,10 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
|
|
||||||
for _, v in ipairs(solid) do
|
for _, v in ipairs(solid) do
|
||||||
local adjx, adjy = v[1], v[2]
|
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)
|
--print("matchup", c, v.continent, x, y)
|
||||||
if x and y then
|
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 linemode = false
|
||||||
|
|
||||||
local lidx = 5
|
local lidx = 5
|
||||||
|
@ -557,13 +561,13 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
if v[lidx] == "d" then
|
if v[lidx] == "d" then
|
||||||
QuestHelper: Assert(type(lidx) == "number") -- what
|
QuestHelper: Assert(type(lidx) == "number") -- what
|
||||||
lidx = lidx + 1
|
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 = convertRawToScreen(v.continent, adjx + v[lidx + 2], adjy + v[lidx + 3], c, z)
|
lx, ly = convertRawToScreen(v.map, adjx + v[lidx + 2], adjy + v[lidx + 3], m, f)
|
||||||
lidx = lidx + 4
|
lidx = lidx + 4
|
||||||
elseif v[lidx] == "l" then
|
elseif v[lidx] == "l" then
|
||||||
linemode = true
|
linemode = true
|
||||||
lidx = lidx + 1
|
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
|
lx, ly = x, y
|
||||||
lidx = lidx + 2
|
lidx = lidx + 2
|
||||||
else
|
else
|
||||||
|
@ -571,7 +575,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not linemode then
|
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]
|
local tri = tritarget[tristartat]
|
||||||
if not tri then
|
if not tri then
|
||||||
|
@ -587,7 +591,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
lx, ly = tx, ty
|
lx, ly = tx, ty
|
||||||
lidx = lidx + 2
|
lidx = lidx + 2
|
||||||
else
|
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)
|
makeline(x, y, tx, ty)
|
||||||
|
|
||||||
|
@ -608,8 +612,8 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
|
|
||||||
function icon:SetGlow(list)
|
function icon:SetGlow(list)
|
||||||
local w, h = QuestHelper.map_overlay:GetWidth(), QuestHelper.map_overlay:GetHeight()
|
local w, h = QuestHelper.map_overlay:GetWidth(), QuestHelper.map_overlay:GetHeight()
|
||||||
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
|
local m, f = GetCurrentMapMF()
|
||||||
local zw = QuestHelper.Astrolabe:GetZoneWidth(c, z)
|
local _, _, zw = QuestHelper.Astrolabe:GetMapInfo(m, f)
|
||||||
|
|
||||||
local solids = {}
|
local solids = {}
|
||||||
|
|
||||||
|
@ -620,7 +624,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
--print("solidified", #v.cluster.solid)
|
--print("solidified", #v.cluster.solid)
|
||||||
solids[v.cluster.solid] = true
|
solids[v.cluster.solid] = true
|
||||||
else
|
else
|
||||||
local x, y = convertLocationToScreen(v.loc, c, z)
|
local x, y = convertLocationToScreen(v.loc, m, f)
|
||||||
if x and y then
|
if x and y then
|
||||||
if not self.glow_list then
|
if not self.glow_list then
|
||||||
self.glow_list = QuestHelper:CreateTable()
|
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
|
if self.next and self.objective and self.objective.cluster.solid and QuestHelper_Pref.zones == "next" then
|
||||||
|
|
||||||
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
|
local m, f = GetCurrentMapMF()
|
||||||
if self.tri_c ~= c or self.tri_z ~= z then
|
if self.tri_m ~= m or self.tri_f ~= f then
|
||||||
-- not entirely happy with this being here, but, welp
|
-- not entirely happy with this being here, but, welp
|
||||||
if not self.local_triangle_list then
|
if not self.local_triangle_list then
|
||||||
self.local_triangle_list = QuestHelper:CreateTable()
|
self.local_triangle_list = QuestHelper:CreateTable()
|
||||||
|
@ -725,7 +729,7 @@ function QuestHelper:CreateWorldMapDodad(objective, nxt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.tri_c, self.tri_z = c, z
|
self.tri_m, self.tri_f = m, f
|
||||||
else
|
else
|
||||||
if self.local_triangle_list then
|
if self.local_triangle_list then
|
||||||
while #self.local_triangle_list > 0 do
|
while #self.local_triangle_list > 0 do
|
||||||
|
@ -884,7 +888,7 @@ function QuestHelper:CreateWorldMapMinidad(objective, nxt)
|
||||||
self.dot:SetAllPoints()
|
self.dot:SetAllPoints()
|
||||||
self.dot:SetDrawLayer("BACKGROUND")
|
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
|
else
|
||||||
self.objective = nil
|
self.objective = nil
|
||||||
self:Hide()
|
self:Hide()
|
||||||
|
@ -909,7 +913,7 @@ function QuestHelper:CreateWorldMapMinidad(objective, nxt)
|
||||||
|
|
||||||
function icon:OnEvent()
|
function icon:OnEvent()
|
||||||
if self.objective then
|
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
|
else
|
||||||
self.objective = nil
|
self.objective = nil
|
||||||
self:Hide()
|
self:Hide()
|
||||||
|
@ -984,12 +988,14 @@ function QuestHelper:InvokeWaypointCallbacks(c, z, x, y, desc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[ According to grep, there are no calls to this function.
|
||||||
function QuestHelper:SetMinimapObject(minimap)
|
function QuestHelper:SetMinimapObject(minimap)
|
||||||
Minimap = minimap
|
Minimap = minimap
|
||||||
QuestHelper.Astrolabe:SetMinimapObject(minimap)
|
QuestHelper.Astrolabe:SetMinimapObject(minimap)
|
||||||
QuestHelper.minimap_marker:SetParent(minimap)
|
QuestHelper.minimap_marker:SetParent(minimap)
|
||||||
QuestHelper.Astrolabe.processingFrame:SetParent(minimap)
|
QuestHelper.Astrolabe.processingFrame:SetParent(minimap)
|
||||||
end
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
--[[ Small parts of the arrow rendering code are thanks to Tomtom, with the following license:
|
--[[ 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
|
if edge then
|
||||||
local angle = QuestHelper.Astrolabe:GetDirectionToIcon(self)
|
local angle = QuestHelper.Astrolabe:GetDirectionToIcon(self)
|
||||||
if GetCVar("rotateMinimap") == "1" then
|
if GetCVar("rotateMinimap") == "1" then
|
||||||
angle = angle + QuestHelper.Astrolabe:GetFacing()
|
angle = angle - GetPlayerFacing()
|
||||||
end
|
end
|
||||||
|
|
||||||
if elapsed then
|
if elapsed then
|
||||||
|
|
|
@ -110,8 +110,8 @@ function rescan()
|
||||||
end
|
end
|
||||||
QH_AddCompletionNotifier(rescan)
|
QH_AddCompletionNotifier(rescan)
|
||||||
|
|
||||||
QH_Event("WORLD_MAP_UPDATE", function ()
|
QH_Event("WORLD_MAP_UPDATE", function () -- NOTE: WILL NOT WORK UNTIL UPGRADE.LUA IS FIXED
|
||||||
local c, z = QuestHelper.Astrolabe:GetCurrentVirtualMapCZ()
|
local m, f = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
|
||||||
--print(c, z)
|
--print(c, z)
|
||||||
if not QuestHelper_IndexLookup[c] or not QuestHelper_IndexLookup[c][z] then return end
|
if not QuestHelper_IndexLookup[c] or not QuestHelper_IndexLookup[c][z] then return end
|
||||||
QuestHelper: Assert(QuestHelper_IndexLookup[c])
|
QuestHelper: Assert(QuestHelper_IndexLookup[c])
|
||||||
|
|
|
@ -511,7 +511,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- NEEDS CONVERSION FOR Map, Floor.
|
||||||
local function AddLoc(self, index, x, y, w, why)
|
local function AddLoc(self, index, x, y, w, why)
|
||||||
--[[ assert(not self.setup) ]]
|
--[[ assert(not self.setup) ]]
|
||||||
|
|
||||||
|
|
|
@ -451,44 +451,11 @@ end
|
||||||
function load_graph_links()
|
function load_graph_links()
|
||||||
local function convert_coordinate(coord)
|
local function convert_coordinate(coord)
|
||||||
QuestHelper: Assert(coord[1] and coord[2] and coord[3])
|
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
|
local QHZL = QuestHelper_ZoneLookup
|
||||||
QuestHelper: Assert(QuestHelper_ZoneLookup[coord[1]], string.format("Coord[1] = %d", coord[1]))
|
-- 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])
|
-- local c, x, y = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(QuestHelper_ZoneLookup[coord[1]][1], QuestHelper_ZoneLookup[coord[1]][2], coord[2], coord[3])
|
||||||
QuestHelper: Assert(c)
|
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
|
end
|
||||||
|
|
||||||
local function do_routes(routes)
|
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 src = convert_coordinate(v[1])
|
||||||
local dst = convert_coordinate(v[2])
|
local dst = convert_coordinate(v[2])
|
||||||
QuestHelper: Assert(src.x and dst.x)
|
QuestHelper: Assert(src.x and dst.x)
|
||||||
src.map_desc = {QHFormat("WAYPOINT_REASON", QuestHelper_NameLookup[v[2][1]])}
|
src.map_desc = {QHFormat("WAYPOINT_REASON", "SOURCE")} --QuestHelper_NameLookup[v[2][1]])}
|
||||||
dst.map_desc = {QHFormat("WAYPOINT_REASON", QuestHelper_NameLookup[v[1][1]])}
|
dst.map_desc = {QHFormat("WAYPOINT_REASON", "DEST")} --QuestHelper_NameLookup[v[1][1]])}
|
||||||
|
|
||||||
local rev_cost = v[3]
|
local rev_cost = v[3]
|
||||||
if v[4] then rev_cost = nil end
|
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 src = convert_coordinate({v[1], v[3], v[4]})
|
||||||
local dst = convert_coordinate({v[1], v[3], v[4]})
|
local dst = convert_coordinate({v[1], v[3], v[4]})
|
||||||
dst.p = v[2]
|
dst.p = v[2]
|
||||||
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[v[2]]))}
|
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", QuestHelper_NameLookup[v[1]]))}
|
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)
|
QH_Graph_Plane_Makelink("static_transition", src, dst, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -541,8 +508,8 @@ QuestHelper:Assert(dark_portal_route[1], "DPR1")
|
||||||
QuestHelper:Assert(dark_portal_route[2], "DPR2")
|
QuestHelper:Assert(dark_portal_route[2], "DPR2")
|
||||||
local src = convert_coordinate(dark_portal_route[1])
|
local src = convert_coordinate(dark_portal_route[1])
|
||||||
local dst = convert_coordinate(dark_portal_route[2])
|
local dst = convert_coordinate(dark_portal_route[2])
|
||||||
src.map_desc = {QHFormat("WAYPOINT_REASON", QHFormat("ZONE_BORDER_SIMPLE", QuestHelper_NameLookup[dark_portal_route[2]]))}
|
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", QuestHelper_NameLookup[dark_portal_route[1]]))}
|
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)
|
QH_Graph_Plane_Makelink("dark_portal", src, dst, 15, 15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -182,7 +182,7 @@ QH_OnUpdate(function()
|
||||||
|
|
||||||
local rotatey = (GetCVar("rotateMinimap") == "0") and 0 or GetPlayerFacing()
|
local rotatey = (GetCVar("rotateMinimap") == "0") and 0 or GetPlayerFacing()
|
||||||
rotatey = rotatey * 180 / 3.14159
|
rotatey = rotatey * 180 / 3.14159
|
||||||
|
-- WILL FAIL HERE.
|
||||||
local mapdiam = QuestHelper.Astrolabe:GetMapDiameter()
|
local mapdiam = QuestHelper.Astrolabe:GetMapDiameter()
|
||||||
local minimap = QuestHelper.Astrolabe:GetMinimapObject()
|
local minimap = QuestHelper.Astrolabe:GetMinimapObject()
|
||||||
local mapwid, maphei = minimap:GetWidth(), minimap:GetHeight()
|
local mapwid, maphei = minimap:GetWidth(), minimap:GetHeight()
|
||||||
|
|
|
@ -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.
|
if not pos[1] -- Need a valid position, in case the player was dead when they loaded the game.
|
||||||
or not UnitIsDeadOrGhost("player") then
|
or not UnitIsDeadOrGhost("player") then
|
||||||
-- Don't update the player's position if they're dead, assume they'll be returning to their corpse.
|
-- 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[3]) ]]
|
||||||
--[[ assert(pos[4]) ]]
|
--[[ assert(pos[4]) ]]
|
||||||
pos[1] = qh.zone_nodes[qh.i]
|
pos[1] = qh.zone_nodes[qh.i]
|
||||||
|
|
|
@ -257,20 +257,13 @@ function QuestHelper:PercentString(pct)
|
||||||
end
|
end
|
||||||
|
|
||||||
function QuestHelper:PlayerPosition()
|
function QuestHelper:PlayerPosition()
|
||||||
return self.i, self.x, self.y
|
return self.m, self.f, self.x, self.y
|
||||||
end
|
end
|
||||||
|
|
||||||
function QuestHelper:UnitPosition(unit)
|
function QuestHelper:UnitPosition(unit)
|
||||||
local c, z, x, y = self.Astrolabe:GetUnitPosition(unit,true)
|
local m, f, x, y = self.Astrolabe:GetUnitPosition(unit,true)
|
||||||
if c then
|
if m then
|
||||||
if z == 0 then
|
return m, f, x, y
|
||||||
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
|
|
||||||
else
|
else
|
||||||
return self:PlayerPosition()
|
return self:PlayerPosition()
|
||||||
end
|
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))
|
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
|
end
|
||||||
|
|
||||||
function QuestHelper:Distance(i1, x1, y1, i2, x2, y2)
|
function QuestHelper:Distance(m1, x1, y1, m2, x2, y2)
|
||||||
local p1, p2 = QuestHelper_ZoneLookup[i1], QuestHelper_ZoneLookup[i2]
|
return self.Astrolabe:ComputeDistance(m1, 0, x1, y1, m2, 0, x2, y2) or 10000
|
||||||
return self.Astrolabe:ComputeDistance(p1[1], p1[2], x1, y1, p2[1], p2[2], x2, y2) or 10000
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function QuestHelper:AppendPosition(list, index, x, y, w, min_dist)
|
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
|
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.
|
--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.
|
return list -- This isn't a real position.
|
||||||
end
|
end
|
||||||
|
|
Référencer dans un nouveau ticket