jimathy / jim_bridge Goto Github PK
View Code? Open in Web Editor NEWFramework bridge script
Framework bridge script
Hello! I'm upgrading jim-mechanic to v3.3 and one thing I noticed was that the openStash function in jim_bridge didn't support customizing the stash options.
I made the following change to allow passing through a stashOptions variable:
function openStash(data)
if (data.job or data.gang) and not jobCheck(data.job or data.gang) then return end
if GetResourceState(OXInv):find("start") then
exports[OXInv]:openInventory('stash', data.stash)
elseif GetResourceState(CodeMInv):find("start") then
exports[CodeMInv]:OpenStash(data.stash, 400000, 100)
else
TriggerEvent("inventory:client:SetCurrentStash", data.stash)
TriggerServerEvent("inventory:server:OpenInventory", "stash", data.stash, data.stashOptions)
end
lookEnt(data.coords)
end
This way, when calling openStash from jim-mechanic, I can do this:
{ action = function()
openStash({ job = loc.job, stash = repairStashName, stashOptions = { maxweight = 4000000, slots = 200, } }) end,
icon = "fas fa-cogs",
label = Loc[Config.Lan]["repair"].browse,
job = loc.job
},
I know jim_bridge is still pretty new and if you're not looking for any feedback like this, go ahead and close this, no worries. I just wanted to share in case others are interested in doing the same thing and maybe it helps you in the future if you ever need to customize a stash.
Line 230 in 80c3579
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.