This commit is contained in:
2025-03-29 18:16:21 +01:00
parent 309ce6cd2e
commit 653c8f77a5
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
if not CLIENT then return end
Hook.Add("keyUpdate", "quickswap_bag~hand", function()
if not PlayerInput.KeyHit(Keys.LeftAlt) then return end
if GUI.KeyboardDispatcher.Subscriber then return end
local character = Character.Controlled; if character == nil then return end
local inventory = character.Inventory; if inventory == nil then return end
local bagSlotIndex = inventory.FindLimbSlot(InvSlotType.Bag); if bagSlotIndex < 0 then return end
for handItem in character.HeldItems do
if inventory.TryPutItem(handItem, bagSlotIndex, true, false, character) then
return
end
end
local bagItem = inventory.GetItemAt(bagSlotIndex); if bagItem == nil then return end
for _, handSlotType in ipairs { InvSlotType.LeftHand, InvSlotType.RightHand } do
local handSlotIndex = inventory.FindLimbSlot(handSlotType)
if handSlotIndex >= 0 then
if inventory.TryPutItem(bagItem, handSlotIndex, true, false, character) then return end
end
end
end)

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<contentpackage name="Quick Swap Hand~Bag" modversion="1.0.0" corepackage="False" gameversion="1.7.7.0" expectedhash="E5BC9CD2964C4C8DEA6F7F40F2E0D278" />