move hud away from utils 2 & add new argument

This commit is contained in:
neveix 2026-08-17 23:47:51 +05:00
parent 99ce42fdc5
commit c0b73998ed
2 changed files with 20 additions and 19 deletions

View file

@ -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