Skip to content

Fixed "quick lookup" feature for [Fabric 1.20.1]. Reworked lookup tooltip drawing method.#789

Open
MAGGen-hub wants to merge 2 commits into
VazkiiMods:1.20.1from
MAGGen-hub:1.20.1
Open

Fixed "quick lookup" feature for [Fabric 1.20.1]. Reworked lookup tooltip drawing method.#789
MAGGen-hub wants to merge 2 commits into
VazkiiMods:1.20.1from
MAGGen-hub:1.20.1

Conversation

@MAGGen-hub
Copy link
Copy Markdown

Related issue: #788 (.jar snapshot can also be found here)

On version 1.20.1 "quick lookup" tooltip used incorrect mixin to display it's contents.

This issue disabled "quick lookup" feature completely, because activation key (Ctrl/Shift) was bind to method related to tooltip rendering.

This fix rebinds GuiGraphics.renderTooltip mixin to AbstractContainerScreen.renderTooltip method and do some other changes to common TooltipHandler class that forces tooltip to display correctly with usage of default GuiGraphics API.

More details about fix (and some explanations), can be found in commits descriptions.

New rendering method tested by me on Fabric and Forge and everything worked correctly. (At least it looked so)

WARNING: I checked 1.20.x, 1.20.4 and 1.21.x code branches and it looks like same problem might be found on them too (same mixin used to display tooltip)!

I have no time (also java version, and space on my disk too) to test this fix on thouse branches, so please check if this issue appears on them and apply these changes if needed.

Thank you for your attention, sorry for my bad English and good luck in future development!

MixinGuiGraphics used to provide "quick lookup" feature was bind to `public void renderTooltip(Font font, ItemStack itemStack, int i, int j)` method of `GuiGraphics.class` that was not working for unknown reason.
Current mixin bind to `protected void renderTooltip(GuiGraphics guiGraphics, int i, int j)` method in `AbstractContainerScreen.class`.
Rellated issue: VazkiiMods#788
`Tesselator` buffer builder renders tooltip background behind ALL items inside inventory on fabric version. This fix uses `GuiGraphics.bufferSource` to get buffer object with the same interface. Tooltip will be rendered on `guiOverlay` layer provided by `GuiGraphics` class.
Fixed tooltip "green circle" jitter when displayed with max interface size.
Cahnged "green circle" timings. Now one tick from lookup time are reserved to display full circle (when it's posible), because sometimes it looked like book opened before circle was filled (very noticable with small lookup time).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant