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

Fix resize bug with Enum Widgets #489

Merged
merged 2 commits into from
Nov 11, 2023

Conversation

ferriarnus
Copy link
Member

Description

Fixes the resize bug when an enum widget (like Redstone mode), is open. The issue is that the screen that is open afterwards does not belong to the widget anymore, as the widget gets remade during a reload. We also can't set the new screen open during the reload, as that causes an issue with the GUI stack. The solution here uses an additional boolean to determine if the screen needs to be opened on the first render tick.

This is the best way I could think of solving this, but I'm not to happy with the first render tick thing.

Closes #(issue)

Todo

  • Things that are yet to be completed for this PR to no longer be a draft.

Checklist:

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have performed a self-review of my own code.
  • I have commented my code in areas it may be challenging to understand.
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.

@Rover656 Rover656 added Type-Bug There is a problem. MC-1.20.1 labels Sep 5, 2023
@Rover656
Copy link
Member

Is this something that should be fixed upstream in (Neo)Forge instead?

@ferriarnus
Copy link
Member Author

Not sure it can. The issue is that on a resize, the widgets are remade, so the open screen no longer belongs to the new widget.

@Rover656 Rover656 merged commit 0e4b5f1 into Team-EnderIO:dev/1.20.1 Nov 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MC-1.20.1 Type-Bug There is a problem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants