mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-24 01:10:19 +01:00
Add sound effects to FPGA programmer (#510)
This commit is contained in:
parent
168a923665
commit
95e6e2e4a5
BIN
mesecons_fpga/sounds/mesecons_fpga_copy.ogg
Normal file
BIN
mesecons_fpga/sounds/mesecons_fpga_copy.ogg
Normal file
Binary file not shown.
BIN
mesecons_fpga/sounds/mesecons_fpga_fail.ogg
Normal file
BIN
mesecons_fpga/sounds/mesecons_fpga_fail.ogg
Normal file
Binary file not shown.
BIN
mesecons_fpga/sounds/mesecons_fpga_write.ogg
Normal file
BIN
mesecons_fpga/sounds/mesecons_fpga_write.ogg
Normal file
Binary file not shown.
@ -18,10 +18,12 @@ minetest.register_tool("mesecons_fpga:programmer", {
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if meta:get_string("instr") == "//////////////" then
|
if meta:get_string("instr") == "//////////////" then
|
||||||
minetest.chat_send_player(placer:get_player_name(), "This FPGA is unprogrammed.")
|
minetest.chat_send_player(placer:get_player_name(), "This FPGA is unprogrammed.")
|
||||||
|
minetest.sound_play("mesecons_fpga_fail", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 })
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
itemstack:set_metadata(meta:get_string("instr"))
|
itemstack:set_metadata(meta:get_string("instr"))
|
||||||
minetest.chat_send_player(placer:get_player_name(), "FPGA gate configuration was successfully copied!")
|
minetest.chat_send_player(placer:get_player_name(), "FPGA gate configuration was successfully copied!")
|
||||||
|
minetest.sound_play("mesecons_fpga_copy", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 })
|
||||||
|
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
@ -43,6 +45,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
|
|||||||
local imeta = itemstack:get_metadata()
|
local imeta = itemstack:get_metadata()
|
||||||
if imeta == "" then
|
if imeta == "" then
|
||||||
minetest.chat_send_player(player_name, "Use shift+right-click to copy a gate configuration first.")
|
minetest.chat_send_player(player_name, "Use shift+right-click to copy a gate configuration first.")
|
||||||
|
minetest.sound_play("mesecons_fpga_fail", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 })
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -50,6 +53,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
|
|||||||
meta:set_string("instr", imeta)
|
meta:set_string("instr", imeta)
|
||||||
plg.update_meta(pos, imeta)
|
plg.update_meta(pos, imeta)
|
||||||
minetest.chat_send_player(player_name, "Gate configuration was successfully written to FPGA!")
|
minetest.chat_send_player(player_name, "Gate configuration was successfully written to FPGA!")
|
||||||
|
minetest.sound_play("mesecons_fpga_write", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 })
|
||||||
|
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user