ox_lib
ox_lib copied to clipboard
[Enhancement] Update opened UI on lib.setMenuOptions()
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...
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.