Skip to content
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

Merged
merged 1 commit into from
Dec 25, 2024
Merged

Conversation

poco8537
Copy link
Contributor

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

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action labels Nov 28, 2024
@poco8537 poco8537 changed the title feat(nui): add SET_NUI_ZINDEX feat(nui): add SET_NUI_ZINDEX Nov 28, 2024
Copy link

@Xixn2 Xixn2 left a 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.

Copy link
Contributor

@dalekenium-cfx dalekenium-cfx left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it

Copy link
Contributor

@dalekenium-cfx dalekenium-cfx left a 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!

@dalekenium-cfx dalekenium-cfx added ready-to-merge This PR is enqueued for merging and removed triage Needs a preliminary assessment to determine the urgency and required action labels Dec 5, 2024
@prikolium-cfx prikolium-cfx merged commit 4cd405d into citizenfx:master Dec 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging RedM Issues/PRs related to RedM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants