Release Notes for SimpleMenu v1.1
Overview
This update refactors the SimpleMenu script for better organization, modularity, and maintainability. Code has been separated into logical directories, syntax errors have been fixed, and new features have been added. All changes ensure compatibility with FiveM while improving performance and usability.
New Features
- Never Wanted Toggle: Added a new menu option in the Player Menu to toggle "Never Wanted" mode.
Structural Changes
- Directory Organization:
- Moved configuration lists (cars, weapons, peds, etc.) to
config/config.lua. - Split menu logic into separate files under
menus/(admin.lua, emergency.lua, cars.lua, player.lua, civilian.lua, close.lua). - Created
utils/utils.luafor shared utility functions (notify, giveWeapon, spawnCar, loadAnimDict, etc.).
- Moved configuration lists (cars, weapons, peds, etc.) to
- Modular Loading: Updated
__resource.luato load files in the correct order viaclient_scripts, ensuring dependencies are resolved before execution. - Code Separation: Removed hardcoded lists and utility functions from the main
SimpleMenu.lua, promoting separation of concerns.
Bug Fixes
- Syntax Errors: Fixed multiple parsing errors in menu files, including incorrect
else ifstatements (changed toelseif), missingendkeywords, and unbalanced function closures. - Function Availability: Resolved "attempt to call a nil value" errors for functions like
Admin,PlayerMenu,AddMenu_Civilian, andloadAnimDictby ensuring proper file loading and function definitions. - Load Order Issues: Adjusted the order of scripts in
__resource.luato prevent premature function calls.
Improvements
- Maintainability: Easier to add/remove menu items or modify configurations without touching core logic.
- Performance: Reduced script load times by organizing code into modules.
- User Experience: Enhanced menu navigation with new toggles and animations, plus better error handling.
Known Issues
- Ensure all dependencies (e.g., NativeUI) are properly installed in your FiveM server.
- Test in a development environment before deploying to production.
Installation/Upgrade Notes
- Replace existing
SimpleMenu.luaand related files with the updated versions. - Restart your FiveM server/resource after applying changes.
- No database migrations required.
For full code changes, refer to the updated files in the repository. If issues persist, check server console logs for additional errors.