mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
move hud away from utils 2 & add new argument
This commit is contained in:
parent
99ce42fdc5
commit
c0b73998ed
2 changed files with 20 additions and 19 deletions
|
|
@ -4,7 +4,11 @@ function on_hud_open()
|
|||
events.on("core:drop_outside_inventory", function(mode)
|
||||
local pid = hud.get_player()
|
||||
local invid = hud.get_exchange_inventory()
|
||||
base_util.drop_from_slot(pid, invid, 0, mode)
|
||||
local vp = gui.get_viewport()
|
||||
local dir_shift = table.map(input.get_mouse_pos(), function(i, v)
|
||||
return v / vp[i] - 0.5
|
||||
end)
|
||||
base_util.drop_from_slot(pid, invid, 0, mode, dir_shift)
|
||||
end)
|
||||
input.add_callback("player.drop", function()
|
||||
if hud.is_paused() or hud.is_inventory_open() then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue