mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
Merge a4403ee6e5 into dacebf94bc
This commit is contained in:
commit
b98b31cb49
5 changed files with 79 additions and 5 deletions
|
|
@ -10,6 +10,31 @@ function on_hud_open()
|
|||
end)
|
||||
base_util.drop_from_slot(pid, invid, 0, mode, dir_shift)
|
||||
end)
|
||||
|
||||
events.on("core:access_panel_slot_middle_click", function(itemid)
|
||||
local exc_invid = hud.get_exchange_inventory()
|
||||
inventory.set(exc_invid, 0, itemid, item.stack_size(itemid))
|
||||
end)
|
||||
|
||||
events.on("core:slot_middle_click", function(invid, slot)
|
||||
if not player.is_infinite_items(hud.get_player()) then
|
||||
return
|
||||
end
|
||||
local exc_invid = hud.get_exchange_inventory()
|
||||
local exc_itemid = inventory.get(exc_invid, 0)
|
||||
local itemid = inventory.get(invid, slot)
|
||||
if itemid == 0 and exc_itemid ~= 0 then
|
||||
local stack_size = item.stack_size(exc_itemid)
|
||||
inventory.set(invid, slot, exc_itemid, stack_size)
|
||||
elseif exc_itemid == 0 then
|
||||
local stack_size = item.stack_size(itemid)
|
||||
inventory.set(exc_invid, 0, itemid, stack_size)
|
||||
elseif exc_itemid == itemid then
|
||||
local stack_size = item.stack_size(exc_itemid)
|
||||
inventory.set(invid, slot, exc_itemid, stack_size)
|
||||
end
|
||||
end)
|
||||
|
||||
input.add_callback("player.drop", function()
|
||||
if hud.is_paused() or hud.is_inventory_open() then
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue