tweak tgiann-inventory
Inventory.OpenStash = function(src, id, label, slots, weight, owner, groups, coords) sub from id
This commit is contained in:
1 parent
0abb127503
commit
294fa7a959
1 file changed
+14
-4
@@ -114,7 +114,18 @@ end
|
|||||||
---@param coords table
|
---@param coords table
|
||||||
---@return nil
|
---@return nil
|
||||||
Inventory.OpenStash = function(src, id, label, slots, weight, owner, groups, coords)
|
Inventory.OpenStash = function(src, id, label, slots, weight, owner, groups, coords)
|
||||||
print("Currently not bridged for stashes")
|
local _type = nil
|
||||||
|
if id:sub(1, 5) == "trunk" then
|
||||||
|
_type = "trunk"
|
||||||
|
id = id:sub(5)
|
||||||
|
elseif id:sub(1, 6) == "glovebox" then
|
||||||
|
_type = "glovebox"
|
||||||
|
id = id:sub(6)
|
||||||
|
elseif id:sub(1, 5) == "stash" then
|
||||||
|
_type = "stash"
|
||||||
|
id = id:sub(5)
|
||||||
|
end
|
||||||
|
return tgiann:ForceOpenInventory(src, _type, id)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will register a stash
|
---This will register a stash
|
||||||
@@ -127,7 +138,7 @@ end
|
|||||||
---@param coords table
|
---@param coords table
|
||||||
---@return boolean
|
---@return boolean
|
||||||
Inventory.RegisterStash = function(id, label, slots, weight, owner, groups, coords)
|
Inventory.RegisterStash = function(id, label, slots, weight, owner, groups, coords)
|
||||||
return false, print("Currently not bridged for stashes")
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will return a boolean if the player has the item.
|
---This will return a boolean if the player has the item.
|
||||||
@@ -170,7 +181,6 @@ end
|
|||||||
Inventory.AddTrunkItems = function(identifier, items)
|
Inventory.AddTrunkItems = function(identifier, items)
|
||||||
local id = "trunk"..identifier
|
local id = "trunk"..identifier
|
||||||
if type(items) ~= "table" then return false end
|
if type(items) ~= "table" then return false end
|
||||||
Inventory.RegisterStash(identifier, identifier, 20, 10000, nil, nil, nil)
|
|
||||||
for _, v in pairs(items) do
|
for _, v in pairs(items) do
|
||||||
tgiann:AddItemToSecondaryInventory("trunk", identifier, v.item, v.count, nil, v.metadata)
|
tgiann:AddItemToSecondaryInventory("trunk", identifier, v.item, v.count, nil, v.metadata)
|
||||||
end
|
end
|
||||||
@@ -202,7 +212,7 @@ end
|
|||||||
---@param src number
|
---@param src number
|
||||||
---@param shopTitle string
|
---@param shopTitle string
|
||||||
Inventory.OpenShop = function(src, shopTitle)
|
Inventory.OpenShop = function(src, shopTitle)
|
||||||
print("Currently tgiann-inventory is not bridged for shops")
|
return false, print("Currently tgiann-inventory is not bridged for shops")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This will register a shop, if it already exists it will return true.
|
-- This will register a shop, if it already exists it will return true.
|
||||||
|
|||||||
Reference in new issue
Block a user