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

UI Redesign #156

Draft
wants to merge 127 commits into
base: master
Choose a base branch
from
Draft

UI Redesign #156

wants to merge 127 commits into from

Conversation

raeleus
Copy link

@raeleus raeleus commented May 12, 2024

This PR is a complete overhaul of the GDX-Liftoff user interface. The goals are as follows:

  • Eliminate the use of LML
  • Create a new, attractive look and feel
  • Create workflows that benefit both new and experienced users to libGDX
  • Shift design to Java instead of Kotlin to better suit the needs of contributors
  • Ease transition from the old to the new. The maintainer can continue to update both the original and new GUI's until it has been determined that the new one is ready.

The work that has been done:

  • A new UI skin has been developed
  • Advanced layout widgets have been implemented to adapt to extremely small and extremely large displays
  • Three workflows have been created: A normal workflow with smooth transitions and a sleek interface, a quick project workflow for users who want the most basic libgdx project, and a maximized workflow for large screens and simultaneous access to all controls.
  • A searchable list of Third-Party libraries makes finding specific entries less cumbersome
  • Fixes for minor annoyances such as scroll focus and being unable to see what a field is meant to represent
  • Rewording of descriptive strings
  • Context specific error labels
  • App checks for new updates on startup
  • All major screens have been implemented and tested
  • User selections are stored statically in a UserData class ready for use in project creation
  • JavaDocs and comments for all major classes
  • Continues to use the same Preferences file as dictated by the old GUI

This is probably the limit of what I can do on my own since I barely understand Kotlin. I need your help and direction at this point. The work that still needs to be done:

  • Project generation and linking the output to the label in the CompletePanel
  • Change the build project to point to the Java code instead of the Kotlin code
  • TextField filters (because I'm feeling lazy and drained)
  • Converting the rest of your code to Java
  • Reorganzing the project and adding any niceties you need going forward
  • Removal of the old GUI (probably don't do this without extreme testing and introspective thought)

You can test the project by running the Main method in the Main.java class. Clicking the square button in the top right activates the "maximized" mode. In the code I refer to this interchangeably with "fullscreen," though that is a misnomer. I do not intend to activate true fullscreen mode because that's kind of janky for a utility app.

I created a new nls.properties in resources/ui-data so that my changes won't affect the original app. I created separate properties files for URL's and app defaults because it's the easiest way to manipulate data in Idea.

Users annoyed with the startup animation can simply click to bypass it or just use the maximized mode. If you exit the app while in maximized mode, next time the app will start in maximized mode. This will all be explained in text-based and video tutorials which I can develop for libgdx.com and your repo.

With that in mind, I intend to continue to support development of GDX Liftoff as the new official libGDX setup app. I will commit continued longterm support just as I have for the new Particle Editor. I will assist you with any new UI features or tweaks you may need as that is my strength.

The aim of this PR draft is to get you first hand experience with the GUI so I can make any changes you need. You can also take a look at my code structure and see if it's too annoying for you to maintain in its current state. Finally, you can help me with project generation because I'm clueless there. The goal is to convert all that code into Java, but if you'd rather do Java/Kotlin interop that's fine. I just foresee that being incredibly messy in the long term. I'm willing to discuss any of your needs. Thanks!

@raeleus raeleus marked this pull request as draft May 12, 2024 05:26
Copy link
Contributor

@Frosty-J Frosty-J left a comment

Choose a reason for hiding this comment

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

That's a lot of commits. Are you feeling okay?

Running it will make me wish it was in WinForms, so I just looked at the code, minus the boring bits. I don't see any glaring issues.

src/main/java/gdx/liftoff/Main.java Outdated Show resolved Hide resolved
src/main/java/gdx/liftoff/ui/LogoWidget.java Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

If there's ever any problems, premultiply that alpha.

This also reminds me of the limited character set we have here. With gdx-setup I was able to create a project in a folder called Привет, but Gradle wasn't happy with it. So I don't think it matters. THIS IS AMERICA!

Copy link
Author

Choose a reason for hiding this comment

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

Scene2D definitely does not like PMA textures when it comes to fading and blending.
It's a good point about the character set. @tommyettinger, do we need to expand the character set in the fonts? Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fades should be okay if you multiply r, g and b with a, but I'm not going to make it happen and don't expect there to be any problems with it as-is.

Character set I haven't changed my verdict on unless there's a localisation effort. For example, gdx-texture-packer-gui has Russian characters and enables gdx-freetype incremental mode if CJK (Chinese Japanese Korean) mode is activated. You wouldn't want to stuff the whole of China in your skin if you can help it - it has 1.4 billion characters!
https://github.com/crashinvaders/gdx-texture-packer-gui/blob/b04f297/core/src/com/crashinvaders/texturepackergui/controllers/ConfigurationController.java#L72-L81

Copy link
Author

Choose a reason for hiding this comment

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

Fades should be okay if you multiply r, g and b with a, but I'm not going to make it happen and don't expect there to be any problems with it as-is.

That makes the contents dip to black as it turns transparent if I understand what you're saying. I guess that wouldn't matter because of the dark backgrounds in this app, but it's technically incorrect.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would have to test it to be sure but I don't think that's the case if your blend function is set correctly, e.g. (0, .5f, 0, .5f) PMA is equal to (0, 1f, 0, .5f) non-PMA. If you don't multiply RGB by A when using PMA it'll be too bright.

Copy link
Author

Choose a reason for hiding this comment

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

Oh, you're still referencing PMA. Yeah, that's the proper way to do PMA, but I don't think you'll be able to get Scene2D to play along. At least that was my experience working with Spine some time back.

src/main/java/gdx/liftoff/Main.java Outdated Show resolved Hide resolved
@tommyettinger
Copy link
Member

Wow! I knew this was going to be big, I didn't know how big! I need to figure out how I can test and run this...

I think mixing Kotlin and Java via interop should be fine; Liftoff at one point had more Java than Kotlin (I think) because it had two or three large LML-related libraries copied into the sources to make small changes. The only reasons to use absolutely pure Java would be file size, and to target GWT for some reason, but we could use TeaVM if there's a Kotlin-Java mix. Generating files would still be hard on any web target.

Also, welcome back (?) @Frosty-J !

public static final float TOOLTIP_WIDTH_LARGE = 300;

public static void main(String[] args) {
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
Copy link
Member

Choose a reason for hiding this comment

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

This should use StartUpHelper; I can add that whenever.

@tommyettinger
Copy link
Member

So I really have not much idea of what next step I can take. The UI works, it just isn't hooked up to generation. I'm thinking I might spin this off into its own repo, somehow, so I can work on it and get the commits counted... then I can bring back my changes to this PR, merge it, and fix any remaining issues in the main branch here. I want to have this UI in place before I start updating the docs for Liftoff, because the experience would not be the same with the old and new UI.

@raeleus
Copy link
Author

raeleus commented May 22, 2024

I think that would be great! That would enable us to start breaking changes too, so that would be nice. I shared the same concern about documentation. Feel free to message me for input whenever. This will be my top priority outside of game jams. Thank you so much!

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.

None yet

3 participants