
Please read our cookies policy for more information. I downloaded this mod, extracted contents. Optional, defaults to true.MegaGames, Game Trainers, Cheats, Mods, Fixes. Should this button use localized title and description strings. The position to display this button in the menu, higher values display higher in the menu. Optional, leaving it as nil will not open a menu when clicked. The ID of the menu which should be opened when this button is clicked. The display color of this button when it is disabled. This is a localized value.īutton_data: callback The function to be called on MenuCallbackHandler when the button is clicked.īutton_data: menu_id The ID of the menu which this button should be created on. This is a localized value.īutton_data: desc A key for the display description of this button. MenuHelper:LoadFromJsonFile( "path/to/example_file.txt", MyMod, MyMod._data )Īdds a button to the menu specified in the table button_data, as well as the data specified.īutton_data A table containing data on the button to be added to the menu.īutton_data: id A unique identifier for this button.īutton_data: title A key for the display name of this button. Parent_class The class of which all keybind functions and data will be loaded and saved to.ĭata_table A table containing the data keys which various menu items can load their value from. Check the JsonMenu documentation and the JsonMenuExample in the Example Mods.įile_path The json-formatted file to load and convert into a menu. Loads a json-formatted text file and automatically parses and converts into a usable menu. MenuHelper:LoadFromJsonFile( file_path, parent_class, data_table ) MenuHelper:AddMenuItem( nodes.options, lua_mod_options_menu_id, "base_options_menu_lua_mod_options", "base_options_menu_lua_mod_options_desc", "video", "before" ) Hooks:Add("MenuManagerBuildCustomMenus", "MenuManagerBuildCustomMenus_Example", function( menu_manager, nodes ) This can either be before or after and will place it above or below the object in the menu accordingly. The position to place this object at if we are using a child object's name. Using a string as the name of another child item will insert it at a specified subposition relative to the child item. Using a number will insert it at a guaranteed position. A value of where this menu item should be inserted into the parent menu. This is a localized value.ĭesc The key of the description to display when highlighting this button. Name The key of the display name of this button. Parent_menu The menu which the menu item will be added to.Ĭhild_menu The ID of the menu which this menu item should open when clicked. MenuHelper:AddMenuItem( parent_menu, child_menu, name, desc, menu_position, subposition )Īdds a button to an already existing parent menu. Nodes = MenuHelper:BuildMenu( "my_custom_menu", menu_data ) Available values are full, half, and none. Menu_id The ID of the menu which should be built.ĭata A table containing extra data which this menu should be built with.ĭata: back_callback The function to be called on MenuCallbackHandler when the menu is left.ĭata: area_bg The area the background covers when this menu is opened whilest in-heist. Sets up, and returns, the menu with ID menu_id so that it can be added to the in-game menus. local menu = MenuHelper:GetMenu( "my_custom_menu" ) Logs an error, and returns nil, if no menu with the specified ID could be found. Returns The menu with the specified menu_id. Menu_id The unique ID of the menu to get. Returns the registered menu with id of menu_id. Menu_id The unique ID to use for this menu. Registers a new menu that can have items added to it. The MenuHelper class is a set of functions which are used in conjunction with a set of specialized hooks in order to add custom menus to the game.Īdding menus via MenuHelper is best left for menus that require more advanced setup, as Json Menus can be used in most other circumstances to add menus to your mods.
