fix syntax of minetest.after():cancel()
This commit is contained in:
parent
c4665b2eb6
commit
67b31d7d6d
4
init.lua
4
init.lua
@ -92,7 +92,7 @@ local function remove_announcement(announcement)
|
|||||||
hud:hide(player)
|
hud:hide(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
announcement.timeout_job.cancel()
|
announcement.timeout_job:cancel()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ local function post_announcement(announcement)
|
|||||||
announcement.message .. " " ..
|
announcement.message .. " " ..
|
||||||
minetest.pos_to_string(rounded_pos)
|
minetest.pos_to_string(rounded_pos)
|
||||||
chat_message = minetest.colorize(announcement.message_color, chat_message)
|
chat_message = minetest.colorize(announcement.message_color, chat_message)
|
||||||
|
|
||||||
|
|
||||||
if type(announcement.message_scope) == "table" then
|
if type(announcement.message_scope) == "table" then
|
||||||
for _,player_name in ipairs(announcement.message_scope) do
|
for _,player_name in ipairs(announcement.message_scope) do
|
||||||
|
@ -84,7 +84,7 @@ function IconWaypointHUD:new(point_pos, label, label_color, icon, icon_scale, ic
|
|||||||
}
|
}
|
||||||
self.__index = self
|
self.__index = self
|
||||||
setmetatable(w, self)
|
setmetatable(w, self)
|
||||||
|
|
||||||
w.huddef_label = {
|
w.huddef_label = {
|
||||||
hud_elem_type = "waypoint",
|
hud_elem_type = "waypoint",
|
||||||
name = label,
|
name = label,
|
||||||
@ -107,7 +107,7 @@ function IconWaypointHUD:new(point_pos, label, label_color, icon, icon_scale, ic
|
|||||||
--precision = WAYPOINT_PRECISION,
|
--precision = WAYPOINT_PRECISION,
|
||||||
--number = waypoint_color,
|
--number = waypoint_color,
|
||||||
}
|
}
|
||||||
|
|
||||||
return w
|
return w
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ function CompassHUD:new(size, alignment, direction, icon_format, icon_color, qua
|
|||||||
alignment = alignment,
|
alignment = alignment,
|
||||||
dir = 1,
|
dir = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -201,12 +201,12 @@ function WaypointHUD:new(player, point_pos,
|
|||||||
text = "waypoint_announce_background.png",
|
text = "waypoint_announce_background.png",
|
||||||
alignment = alignment,
|
alignment = alignment,
|
||||||
})
|
})
|
||||||
|
|
||||||
w.waypoint_hud = IconWaypointHUD:new(point_pos, label, label_color, point_icon, point_icon_scale, point_color)
|
w.waypoint_hud = IconWaypointHUD:new(point_pos, label, label_color, point_icon, point_icon_scale, point_color)
|
||||||
|
|
||||||
local d = vector.subtract(point_pos, player:get_pos())
|
local d = vector.subtract(point_pos, player:get_pos())
|
||||||
w.compass_hud = CompassHUD:new(size, alignment, d, arrow_icon_format, arrow_icon_color, quad_steps)
|
w.compass_hud = CompassHUD:new(size, alignment, d, arrow_icon_format, arrow_icon_color, quad_steps)
|
||||||
|
|
||||||
return w
|
return w
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ function WaypointHUD:hide(player)
|
|||||||
self.compass_hud:hide(player)
|
self.compass_hud:hide(player)
|
||||||
player:hud_remove(self.background)
|
player:hud_remove(self.background)
|
||||||
if self.auto_update_job then
|
if self.auto_update_job then
|
||||||
self.auto_update_job.cancel()
|
self.auto_update_job:cancel()
|
||||||
self.auto_update_job = nil
|
self.auto_update_job = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user