Add audio feedback for opening the map and editing markers
This commit is contained in:
parent
8642fbfa1b
commit
fa95a8705e
@ -15,6 +15,7 @@ minetest.register_chatcommand("map", {
|
|||||||
detail = MAXINT;
|
detail = MAXINT;
|
||||||
end
|
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));
|
minetest.show_formspec(name, "map", cartographer.get_map_formspec(data, player_x, player_z, 40, 40, detail));
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -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);
|
local player_x, player_z = cartographer.to_map_coordinates(map, pos.x, pos.z);
|
||||||
cartographer.set_marker(map, player_x, player_z, marker);
|
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);
|
show_map_id_formspec(map.id, pos.x, pos.z, player:get_player_name(), data.page);
|
||||||
elseif k == "prev_button" then
|
elseif k == "prev_button" then
|
||||||
show_map_id_formspec(map.id, pos.x, pos.z, player:get_player_name(), data.page - 1);
|
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
|
-- pos: The position of the node
|
||||||
-- player: The player that right-clicked the node
|
-- player: The player that right-clicked the node
|
||||||
on_rightclick = function(pos, _, player)
|
on_rightclick = function(pos, _, player)
|
||||||
|
minetest.sound_play("cartographer_open_map", { to_player=name }, true);
|
||||||
show_map_meta(minetest.get_meta(pos), player);
|
show_map_meta(minetest.get_meta(pos), player);
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -143,6 +145,7 @@ minetest.register_node("cartographer:map", {
|
|||||||
-- stack: The itemstack
|
-- stack: The itemstack
|
||||||
-- player: The player that used the item
|
-- player: The player that used the item
|
||||||
on_use = function(stack, player)
|
on_use = function(stack, player)
|
||||||
|
minetest.sound_play("cartographer_open_map", { to_player=name }, true);
|
||||||
show_map_meta(stack:get_meta(), player);
|
show_map_meta(stack:get_meta(), player);
|
||||||
end,
|
end,
|
||||||
});
|
});
|
||||||
|
BIN
sounds/cartographer_open_map.ogg
Normal file
BIN
sounds/cartographer_open_map.ogg
Normal file
Binary file not shown.
BIN
sounds/cartographer_write.0.ogg
Normal file
BIN
sounds/cartographer_write.0.ogg
Normal file
Binary file not shown.
BIN
sounds/cartographer_write.1.ogg
Normal file
BIN
sounds/cartographer_write.1.ogg
Normal file
Binary file not shown.
BIN
sounds/cartographer_write.2.ogg
Normal file
BIN
sounds/cartographer_write.2.ogg
Normal file
Binary file not shown.
BIN
sounds/cartographer_write.3.ogg
Normal file
BIN
sounds/cartographer_write.3.ogg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user