overextended / ox_lib

A FiveM resource and script library for Lua and JS.
https://overextended.dev/ox_lib
GNU Lesser General Public License v3.0
313 stars 411 forks source link

[Enhancement] Update opened UI on lib.setMenuOptions() #279

Open mahanmoulaei opened 1 year ago

mahanmoulaei commented 1 year ago

Is your feature request related to a problem? Please describe. It would be nice to reflect the menu changes with a NUI message for the open menu when lib.setMenuOptions() is called.

Without this feature, it takes more code to hide the menu, modify the default value of the scroll options(which needs re-registering of the menu or to call lib.setMenuOptions() on them), set the menu's startIndex, and finally open it again.

Describe the solution you'd like Send a simple NUI message to the UI to reflect and update the changes in the menu once lib.setMenuOptions() is triggered and the menu id that is passed as the parameter matches with the menu id that is already open.

Additional context I noticed this feature could assist with the development of a menu when I was working on a menu with scroll options that upon interacting, should change another option's attributes such as label, description, values, args, etc...

jag3dagster commented 8 months ago

This feature has been requested in the past (#121) and I have even submitted a PR with the functionality (https://github.com/overextended/ox_lib/pull/98). Previously it was considered undesired as the menu was not intended to be super-reactive. If this philosophy has changed I can resubmit the PR.