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

Added Saveable Schematics for the Ring of Loki #75

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

ReignOfFROZE
Copy link

@ReignOfFROZE ReignOfFROZE commented Mar 2, 2025

This PR adds saveable schematics for the Ring of Loki, adding keybinds to:

  • Save a schematic
  • Open the schematic management UI

The schematic management UI is the UI you will use to manage your schematics (as the name implies), allowing you to select the schematic you want to use, change the names of schematics, and delete existing schematics.

Other than that, it's a fairly straightforward change, and doesn't add any real functionality to loki, just some QoL that makes loki a bit easier to use.

Demo

Quick note: I am NOT attached to the icons or background that are included in this PR, and if anyone has alternatives they'd like to create/offer, I'm 100% on board with anything that you think may fit the aesthetic of Botania more, these were some I just pulled together in like 5 minutes.

It also should be noted this was my first time ever making a UI with any UI framework, not just MUI, so this UI code is probably absolutely terrible and if anyone smarter than I has comments, feel free to rip it apart.

Copy link
Member

@glowredman glowredman left a comment

Choose a reason for hiding this comment

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

I can't say much about how well ModularUI is used here, however I have a few points:

  • If you want to use ModularUI: make this feature optional. At the moment, ModularUI is introduced as a hard-dep (and not even declared as one). Botania is listed as active support, so introducing new deps must have a good reason. A cleaner solution (although quite some work) would be reimplementing the GUI without ModularUI.
  • The textures are to high-res. The files are way to big and the textures don't fit in with MC's style and are to detailed for the size they are displayed at.

@miozune
Copy link
Member

miozune commented Mar 2, 2025

Reimplementing GUI with vanilla is quite painful and kills the point in using library. Making it no-op when MUI is missing would be good.
And as I mentioned on Discord, please use MUI2 instead. I understand it's not fun to port things, but we need to move forward for deprecating MUI1.

@ReignOfFROZE ReignOfFROZE marked this pull request as draft March 2, 2025 18:51
@ReignOfFROZE ReignOfFROZE marked this pull request as ready for review March 2, 2025 22:59
@ReignOfFROZE
Copy link
Author

ReignOfFROZE commented Mar 2, 2025

The UI has been migrated to MUI2, the icons have been swapped for 16x16 icons, and I added method stripping and conditional checks to make sure that MUI is loaded for anything relating to the management UI.

@ReignOfFROZE ReignOfFROZE requested a review from glowredman March 5, 2025 15:59
Comment on lines -332 to +414
public static String getLokiCearText(ItemStack stack){
public static String getLokiClearText(){
Copy link
Member

Choose a reason for hiding this comment

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

Please don't rename public fields/methods. Other mods may depend on this.

Copy link
Author

Choose a reason for hiding this comment

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

There weren't any uses that I could find within the GTNewHorizons org, but if you want me to change it back I can.
https://github.com/search?q=org%3AGTNewHorizons+getLokiCearText&type=code

Choose a reason for hiding this comment

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

This was added by Lewis ~2 years ago, so it's unlikely that anyone is using it outside of NH.

But in general, 100% - don't remove/rename/adjust parameters on public methods

@glowredman glowredman dismissed their stale review March 6, 2025 16:46

Changes requested were made, can't say much about the GUI code.

@glowredman glowredman requested review from miozune and a team March 6, 2025 16:46
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.

4 participants