optionally depend on waypoint_announce; use hook to update recent

This commit is contained in:
whosit 2023-05-14 17:47:32 +03:00
parent 73bb4a1eab
commit 6c369e2b6b
2 changed files with 13 additions and 0 deletions

View File

@ -629,6 +629,15 @@ end
-- -- Usage example:
-- waypoint_compass.add_point_to_recent_personal('singleplayer', {x=0,y=1,z=2}, "death", "from lava")
if waypoint_announce and waypoint_announce.post_announcement_hooks then
local _announcement_callback = function(announcer_name, message, pointed_pos)
waypoint_compass.add_point_to_recent_global(pointed_pos, announcer_name, message)
end
local hooks = waypoint_announce.post_announcement_hooks
hooks["waypoint_compass"] = _announcement_callback
end
return waypoint_compass

4
mod.conf Executable file
View File

@ -0,0 +1,4 @@
name = waypoint_compass
description = Item that shows where is specific point in the world
depends =
optional_depends = waypoint_announce