-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nui): add SET_NUI_ZINDEX
#2966
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's really good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, just a tiny thing before I can approve.
ns: CFX | ||
apiset: client | ||
--- | ||
## SET_NUI_ZINDEX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It's good practice to have a description for the native, even if its name makes its purpose obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it
@@ -425,6 +425,34 @@ static InitFunction initFunction([] () | |||
context.SetResult(nui::HasFocusKeepInput()); | |||
}); | |||
|
|||
fx::ScriptEngine::RegisterNativeHandler("SET_NUI_ZINDEX", [] (fx::ScriptContext& context) | |||
{ | |||
fx::OMPtr<IScriptRuntime> runtime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one more thing. This is a very deep set of nested braces. Can you cut down the depth with some early returns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you for the changes!
Goal of this PR
Set the z-index for the NUI resource.
How is this PR achieving the goal
You can set the z-index of an NUI resource with
SET_NUI_Z_INDEX
.This PR applies to the following area(s)
FiveM, RedM, Natives
Successfully tested on
Game builds: 3095
Platforms: Windows
Checklist