Universal Menu - A customizable modular uniform menu framework [v2.4.2]

Based on my other WIP but not WIP anymore project, Scorpion Trainer, this aims to be a uniform modular menu with no content at all.

So, what’s the point then you might ask?
While there’s no content by default, you can add content with so called modules. Modules are simply resources which add content to the menu by using its API.

The goal of this project is to have one menu which all resources can use instead of having several different menus which open with different key combinations or even overlap with their key shortcuts.

Download and source code
The master branch is the newest “stable” version and you should download that one. Also make sure to name the resource “menu”, otherwise functionality WILL break!

2018-05-15_20-53-23

Open the menu with F6 by default. Also check config.lua for configuration possibilities.

And, don’t hesitate with any kind of feedback, suggestion, bug report or even contribution!

Regarding Modules:
Simply install them like any other resource. It’s advicable to put them into one folder (for example [menu-modules]) for organizatory purposes. Be careful with what you install, as some security mechanisms are implemented, it isn’t fully idiot-proof yet so buggy/malicious modules could mess up the menu.

An example module: A stripped-down port of the default Scorpion Trainer.
module_scorpion.zip (3.6 KB)

If you restart a module, make sure to restart the menu too.

For Developers:
Everything, including API Reference, Start Guide, notes and some example modules can be found on the Wiki. Please visit it for general advice.

Refer to the module above for an example.

Also you are encouraged to prefix your modules with “module_” in the resource name.

Thanks to:

  • @Streetcorps for helping me out with trivial stuff
  • FiveM for existing
  • You for being awesome :snail:
27 Likes

Never disappointed with your releases! :grin:

Great release, nice to see you active again.

BTW.

3 Likes

True beauty of Universal Releases over here!!!

+1

1 Like

Ooh. Look who stepped outta retirement lol. Nice to see ya back.

+1 LIKE for this pretty pieces of goodness. Thanks for sharing Scammer! As always, never disappointed with your work.

Here’s a cut down version of the default Scorpion Trainer ported as module. This is intended to be an example for developers on how modules work.

module_scorpion.zip (3.6 KB) Download from OP for newest version

2 Likes

Version bumped to v1.1, now you can change your title background’s color in the config.lua. Here’s an example:

2018-05-13_12-18-37

Also fixed up the Scorpion Trainer module in the OP.

2 Likes

v1.2 pushed with many new API goodies, make sure to check the API Reference.

Modual based menu is a good idea, and if the menu name is config set so the user can just set it to there server name, would let users customise there servers to there needs, I think it idea is a good one.

v1.3 pushed with more API functions and the ability to set the header’s default title. Note that the header title gets changed to the current sub-menu’s name the user is in currently. This behaviour will be removed as soon as subtitles are added to make the header text consistent.

Also added the edge branch where progress will be pushed quickly. The master branch will (or at least should) be stable with jumps to whole versions and bug fixes only.

2 Likes

v2.0 released with subtitles (which shows the menu you are currently in instead now, header title will now stay consistent), much more customizability and further stabilizing of the core. This should make the menu pretty stable now.

And before I forget, menu items can now have descriptions! And even better, descriptions can be updated in real-time (which means modules can update the description while it’s being shown to the user).

2018-05-15_20-53-23

Have fun!

2 Likes

I haven’t tried this out yet but looks great. I was just wondering after looking at the wiki I’m still not sure I understand how to plug in the scorpion trainer module

Simply install any module as you would install a resource (drop it in the resources folder or a sub-folder for organization). Then, add start modulename to the server.cfg after the menu resource. That’s it!

Don’t you mean start instead of exec ? :face_with_raised_eyebrow:

Yes I do.

Second time you caught me.

Thanx scammer. I was under the impression that it was a module you add a line into the menu to get it to work. Good stuff

v2.1 released with more :bug: :boom: :boot: and submenu indicators!

2018-05-16_18-14-06

Also pushed v2.1.1 with support for opening the menu with a controller (RB + DPAD Left by default, configurable).

2 Likes

Minor update v2.1.2 released. This one adds an (client and server) event menu:setup which gets triggered on first player spawn. Modules should create their menu content in this event, as that way once the menu is reloaded by an admin, modules will automatically add their content to the menu again once the player respawns.

The Scorpion Trainer module in the OP has already been updated to use this.

1 Like

v2.2 released!

Changelog:


* New API functions for greying out and setting a right text for items (view screenshot below)

* Ability to change the description's background and font color to your liking (view screenshot below)

* Now configuration and modules (which add menu stuff properly) will load after reloading the menu without having to respawn!

* Much refactoring and a whole load of squished bugs

2018-05-19_04-53-25

Of course as always, please report back if you encounter any issues!

Edit: Update v2.2.1 adds menu:isMenuShown.

1 Like