(BREAKING CHANGE) beginWindow now uses (x, y) as the top-left window coords. endWindow now returns { x, y, w, h } (size added).
Check updated demo to learn how to center a window on the screen.
Now vein has all necessary APIs to support multiple windows (or frames, as they called now):
endFrame returns frameRect, which can be used to detect clicks for inactive frames by using natives
setNextFrameDisableInput to disable input for inactive frames
Code your own frame id system for managing their states and use SetScriptGfxDrawOrder for drawing windows in proper order.
(the whole GUI should now be possible to be created with vein only)
Improved CSS support
Resolved a lot of inconsistences and misunderstandings.
And now it’s possible to use CSS for custom items (check updated example from demo).
(it’s a great time to create and publish your own vein item libraries and styles)
Notable changes
Revised a lot of APIs for better consistency and usability
Added new APIs such as setNextFrameDisableInput and CSS related ones
Improved internal structure resulted in more readable and less error-prone code
It allows to process multiple frames correctly. beginFrame now accepts id: string | null as the only parameter.
Use setNextFramePosition if you need to specify the exact position. endFrame now returns frameResponse object, which contains frame rect.
New slider design
It also shows value text by default.
Use new text optional parameter to customize it.
Notable changes
Bugfixes and improvements for multi-frame support
Fixed style property getter infinite recursion
Updated slider and progressBar API
Renamed setNextFramePositionFixed to setNextFrameDisableMove
Color theme and some items design were improved.
Added CSS :active state to provide visual feedback on user interaction.
Added frame border and setNextFrameDisableBorder API.
Custom Scale
Use setNextFrameScale to scale the whole UI.
Improved API
Introduced tons of API improvements based on usage feedback.
Notable changes
Improved documentation by using categories
Fixed textEdit width calculation
Fixed isItemClicked reacted on mouse button being pressed instead of released
Actually nvm, it looks like the increased resmon is caused mostly by the draw natives themselves, which is working as intended, and that most likely won’t change with not using exports.
The example that I have is a bit extreme, since I have a lot of elements in it, but it still almost triple the recorded resmon.
The profiler doesn’t really help, except that it points at the overall menu event handler, and that the menu takes most of the tick:
Without the menu open:
That’s really cool! I really need to update the vein version I use on my server.
Quick thing, can you add an export function that simply opens up a link? Basically, just an export to expose SendNUIMessage({ openUrl: { url: url } }); to other resources.
I sort-of need that for other applications, and modifying vein on every update, or copying the NUI, seems redundant.