diff options
Diffstat (limited to 'unified_inventory')
-rw-r--r-- | unified_inventory/api.lua | 33 | ||||
-rw-r--r-- | unified_inventory/sounds/dingdong.ogg | bin | 0 -> 27849 bytes | |||
-rw-r--r-- | unified_inventory/sounds/electricity.ogg | bin | 0 -> 18175 bytes | |||
-rw-r--r-- | unified_inventory/sounds/paperflip1.ogg | bin | 0 -> 19880 bytes | |||
-rw-r--r-- | unified_inventory/sounds/paperflip2.ogg | bin | 0 -> 20582 bytes | |||
-rw-r--r-- | unified_inventory/sounds/teleport.ogg | bin | 0 -> 59041 bytes |
6 files changed, 20 insertions, 13 deletions
diff --git a/unified_inventory/api.lua b/unified_inventory/api.lua index 824cdfa..01bcc8e 100644 --- a/unified_inventory/api.lua +++ b/unified_inventory/api.lua @@ -78,6 +78,7 @@ unified_inventory.refill = minetest.create_detached_inventory(player_name.."refi end, on_put = function(inv, listname, index, stack, player) inv:set_stack(listname, index, ItemStack(stack:get_name().." "..stack:get_stack_max())) + minetest.sound_play("electricity", {to_player=player_name, gain = 1.0}) end, }) unified_inventory.refill:set_size("main", 1) @@ -282,25 +283,26 @@ end -- register_on_player_receive_fields minetest.register_on_player_receive_fields(function(player, formname, fields) local player_name = player:get_player_name() - + -- main buttons if fields.craft then unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,"craft")) + minetest.sound_play("click", {to_player=player_name, gain = 0.1}) return end - + if fields.craftguide then unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,"craftguide")) + minetest.sound_play("click", {to_player=player_name, gain = 0.1}) return end - + if fields.bags then unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,"bags")) + minetest.sound_play("click", {to_player=player_name, gain = 0.1}) return end - - -- bags for i=1,4 do local page = "bag"..i @@ -309,20 +311,23 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) page = "bags" end unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,page)) + minetest.sound_play("click", {to_player=player_name, gain = 0.1}) return end end - + -- Miscellaneous if fields.home_gui_set then unified_inventory.set_home(player, player:getpos()) local home = homepos[player_name] if home ~= nil then + minetest.sound_play("dingdong", {to_player=player_name, gain = 1.0}) minetest.chat_send_player(player_name, "Home position set to: "..math.floor(home.x)..","..math.floor(home.y)..","..math.floor(home.z)) end end if fields.home_gui_go then unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,"craft")) + minetest.sound_play("teleport", {to_player=player_name, gain = 1.0}) unified_inventory.go_home(player) end if fields.misc_set_day then @@ -357,27 +362,27 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local pagemax = math.floor((unified_inventory.filtered_items_list_size[player_name]-1) / (80) + 1) if fields.start_list then - minetest.sound_play("click", {to_player=player_name, gain = 0.3}) + minetest.sound_play("paperflip1", {to_player=player_name, gain = 1.0}) start_i = 1 end if fields.rewind1 then - minetest.sound_play("click", {to_player=player_name, gain = 0.3}) + minetest.sound_play("paperflip1", {to_player=player_name, gain = 1.0}) start_i = start_i - 1 end if fields.forward1 then - minetest.sound_play("click", {to_player=player_name, gain = 0.3}) + minetest.sound_play("paperflip1", {to_player=player_name, gain = 1.0}) start_i = start_i + 1 end if fields.rewind3 then - minetest.sound_play("click", {to_player=player_name, gain = 0.3}) + minetest.sound_play("paperflip1", {to_player=player_name, gain = 1.0}) start_i = start_i - 3 end if fields.forward3 then - minetest.sound_play("click", {to_player=player_name, gain = 0.3}) + 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("click", {to_player=player_name, gain = 0.3}) + minetest.sound_play("paperflip1", {to_player=player_name, gain = 1.0}) start_i = pagemax end if start_i < 1 then @@ -397,7 +402,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) for i=0,80,1 do local button="item_button"..list_index if fields[button] then - minetest.sound_play("click", {to_player=player_name, gain = 0.3}) + minetest.sound_play("click", {to_player=player_name, gain = 0.1}) if minetest.setting_getbool("creative_mode")==false then unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,"craftguide")) page="craftguide" @@ -425,10 +430,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.searchbutton then unified_inventory.apply_filter(player, fields.searchbox) unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,unified_inventory.current_page[player_name])) + minetest.sound_play("paperflip2", {to_player=player_name, gain = 1.0}) end -- alternate button if fields.alternate then + minetest.sound_play("click", {to_player=player_name, gain = 0.1}) local item_name=unified_inventory.current_item[player_name] if item_name then local alternates = 0 diff --git a/unified_inventory/sounds/dingdong.ogg b/unified_inventory/sounds/dingdong.ogg Binary files differnew file mode 100644 index 0000000..2c9d7ef --- /dev/null +++ b/unified_inventory/sounds/dingdong.ogg diff --git a/unified_inventory/sounds/electricity.ogg b/unified_inventory/sounds/electricity.ogg Binary files differnew file mode 100644 index 0000000..4cd7c84 --- /dev/null +++ b/unified_inventory/sounds/electricity.ogg diff --git a/unified_inventory/sounds/paperflip1.ogg b/unified_inventory/sounds/paperflip1.ogg Binary files differnew file mode 100644 index 0000000..eaed13f --- /dev/null +++ b/unified_inventory/sounds/paperflip1.ogg diff --git a/unified_inventory/sounds/paperflip2.ogg b/unified_inventory/sounds/paperflip2.ogg Binary files differnew file mode 100644 index 0000000..321bc48 --- /dev/null +++ b/unified_inventory/sounds/paperflip2.ogg diff --git a/unified_inventory/sounds/teleport.ogg b/unified_inventory/sounds/teleport.ogg Binary files differnew file mode 100644 index 0000000..ca32f74 --- /dev/null +++ b/unified_inventory/sounds/teleport.ogg |