Add audio feedback for opening the map and editing markers

This commit is contained in:
Hugues Ross 2020-04-18 10:24:26 -04:00
parent 8642fbfa1b
commit fa95a8705e
7 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ minetest.register_chatcommand("map", {
detail = MAXINT;
end
minetest.sound_play("cartographer_open_map", { to_player=name }, true);
minetest.show_formspec(name, "map", cartographer.get_map_formspec(data, player_x, player_z, 40, 40, detail));
end,
})

View File

@ -85,6 +85,7 @@ minetest.register_on_player_receive_fields(function(player, name, fields)
local player_x, player_z = cartographer.to_map_coordinates(map, pos.x, pos.z);
cartographer.set_marker(map, player_x, player_z, marker);
minetest.sound_play("cartographer_write", { to_player=player:get_player_name() }, true);
show_map_id_formspec(map.id, pos.x, pos.z, player:get_player_name(), data.page);
elseif k == "prev_button" then
show_map_id_formspec(map.id, pos.x, pos.z, player:get_player_name(), data.page - 1);
@ -135,6 +136,7 @@ minetest.register_node("cartographer:map", {
-- pos: The position of the node
-- player: The player that right-clicked the node
on_rightclick = function(pos, _, player)
minetest.sound_play("cartographer_open_map", { to_player=name }, true);
show_map_meta(minetest.get_meta(pos), player);
end,
@ -143,6 +145,7 @@ minetest.register_node("cartographer:map", {
-- stack: The itemstack
-- player: The player that used the item
on_use = function(stack, player)
minetest.sound_play("cartographer_open_map", { to_player=name }, true);
show_map_meta(stack:get_meta(), player);
end,
});

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.