Fixed "quick lookup" feature for [Fabric 1.20.1]. Reworked lookup tooltip drawing method.#789
Open
MAGGen-hub wants to merge 2 commits into
Open
Fixed "quick lookup" feature for [Fabric 1.20.1]. Reworked lookup tooltip drawing method.#789MAGGen-hub wants to merge 2 commits into
MAGGen-hub wants to merge 2 commits into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #788 (
.jarsnapshot 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.renderTooltipmixin toAbstractContainerScreen.renderTooltipmethod and do some other changes to commonTooltipHandlerclass 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.4and1.21.xcode 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!