Give up
This commit is contained in:
@@ -1,52 +1,58 @@
|
|||||||
if not CLIENT then return end
|
if not CLIENT then return end
|
||||||
|
|
||||||
Hook.Add("keyUpdate", "quickswap_bag~hand", function()
|
-- Hook.Add("keyUpdate", "quickswap_bag~hand", function()
|
||||||
if not PlayerInput.KeyHit(Keys.LeftAlt) then return end
|
-- if not PlayerInput.KeyHit(Keys.LeftAlt) then return end
|
||||||
if GUI.KeyboardDispatcher.Subscriber then return end
|
-- if GUI.KeyboardDispatcher.Subscriber then return end
|
||||||
|
--
|
||||||
local character = Character.Controlled
|
-- local character = Character.Controlled
|
||||||
if not character then
|
-- if not character then
|
||||||
print("No character found")
|
-- print("No character found")
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
local inventory = character.Inventory
|
-- local inventory = character.Inventory
|
||||||
if not inventory then
|
-- if not inventory then
|
||||||
print("No inventory found")
|
-- print("No inventory found")
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
local bagSlotIndex = inventory.FindLimbSlot(InvSlotType.Bag)
|
-- local bagSlotIndex = inventory.FindLimbSlot(InvSlotType.Bag)
|
||||||
if bagSlotIndex < 0 then
|
-- if bagSlotIndex < 0 then
|
||||||
print("No bag slot found")
|
-- print("No bag slot found")
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
local bagItem = inventory.GetItemAt(bagSlotIndex)
|
-- local bagItem = inventory.GetItemAt(bagSlotIndex)
|
||||||
if not bagItem then
|
-- if not bagItem then
|
||||||
print("No bag item found")
|
-- print("No bag item found")
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
local bagInventrory = bagItem.OwnInventory
|
-- local bagInventrory = bagItem.OwnInventory
|
||||||
if not bagInventrory then
|
-- if not bagInventrory then
|
||||||
print("No bag inventory found")
|
-- print("No bag inventory found")
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
local items = bagInventrory.AllItemsMod
|
-- -- local bagItems = {}
|
||||||
for _, item in ipairs(items) do
|
-- -- local items = bagInventrory.AllItemsMod
|
||||||
---@cast item Barotrauma.Item
|
-- -- for _, item in ipairs(items) do
|
||||||
print(item.Name)
|
-- -- ---@cast item Barotrauma.Item
|
||||||
print(item.Tags)
|
-- -- bagItems[item.Name] = true
|
||||||
end
|
-- -- end
|
||||||
|
--
|
||||||
|
-- -- local inventoryItems = inventory.AllItemsMod
|
||||||
|
-- -- for _, item in ipairs(inventoryItems) do
|
||||||
|
-- -- if bagItems[item.Name] then
|
||||||
|
-- -- end
|
||||||
--for _, handSlotType in ipairs { InvSlotType.LeftHand, InvSlotType.RightHand } do
|
-- -- end
|
||||||
-- local handSlotIndex = inventory.FindLimbSlot(handSlotType)
|
--
|
||||||
-- if handSlotIndex >= 0 then
|
--
|
||||||
-- if inventory.TryPutItem(bagItem, handSlotIndex, true, false, character) then return end
|
--
|
||||||
-- end
|
--
|
||||||
--end
|
--
|
||||||
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)
|
||||||
Reference in New Issue
Block a user