yurisuika / Raised

Raises the hotbar so the selector is not cut off!
GNU Lesser General Public License v3.0
17 stars 5 forks source link

Causes visual glitch with Nature's Compass #78

Closed TheMerricat closed 7 months ago

TheMerricat commented 9 months ago

image

When Raised is loaded, this is what happens when using Nature's Compass. I originally created an issue on their side (https://github.com/MattCzyr/NaturesCompass/issues/163) because I wasn't sure which mod was causing it.

yurisuika commented 8 months ago

I'll bet you this is probably a bug from Nature's Compass. The same behavior came up (see #64) with another mod; the issue was with their rendering logic, a small but crucial error that caused it to be repeatedly rendered. I've come across this same issue in several other mods as well, the story is the same. It usually isn't noticeable without Raised unless it involves textures with transparency.

If you change the chat height then you will notice a third set of text there moving about. image

It would appear that it is rendering every time the RenderGuiOverlayEvent.Post event is called. As far as I can tell, is no check for the element type, so it is simply rendering multiple times. Forge's VanillaGuiOverlay class informs us that there are 27 different element types upon which rendering this event occurs. Now, all of those may not be present each time the screen is drawn, but a good number may be occurring under normal circumstances. It may also present some performance drop (although it is probably very minimal). https://github.com/MattCzyr/NaturesCompass/blob/master/src/main/java/com/chaosthedude/naturescompass/client/ClientEventHandler.java

The solution would be to add such a check, probably most desirably in the mod's ClientEventHandler class. As far as compatibility with Raised goes, this would have to match something other than the element types which Raised translates. These are all ones related to the hotbar/statusbar section, except for chat which was a request that has separate controls. image

So, say for example we use the CROSSHAIR type as a reference. image

As you can see, it works. It is now only rendering the text once, when the crosshair is rendered, and it does not move with Raised. Since Forge no longer has an ALL element type that might have been more preferable in the past, there is less of a clear option which would be the best element type to choose from. Some mods that change when the crosshair renders may cause conflict with such an implementation. VIGNETTE could be another choice, to much the same result. image

yurisuika commented 7 months ago

Gonna close this for now cause it's an issue with NC that Raised is unearthing.