maruohon / malilib

Library mod for masa's client-side Minecraft mods
GNU Lesser General Public License v3.0
297 stars 131 forks source link

Fixed malilib#163 - onRenderGameOverlayPost not actually rendering above all Hud Elements #164

Open EnricoMessall opened 1 month ago

EnricoMessall commented 1 month ago
sakura-ryoko commented 1 month ago

Applied to --> https://github.com/sakura-ryoko/malilib/commit/6861afeb711a3863a75823f74598ef26fdc1eaba

EnricoMessall commented 1 month ago

Hey @sakura-ryoko

i've noticed you reverted the PR from your project:

"Revert PR https://github.com/maruohon/malilib/pull/164 from upstream, as this code causes rendering problems that you might not immediately notice."

can you explain which rendering problems happen there?

sakura-ryoko commented 1 month ago

Inventory Overlay problems, Info Lines problems, etc. It causes the "Equipment" overlay to not display properly, and the Info Lines not display properly (Text is darkened out behind the BG), among other issues; perhaps.

I am referring to Snapshot; because under Snapshot, more of these elements needed to be moved to the DrawContext rendering away from the Global Stack rendering; such as with various textures; and it causes things rendered with the Global Stack to "Overlay" them.

sakura-ryoko commented 1 month ago

If you want to test your code under Snapshot; go ahead and see the issues presented.

EnricoMessall commented 1 month ago

I see, for AdvancedChat its actually no problem, there you have all the Chat stuff above anything else as soon as you open the chat window, but for other modules that might be not wanted. Maybe its possible to inject into different layeredDrawer variables like the drawers that are private in the InGameHud at other positions then and its questionable if the registerGameOverlayRenderer is labeled correct with:

/**

sakura-ryoko commented 1 month ago

It would need a second IRenderer.onRenderGameOverlayXXXXXX

sakura-ryoko commented 1 month ago

Which malilib based menus are you having trouble with ?

EnricoMessall commented 1 month ago

You can see it in the corresponding issue #163 its about my 1.21.1 port of AdvancedChatHUD https://github.com/Arematics/AdvancedChatHUD

There I resolved it in the release by replacing the malilib injection of onRenderGameOverlayPost with the suggestion here.

sakura-ryoko commented 1 month ago

Does 'AdvancedChatHud' use MaLiLib ?

EnricoMessall commented 1 month ago

Yes, all AdvancedChat Mods depend on it

sakura-ryoko commented 1 month ago

Yes, all AdvancedChat Mods depend on it

Then I can just add an additional Interface for you to insert the rendering into the Drawer, while leaving the existing untouched. Does that work?

EnricoMessall commented 1 month ago

Sorry, i can also use it like that and keep the MaliLib Mixin overwritten as it is, my current AdvancedChatHUD release works as expected, i dont need a specific endpoint from Malilib :D Just wanted to mention earlier that maybe the JavaDoc for the onRenderGameOverlayPost might not be fully accurate when it says its after all Minecraft renders but then renders behind the InGameHUD elements as seen on the screenshot in #163

sakura-ryoko commented 1 month ago

They perhaps added this to the code (Depth Test) and the Mixin wasn't changed. Under Snapshot, there is no enable/disable depth test at this location.