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

General NUI Fixes #663

Merged

Conversation

BenjaminAmos
Copy link
Contributor

Description

This pull request provides several fixes, both minor and major, which improve the general usability of NUI within Destination Sol:

  • Show the UI cursor when hovering over NUI elements (as is done with the built-in UI)
  • Increase the base mobile UI density to allow for larger UIs (although they will occupy less screen space in comparison to before)
  • Call NUIScreenLayer#onRemoved post-removal, rather than pre-removal. The previous behaviour was likely unintentional.
  • Consume key up/down events in NUIScreenLayer if any of its child KeyActivatedButton widgets consume those events.
  • Prevent KeyActivatedButton from unconditionally consuming up/down arrow key events.
  • Add some public constructors to Destination Sol's custom NUI widgets, so that they can be safely instantiated in code.

Testing

Most of these fixes come from scenarios encountered whilst porting the in-game screens to use NUI. As such, they solve problems are not yet exposed in the develop codebase.

The following things should be testable directly with these changes though:

  • Verify that all NUI screens still render as before
  • Verify that hovering over NUI elements shows the UI cursor in-game

Notes

  • The NUIScreenLayer#onRemoved change is technically an breaking change in functionality, however, since there has never been a release containing NUI yet, it should not have a significant impact.

This should allow for more elements on-screen, although with smaller UI elements.
This makes more sense, since onRemoved implies that the screen has already been removed. It also prevents screens from creating stack overflows when trying to add themselves back again during an onRemoved call.

BREAKING CHANGE: NUIScreenLayer#onRemoved is now called at a different part of the screen lifecycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant