A bunch more changes dealing with the replacement of Astrolabe.lua. These make QH load. No other tests have been performed.
Cette révision appartient à :
Parent
cea96d1c2b
révision
1daf6d747c
|
@ -160,17 +160,17 @@ function QH_Arrow_SetTextScale(scale)
|
||||||
wayframe.tta:SetFont(default_font_name, default_font_size * scale, default_font_flags)
|
wayframe.tta:SetFont(default_font_name, default_font_size * scale, default_font_flags)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function wpupdate(c, z, x, y, desc)
|
local function wpupdate(m, f, x, y, desc)
|
||||||
if c then
|
if m then
|
||||||
QuestHelper: Assert(z)
|
QuestHelper: Assert(f)
|
||||||
QuestHelper: Assert(x)
|
QuestHelper: Assert(x)
|
||||||
QuestHelper: Assert(y)
|
QuestHelper: Assert(y)
|
||||||
else
|
else
|
||||||
QuestHelper: Assert(not z)
|
QuestHelper: Assert(not f)
|
||||||
QuestHelper: Assert(not x)
|
QuestHelper: Assert(not x)
|
||||||
QuestHelper: Assert(not y)
|
QuestHelper: Assert(not y)
|
||||||
end
|
end
|
||||||
active_point.c, active_point.z, active_point.x, active_point.y = c, z, x, y
|
active_point.m, active_point.f, active_point.x, active_point.y = m, f, x, y
|
||||||
wayframe.title:SetText(desc)
|
wayframe.title:SetText(desc)
|
||||||
wayframe:Show()
|
wayframe:Show()
|
||||||
OnUpdate()
|
OnUpdate()
|
||||||
|
@ -199,7 +199,6 @@ OnUpdate = function()
|
||||||
|
|
||||||
local dist, dx, dy = QuestHelper.Astrolabe:ComputeDistance(QuestHelper.collect_rm, QuestHelper.collect_rf, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.m, active_point.f, active_point.x, active_point.y)
|
local dist, dx, dy = QuestHelper.Astrolabe:ComputeDistance(QuestHelper.collect_rm, QuestHelper.collect_rf, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.m, active_point.f, active_point.x, active_point.y)
|
||||||
--print(QuestHelper.collect_rc, QuestHelper.collect_rz, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.c, active_point.z, active_point.x, active_point.y)
|
--print(QuestHelper.collect_rc, QuestHelper.collect_rz, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.c, active_point.z, active_point.x, active_point.y)
|
||||||
|
|
||||||
local text = ""
|
local text = ""
|
||||||
|
|
||||||
if dist then
|
if dist then
|
||||||
|
@ -233,7 +232,7 @@ OnUpdate = function()
|
||||||
local xend = ((column + 1) * 53) / 512
|
local xend = ((column + 1) * 53) / 512
|
||||||
local yend = ((row + 1) * 70) / 512
|
local yend = ((row + 1) * 70) / 512
|
||||||
arrow:SetTexCoord(xstart,xend,ystart,yend)
|
arrow:SetTexCoord(xstart,xend,ystart,yend)
|
||||||
else
|
elseif dist then
|
||||||
if showDownArrow then
|
if showDownArrow then
|
||||||
showDownArrow = false
|
showDownArrow = false
|
||||||
QH_Arrow_SetScale()
|
QH_Arrow_SetScale()
|
||||||
|
@ -247,7 +246,7 @@ OnUpdate = function()
|
||||||
angle = angle - player
|
angle = angle - player
|
||||||
|
|
||||||
local perc = math.abs((math.pi - math.abs(angle)) / math.pi)
|
local perc = math.abs((math.pi - math.abs(angle)) / math.pi)
|
||||||
if perc > 1 then perc = 2 - perc end -- siiigh
|
if perc > 1 then perc = 2 - perc end -- siiigh
|
||||||
|
|
||||||
local gr,gg,gb = 0, 1, 0
|
local gr,gg,gb = 0, 1, 0
|
||||||
local mr,mg,mb = 1, 1, 0
|
local mr,mg,mb = 1, 1, 0
|
||||||
|
|
|
@ -5,7 +5,8 @@ QuestHelper_File["core.lua"] = "4.0.1.$svnversion$"
|
||||||
QuestHelper_Loadtime["core.lua"] = GetTime()
|
QuestHelper_Loadtime["core.lua"] = GetTime()
|
||||||
|
|
||||||
|
|
||||||
QuestHelper.Astrolabe = QH_Astrolabe_Ready and DongleStub("Astrolabe-1.0")
|
--QuestHelper.Astrolabe = QH_Astrolabe_Ready and DongleStub("Astrolabe-1.0")
|
||||||
|
QuestHelper.Astrolabe = DongleStub("Astrolabe-1.0")
|
||||||
local walker = QuestHelper:CreateWorldMapWalker()
|
local walker = QuestHelper:CreateWorldMapWalker()
|
||||||
QuestHelper.minimap_marker = QuestHelper:CreateMipmapDodad()
|
QuestHelper.minimap_marker = QuestHelper:CreateMipmapDodad()
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ local function convertLocationToScreen(p, m, f)
|
||||||
local pm, _, px, py = convertLocation(p)
|
local pm, _, px, py = convertLocation(p)
|
||||||
local ox, oy = QuestHelper.Astrolabe:TranslateWorldMapPosition(pm, 0, px, py, m, f)
|
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))
|
||||||
|
assert(ox)
|
||||||
|
assert(oy)
|
||||||
return ox, oy
|
return ox, oy
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -938,7 +940,7 @@ function QuestHelper:CreateWorldMapMinidad(objective, nxt)
|
||||||
end
|
end
|
||||||
|
|
||||||
local callbacks = {}
|
local callbacks = {}
|
||||||
local last_c, last_z, last_x, last_y, last_desc
|
local last_m, last_f, last_x, last_y, last_desc
|
||||||
|
|
||||||
function QuestHelper:AddWaypointCallback(func, ...)
|
function QuestHelper:AddWaypointCallback(func, ...)
|
||||||
local cb = self:CreateTable()
|
local cb = self:CreateTable()
|
||||||
|
@ -947,13 +949,13 @@ function QuestHelper:AddWaypointCallback(func, ...)
|
||||||
cb.len = len
|
cb.len = len
|
||||||
cb.func = func
|
cb.func = func
|
||||||
for i = 1,len do cb[i] = select(i, ...) end
|
for i = 1,len do cb[i] = select(i, ...) end
|
||||||
cb[len+1] = last_c
|
cb[len+1] = last_m
|
||||||
cb[len+2] = last_z
|
cb[len+2] = last_f
|
||||||
cb[len+3] = last_x
|
cb[len+3] = last_x
|
||||||
cb[len+4] = last_y
|
cb[len+4] = last_y
|
||||||
cb[len+5] = last_desc
|
cb[len+5] = last_desc
|
||||||
|
|
||||||
if last_c then
|
if last_m then
|
||||||
func(unpack(cb, 1, len+5))
|
func(unpack(cb, 1, len+5))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -965,20 +967,22 @@ function QuestHelper:RemoveWaypointCallback(cb)
|
||||||
self:ReleaseTable(cb)
|
self:ReleaseTable(cb)
|
||||||
end
|
end
|
||||||
|
|
||||||
function QuestHelper:InvokeWaypointCallbacks(c, z, x, y, desc)
|
function QuestHelper:InvokeWaypointCallbacks(m, f, x, y, desc)
|
||||||
QuestHelper: Assert(not c or type(c) == "number")
|
QuestHelper: Assert(not m or type(m) == "number")
|
||||||
QuestHelper: Assert(not z or type(z) == "number")
|
QuestHelper: Assert(not f or type(f) == "number")
|
||||||
QuestHelper: Assert(not x or type(x) == "number")
|
QuestHelper: Assert(not x or type(x) == "number")
|
||||||
QuestHelper: Assert(not y or type(y) == "number")
|
QuestHelper: Assert(not y or type(y) == "number")
|
||||||
if c == last_c and z == last_z and desc == last_desc and not x and not y then x, y = last_x, last_y end -- sometimes we may not have up-to-date location, but could still in theory be pointing at the same spot
|
|
||||||
|
|
||||||
if not c or (x and y) then
|
--assert(m or last_m, tostring(m) .. " " .. tostring(last_m)) -- ok, both are nil, which is why line arrow:202 fails.
|
||||||
if c ~= last_c or z ~= last_z or x ~= last_x or y ~= last_y or desc ~= last_desc then
|
if m == last_m and f == last_f and desc == last_desc and not x and not y then x, y = last_x, last_y end -- sometimes we may not have up-to-date location, but could still in theory be pointing at the same spot
|
||||||
last_c, last_z, last_x, last_y, last_desc = c, z, x, y, desc
|
|
||||||
|
if not m or (x and y) then
|
||||||
|
if m ~= last_m or f ~= last_f or x ~= last_x or y ~= last_y or desc ~= last_desc then
|
||||||
|
last_m, last_f, last_x, last_y, last_desc = m, f, x, y, desc
|
||||||
for cb in pairs(callbacks) do
|
for cb in pairs(callbacks) do
|
||||||
local len = cb.len
|
local len = cb.len
|
||||||
cb[len+1] = c
|
cb[len+1] = m
|
||||||
cb[len+2] = z
|
cb[len+2] = f
|
||||||
cb[len+3] = x
|
cb[len+3] = x
|
||||||
cb[len+4] = y
|
cb[len+4] = y
|
||||||
cb[len+5] = desc
|
cb[len+5] = desc
|
||||||
|
@ -1050,11 +1054,11 @@ function QuestHelper:CreateMipmapDodad()
|
||||||
icon.bg:SetAllPoints()
|
icon.bg:SetAllPoints()
|
||||||
|
|
||||||
function icon:OnUpdate(elapsed)
|
function icon:OnUpdate(elapsed)
|
||||||
local c, z, x, y, textdesc
|
local m, f, x, y, textdesc
|
||||||
if self.obj then
|
if self.obj then
|
||||||
c, z = QuestHelper.collect_rc, QuestHelper.collect_rz
|
m, f = QuestHelper.collect_rm, QuestHelper.collect_rf
|
||||||
if c and z then
|
if m and f then
|
||||||
x, y = convertLocationToScreen(self.obj.loc, c, z)
|
x, y = convertLocationToScreen(self.obj.loc, m, f)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.obj.map_desc_chain then
|
if self.obj.map_desc_chain then
|
||||||
|
@ -1069,14 +1073,14 @@ function QuestHelper:CreateMipmapDodad()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
QuestHelper: Assert(not c or type(c) == "number")
|
QuestHelper: Assert(not m or type(m) == "number")
|
||||||
QuestHelper: Assert(not z or type(z) == "number")
|
QuestHelper: Assert(not f or type(f) == "number")
|
||||||
|
|
||||||
-- Deal with waypoint callbacks
|
-- Deal with waypoint callbacks
|
||||||
if QuestHelper_Pref.hide or UnitIsDeadOrGhost("player") and not QuestHelper.InBrokenInstance then
|
if QuestHelper_Pref.hide or UnitIsDeadOrGhost("player") and not QuestHelper.InBrokenInstance then
|
||||||
QuestHelper:InvokeWaypointCallbacks()
|
QuestHelper:InvokeWaypointCallbacks()
|
||||||
else
|
else
|
||||||
QuestHelper:InvokeWaypointCallbacks(c, z, x, y, textdesc)
|
QuestHelper:InvokeWaypointCallbacks(m, f, x, y, textdesc)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.obj and not QuestHelper.InBrokenInstance then
|
if self.obj and not QuestHelper.InBrokenInstance then
|
||||||
|
|
|
@ -287,9 +287,16 @@ local function FinalProblemChecks(uninstallederr, file_problem_version)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not DongleStub or not QH_Astrolabe_Ready then
|
if not DongleStub then
|
||||||
|
QH_fixedmessage("NOT_UNZIPPED_CORRECTLY")
|
||||||
|
QuestHelber_ErrorCatcher_ExplicitError(false, "no DongleStub")
|
||||||
|
QuestHelper = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if not QuestHelper.Astrolabe then
|
||||||
QH_fixedmessage(QHText("NOT_UNZIPPED_CORRECTLY"))
|
QH_fixedmessage(QHText("NOT_UNZIPPED_CORRECTLY"))
|
||||||
QuestHelper_ErrorCatcher_ExplicitError(false, "not-unzipped-properly")
|
QuestHelper_ErrorCatcher_ExplicitError(false, "no QH_Astrolabe_Ready")
|
||||||
QuestHelper = nil -- Just in case anybody else is checking for us, we're not home
|
QuestHelper = nil -- Just in case anybody else is checking for us, we're not home
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Référencer dans un nouveau ticket