summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-06-27 08:48:24 +0200
committerGitHub <noreply@github.com>2020-06-27 08:48:24 +0200
commit95e6e2e4a5ca587c2559d8c997e916199c506367 (patch)
tree5f07a931713cb71ba8e87758ea1e1f74b5224172
parent168a9236655035b3aa9a6597dd7cdca9ad6fbd65 (diff)
downloadmesecons-95e6e2e4a5ca587c2559d8c997e916199c506367.tar
mesecons-95e6e2e4a5ca587c2559d8c997e916199c506367.tar.gz
mesecons-95e6e2e4a5ca587c2559d8c997e916199c506367.tar.bz2
mesecons-95e6e2e4a5ca587c2559d8c997e916199c506367.tar.xz
mesecons-95e6e2e4a5ca587c2559d8c997e916199c506367.zip
Add sound effects to FPGA programmer (#510)
-rw-r--r--mesecons_fpga/sounds/mesecons_fpga_copy.oggbin0 -> 7249 bytes
-rw-r--r--mesecons_fpga/sounds/mesecons_fpga_fail.oggbin0 -> 8633 bytes
-rw-r--r--mesecons_fpga/sounds/mesecons_fpga_write.oggbin0 -> 5706 bytes
-rw-r--r--mesecons_fpga/tool.lua4
4 files changed, 4 insertions, 0 deletions
diff --git a/mesecons_fpga/sounds/mesecons_fpga_copy.ogg b/mesecons_fpga/sounds/mesecons_fpga_copy.ogg
new file mode 100644
index 0000000..259a1bd
--- /dev/null
+++ b/mesecons_fpga/sounds/mesecons_fpga_copy.ogg
Binary files differ
diff --git a/mesecons_fpga/sounds/mesecons_fpga_fail.ogg b/mesecons_fpga/sounds/mesecons_fpga_fail.ogg
new file mode 100644
index 0000000..5e9059f
--- /dev/null
+++ b/mesecons_fpga/sounds/mesecons_fpga_fail.ogg
Binary files differ
diff --git a/mesecons_fpga/sounds/mesecons_fpga_write.ogg b/mesecons_fpga/sounds/mesecons_fpga_write.ogg
new file mode 100644
index 0000000..e781bff
--- /dev/null
+++ b/mesecons_fpga/sounds/mesecons_fpga_write.ogg
Binary files differ
diff --git a/mesecons_fpga/tool.lua b/mesecons_fpga/tool.lua
index 22bfaea..9e57bde 100644
--- a/mesecons_fpga/tool.lua
+++ b/mesecons_fpga/tool.lua
@@ -18,10 +18,12 @@ minetest.register_tool("mesecons_fpga:programmer", {
local meta = minetest.get_meta(pos)
if meta:get_string("instr") == "//////////////" then
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
end
itemstack:set_metadata(meta:get_string("instr"))
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
end,
@@ -43,6 +45,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
local imeta = itemstack:get_metadata()
if imeta == "" then
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
end
@@ -50,6 +53,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
meta:set_string("instr", imeta)
plg.update_meta(pos, imeta)
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
end