d0p3t / fivem-js

Javascript and Typescript wrapper for the FiveM natives API
https://d0p3t.nl
Other
143 stars 57 forks source link

Added new functionality to menu class #26

Closed mythicalbro closed 5 years ago

mythicalbro commented 5 years ago

Changed menu constructor offset parameter to optional with default value of new Point(15, 15)

Added two new menu class methods:

addNewSubMenu(text, description?, inherit = true)
addSubMenu(subMenuToAdd, text, description?, inherit = true)

Example:

let MainMenu = new Cfx.Menu("MythicalBro", "options");

let SubMenu = MainMenu.addNewSubMenu('SubMenu', 'Some description');

let NewMenu = new Cfx.Menu('NewMenu', 'Subtitle', new Point(20, 30));
MainMenu.addSubMenu(NewMenu, 'NewMenu', 'Some description');

Added :

Yomanz commented 5 years ago

You need to merge it into the development branch.

d0p3t commented 5 years ago

Next time please PR into the development branch as suggested by Yomanz.

I'm going to assume this works as intended. It's definitely a nicer way to add submenus!

Thank you bitmoji