diff options
author | Zefram <zefram@fysh.org> | 2014-04-29 20:40:48 +0100 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2014-04-29 20:40:48 +0100 |
commit | 37d87d6afc4b13d02581b6cdddccc8f91c26c644 (patch) | |
tree | ce79321960954c377bd35d5bdb091f09486949be | |
parent | b0e10d44f4fec700a8a62c54399de52b672d7412 (diff) |
Only do paperflip sound when really changing page
-rw-r--r-- | callbacks.lua | 14 |
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]) |