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
282 stars 378 forks source link

[Suggestion] Allow some configurable defaults for Interface #579

Open xhorntail opened 1 month ago

xhorntail commented 1 month ago

Is your feature request related to a problem? Please describe. Nope.

Describe the solution you'd like Apologies if this exists and I've overlooked it. The ability to configure some of the Interface defaults without having to edit/pack the TS would be quite nice.

Additional context The specific components I find myself replacing (with the same values) in every call:

A few reasons I feel these options are necessary

Mesrine67 commented 1 month ago
Moozdzn commented 1 month ago

Everything you are requesting can already be done in the file itself notify.lua

It seems that often times, ~500ms or so has already passed on the timer by the time notifications are displayed, leaving 2500 for the player to read the notifications.

You can copy how the position is set and apply it to the duration https://github.com/overextended/ox_lib/blob/8712c9b0c9481e9bfb0cb33dff765252f712bfb5/resource/interface/client/notify.lua#L28

data.duration = data.duration or 2500

Many scripts (including escrowed) have a nasty habit of spamming several notifications at once, and many of them don't give access to the invoking function in order to explicitly adjust the times.

read above

Without audio by default, the player has to visually notice the notification in the far-right corner of the screen before beginning to read it.

read above

The ability to configure some of the Interface defaults without having to edit/pack the TS would be quite nice.

If you are talking about the UI, you dont need to edit it. If you mean the npm package, it just calls the lua exports https://github.com/overextended/ox_lib/blob/8712c9b0c9481e9bfb0cb33dff765252f712bfb5/package/client/resource/interface/notify.ts#L31