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

Causing funny ui issues with journeymap. #109

Open
mysticdrew opened this issue Sep 11, 2024 · 3 comments
Open

Causing funny ui issues with journeymap. #109

mysticdrew opened this issue Sep 11, 2024 · 3 comments

Comments

@mysticdrew
Copy link

So, I draw screens on top of each other with a z translation of 2000.
With your mod installed, it does this.
java_PBrZLGrGQS

it should look like this.
image

This is my layering logic
https://github.com/TeamJM/journeymap-api/blob/56b6778a4bfebfee80ed10673988ee5809b5bfe4/common/src/main/java/journeymap/api/v2/client/ui/component/LayeredScreen.java#L47

I am curious what you are doing that is causing this? I can increase the z translation to 2001 and it fixes it. But, that only fixes it on my end with my mod. This is likely causing compatibility issues with other mods too, so we should come up with a solution that fix it at the source.

@Motschen
Copy link
Owner

After looking into this, it seems like my screen change detection system is unable to handle the fact that you're rendering two screens at the same time.
Any time the render method of a screen is called, Blur+ does a few checks to find out whether the current screen has blur and a background, or not. This is needed for fade in/out effects.
Unfortunately, I have to do it this way, as screens do not have these properties explicitly declared.

https://github.com/Motschen/Blur/blob/plus-1.21.4/common/src/main/java/eu/midnightdust/blur/mixin/MixinScreen.java#L27

When a screen change is detected and the new screen (in this case your layered one) does not appear to have blur, the fade out effect manually renders blur and writes the framebuffer, which is likely the cause of the text glitching:
https://github.com/Motschen/Blur/blob/plus-1.21.4/common/src/main/java/eu/midnightdust/blur/Blur.java#L33

@Motschen
Copy link
Owner

I'll see if I can find a solution that keeps the current behavior while taking nested screens into account.

@mysticdrew
Copy link
Author

mysticdrew commented Jan 25, 2025

With the latest version, we do not call minecraft.setScreen if there is a background screen.
We only call it if there is not background screen.
https://github.com/TeamJM/journeymap-api/blob/ead352fed7e8e2d7c23fbf89bafde305064c98dd/common/src/main/java/journeymap/api/v2/client/ui/component/LayeredScreen.java#L21-L30

That might be helpful.

This layered screen mimics a lot of what the vanilla RealmsPopupScreen does. I imagine other mods use a similar thing if they layer screens.

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

No branches or pull requests

2 participants