ev_radialmenu

EV Radial Menu System
The EV Radial Menu System provides an intuitive and dynamic interface for players to perform job-specific actions, interact with vehicles, or access custom functionalities. This guide explains how to configure, customize, and extend the radial menu system.
System Features
Core Features
Job-Based Menus: Dynamically displays options based on the player's job.
Vehicle-Specific Interactions: Contextual menus for specific vehicles or scenarios.
Customizable: Easily extend or modify menus using modular definitions.
User-Friendly: Smooth integration with roleplay frameworks and intuitive keybinds.
Dynamic Updates
Automatically adjusts menus based on:
Player job roles.
Vehicle entry/exit.
Specific in-game events.
Configuration
The configuration file (config.lua) defines the structure of the radial menu. It includes:
Menu Items: Base-level options displayed in the radial menu.
Job Interactions: Job-specific submenus.
Localization: Language support for prompts and notifications.
Example Configuration
Adding a New Menu
Step 1: Create a Menu File
Create a new Lua file in the menus folder (e.g., menus/myNewMenu.lua) and define your menu:
Step 2: Register the Menu
Include the new menu in the appropriate Config.JobInteractions entry in config.lua:
Step 3: Define Events
In your client script (client/main.lua), register the events linked to the menu:
Client-Side Details
Dynamic Updates
Vehicle-Based Menus
The system adjusts the menu based on the player's vehicle:
Job-Based Menus
Menus adjust based on the player's job:
Call setupSubItems() before opening the radial menu to ensure it updates correctly.
Keybind Configuration
The default keybind to open the radial menu is defined in config.lua:
To change the keybind:
Modify
Config.Keybindinconfig.lua.Update the
RegisterKeyMappinginclient/main.lua:
Example: Adding a "Toggle Light" Menu Item
Scenario: Add a "Toggle Light" menu item for mechanics.
Define the Menu Item:
Register the Event:
Add to the Menu:
Example Scenarios
Scenario 1: Police Interaction
A player with the "police" job opens the radial menu.
Job-specific options (e.g., "Call Backup") appear.
The player selects an action, triggering the appropriate event.
Scenario 2: Vehicle-Specific Menu
A player enters a specific vehicle (e.g., "rearmount").
Contextual options (e.g., "Set Ladder") are dynamically added to the menu.
Upon exiting the vehicle, the options are removed.
Notes
Custom Logic: Add or modify menu items in
Config.MenuItemsor the relevantmenusfile.Localization: Use
Config.Localesfor language-specific prompts.Event Handling: Ensure all menu options are linked to client or server events.
Last updated