-
Notifications
You must be signed in to change notification settings - Fork 124
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
Initial Integration of NUI (Relates to #455) #536
Initial Integration of NUI (Relates to #455) #536
Conversation
Removed overlays from NUIManager, as they served the same purpose and ui screens. Pressing the Esc key should now close NUI screens.
The files generally relate to UI file formats, which are re-used for compatibility reasons.
The UI size can now be different to the screen resolution, which is often helpful when running a very high native resolutions. The setting can be found in the Options->Resolution menu from the main menu.
Thank you once more for being our friendly neighborhood code Santa showing up bearing wondrous gifts at random times. While this is the first comment on the PR there have been a bunch on Discord already, not sure if you see those but there have been a lot of banter about how amazing all this is 😁 There is now a TeraNUI build in Jenkins http://jenkins.terasology.io/teraorg/job/Libraries/job/TeraNUI/ and available at I added some commits that reworked the Gradle in TeraNUI and hooked up a Jenkinsfile. You up for adding another PR with the three commits you've got on top, bumping the version there to I haven't personally tested this one although it sounds like a few of the others are. I did manage to fully test the setup for TS though, and this looks equally superb - your PR details are at a whole other level, as usual 👍 |
I've updated my |
FYI for testing this PR: the TEraNUI |
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.
Thank you so much Santa! 🎅 😄
This is excellent stuff! I'm happy to merge this very soon and we can iron out the kinks later
Also: NUI v2.0.0 is available in artifactory now
EDIT: I'm actually having a little trouble building for Android. Something about JOML not being able to be processed
* A Gson Adapter factory for supporting enums in a case-insensitive manner | ||
* NOTE: Taken from Terasology for compatibility with NUI JSON files. | ||
*/ | ||
public class CaseInsensitiveEnumTypeAdapterFactory implements TypeAdapterFactory { |
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.
We've generally put the utility stuff stolen from Terasology in the util package
engine/src/main/java/org/destinationsol/game/screens/MainGameScreen.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/destinationsol/menu/ResolutionScreen.java
Outdated
Show resolved
Hide resolved
The only classes using TeraMath types were part of the NUI-related code, which should have been using JOML types instead.
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.
The time has come to finally merge this thing, for if we don't now, I reckon we might not at all in the near future! (We are terrible at forcing ourselves to actually do things 😅 )
Description
This pull request introduces the NUI UI library to Destination Sol, with the intention of eventually replacing the built-in solution. It also introduces Terasology's console UI into the game and adds a command to display NUI UI screens. This relates to #455.
I have re-created a series of themed widget graphics for Destination Sol, which are roughly based on the existing UI. You can change those or modify them as you see fit, or even replace them entirely. They were designed for testing NUI, as Terasology's UI graphics looked rather out of place in Destination Sol.
Apart from the console screen, none of the pre-existing UI screens have been ported yet. The NUI UI system and the built-in one co-exist, although they may occasionally conflict, as they use a shared
SpriteBatch
instance.Testing
Configuring NUI
nui-extraction-gestalt7
branch and run the commandgradlew publishToMavenLocal
in the cloned projectTesting that NUI works
Testing NUI's widgets
showNUIScreen engine:migTestScreen
.Testing that NUI scales
One of the major issues with the existing UI system is that it does not scale very well. UI elements often appear out of alignment when the resolution is changed. The new NUI implementation should not suffer as much from this issue.
Escape
key.Escape
again) and go back to the main menu.Testing that NUI works
andTesting NUI's widgets
sections again. Ensure that the UI appears visually similar and is still functional.Testing with non-discrete resolutions (Windowed mode only)
Testing UI scaling
Options->Resolution
menu and press theNUI UI Scale
button to change the UI scale.target * scale
to the target resolution.Multi-platform testing
Reference Renderings
I have taken the following screenshots to show how the NUI UI appears on my set-up. If the appearance differs from these then there might be a rendering bug that I was not aware of.
Notes
MigTestScreen
, as it's a very good test of how the widgets render.nui-extraction-merge
before submitting this pull request.Known Issues
Minor Issues
Major issues
mavenLocal
repository, as the NUI library needs to be built from source for now.javax.servlet
into the build, which should not be a compile-time dependency, however it was needed to get the code to work.engine/src/main/resources/org/destinationsol/assets/textures/ui/nui/terasology
folder are taken directly from Terasology, when Destination Sol equivalents should be used instead. The UI theme should be consistent, although most of the UI graphics there are unused at the moment.