Update
This commit is contained in:
21
Quick Swap Hand~Bag/Lua/Autorun/init.lua
Normal file
21
Quick Swap Hand~Bag/Lua/Autorun/init.lua
Normal 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)
|
2
Quick Swap Hand~Bag/filelist.xml
Normal file
2
Quick Swap Hand~Bag/filelist.xml
Normal 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" />
|
Reference in New Issue
Block a user