Bernasss12 / BetterEnchantedBooks

Makes it easier to identify different enchantment books.
MIT License
12 stars 9 forks source link

Compatibility update (for 1.18) #53

Closed Fourmisain closed 2 years ago

Fourmisain commented 2 years ago

ToolTip Fix

IconTooltipDataText had some dummy text that was supposed to warn about conflicts - and it did!

tooltipfix

This is with ToolTip Fix, which reads the string, sees the tooltip would be too large and hence splits the text up into multiple lines, making the string visible - removing the icons in the process too!

A simple fix is to remove the dummy text, that way ToolTip Fix should never try to split it up. This might result in the icons rendering outside the tooltip, but there's no clear way to fix that and this is much better than the alternative.

Rendering glitches

The tooltip icons were previously rendered like this:

MatrixStack matrices = RenderSystem.getModelViewStack();
matrices.push();
matrices.scale(0.5f, 0.5f, 1.0f);
do the stuff
matrices.pop();

Back then there was the question if RenderSystem.applyModelViewMatrix(); was not needed here - it didn't appear so and you might expect the matrices.pop(); should already revert the changes.

Turns out it doesn't. Here's e.g. how Legendary Tooltips look when tooltip icons are rendered: legendary Part of the border is renderered with half the scale, moving it to the top left.

Fix is extremely simple: adding in RenderSystem.applyModelViewMatrix();

P.S. Inofficial release here.