summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2014-04-29 20:40:48 +0100
committerZefram <zefram@fysh.org>2014-04-29 20:40:48 +0100
commit37d87d6afc4b13d02581b6cdddccc8f91c26c644 (patch)
treece79321960954c377bd35d5bdb091f09486949be
parentb0e10d44f4fec700a8a62c54399de52b672d7412 (diff)
Only do paperflip sound when really changing page
-rw-r--r--callbacks.lua14
1 files changed, 2 insertions, 12 deletions
diff --git a/callbacks.lua b/callbacks.lua
index 2827c5c..ce6bcf0 100644
--- a/callbacks.lua
+++ b/callbacks.lua
@@ -79,33 +79,21 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
/ (80) + 1)
if fields.start_list then
- minetest.sound_play("paperflip1",
- {to_player=player_name, gain = 1.0})
start_i = 1
end
if fields.rewind1 then
- minetest.sound_play("paperflip1",
- {to_player=player_name, gain = 1.0})
start_i = start_i - 1
end
if fields.forward1 then
- minetest.sound_play("paperflip1",
- {to_player=player_name, gain = 1.0})
start_i = start_i + 1
end
if fields.rewind3 then
- minetest.sound_play("paperflip1",
- {to_player=player_name, gain = 1.0})
start_i = start_i - 3
end
if fields.forward3 then
- minetest.sound_play("paperflip1",
- {to_player=player_name, gain = 1.0})
start_i = start_i + 3
end
if fields.end_list then
- minetest.sound_play("paperflip1",
- {to_player=player_name, gain = 1.0})
start_i = pagemax
end
if start_i < 1 then
@@ -115,6 +103,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
start_i = pagemax
end
if not (start_i == start) then
+ minetest.sound_play("paperflip1",
+ {to_player=player_name, gain = 1.0})
unified_inventory.current_index[player_name] = (start_i - 1) * 80 + 1
unified_inventory.set_inventory_formspec(player,
unified_inventory.current_page[player_name])