summaryrefslogtreecommitdiff
path: root/mesecons_button
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons_button')
-rw-r--r--mesecons_button/init.lua6
-rw-r--r--mesecons_button/sounds/mesecons_button_pop.oggbin0 -> 6184 bytes
-rw-r--r--mesecons_button/sounds/mesecons_button_push.oggbin0 -> 6982 bytes
3 files changed, 5 insertions, 1 deletions
diff --git a/mesecons_button/init.lua b/mesecons_button/init.lua
index 282e305..5f47e71 100644
--- a/mesecons_button/init.lua
+++ b/mesecons_button/init.lua
@@ -6,6 +6,7 @@ mesecon.button_turnoff = function (pos)
local node = minetest.env:get_node(pos)
if node.name=="mesecons_button:button_on" then --has not been dug
mesecon:swap_node(pos, "mesecons_button:button_off")
+ minetest.sound_play("mesecons_button_pop", {pos=pos})
local rules = mesecon.rules.buttonlike_get(node)
mesecon:receptor_off(pos, rules)
end
@@ -41,9 +42,11 @@ minetest.register_node("mesecons_button:button_off", {
description = "Button",
on_punch = function (pos, node)
mesecon:swap_node(pos, "mesecons_button:button_on")
- mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
+ mesecon:receptor_on(pos, mesecon.rules.buttonlike_get(node))
+ minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.after(1, mesecon.button_turnoff, pos)
end,
+ sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.off,
rules = mesecon.rules.buttonlike_get
@@ -80,6 +83,7 @@ minetest.register_node("mesecons_button:button_on", {
groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon_needs_receiver = 1},
drop = 'mesecons_button:button_off',
description = "Button",
+ sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = {
state = mesecon.state.on,
rules = mesecon.rules.buttonlike_get
diff --git a/mesecons_button/sounds/mesecons_button_pop.ogg b/mesecons_button/sounds/mesecons_button_pop.ogg
new file mode 100644
index 0000000..9d56bb8
--- /dev/null
+++ b/mesecons_button/sounds/mesecons_button_pop.ogg
Binary files differ
diff --git a/mesecons_button/sounds/mesecons_button_push.ogg b/mesecons_button/sounds/mesecons_button_push.ogg
new file mode 100644
index 0000000..53d45c1
--- /dev/null
+++ b/mesecons_button/sounds/mesecons_button_push.ogg
Binary files differ