-
-
Notifications
You must be signed in to change notification settings - Fork 433
feat: exports #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: exports #532
Conversation
|
This is an interesting PR but how would you deal with permissions is that handled on the plugin or by vMenu. I know some people would want the plugin while others would want vMenu. I have briefly skimmed over the code so I may have missed this |
|
Permission handling for anything added through the exports would be up to the resource using them. If an addon wanted to align with vMenu's ace permissions it could (by checking the same ace perms), or it could handle it entirely itself. So maybe for my cinematic camera addon example, in the addon you could check for aces like "vMenu.CinematicCamera.All", and document that for people to add to their permissions file. But for the framework addon in my server, it has it's own exports that let you get character info such as the job, and other addons use that information to decide weather to show certain menus or not. Edit: Currently, if an addon tries to modify or add to a built-in menu you don’t have vMenu permissions for, Exports.cs won’t return the menu to the addon. Though I don’t really see a reason to keep that logic - I may make a commit to remove the permission logic from Exports.cs |
|
I did some cleanup & removed the permissions related logic since resources can simply use IsPlayerAceAllowed. To re-iterate, this wouldn't be an actual/official plugin system, it doesn't mess with any of vMenu's existing logic. It allows "plugins" to be created by exposing the exports to allow extending, modifying, or creating new menus with vMenu's system. |
Add Client Exports
I've been using my own build of vMenu with exports for years to let external Lua resources modify the menu. This makes it easy to create addon systems that can be maintained, updated, or removed separately without touching vMenu's core code.
This PR adds a single
Exports.csfile that exposes client exports so you can create your own menus with MenuAPI and modify existing vMenu menus. External resources can plug into vMenu and add their own features.Example plugin with full export documentation: https://github.com/tommy141x/vmenu-cinematic-cam
This documents all available exports and their usage/parameters.
Video demo: https://www.youtube.com/watch?v=WmI7_X3snmc
The demo showcases my custom framework plugin, ERS integration plugin, EUP plugin, and the cinematic camera plugin (linked above) all running together.
You can also test it live on my server at
178.156.146.100(orfivem://connect/kqj4l6)I think it could let vMenu have its own plugin ecosystem where people create and share addons. Whether you want to implement it this way or not, I figured I'd share what I've been using since it's worked well for me.