-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RenderTooltipEvent
#81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/main/java/com/gtnewhorizon/gtnhlib/client/event/RenderTooltipEvent.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the context of compatibility with https://github.com/GTNewHorizons/AppleCore/blob/master/src/main/java/squeek/applecore/mixins/early/minecraft/GuiScreenMixin.java this is as good as we'll get.
Thanks for the review! |
Adds an event to modify the way item tooltips are rendered.
I chose to redirect the call to
GuiScreen.drawHoveringText()
(which does the actual rendering) inGuiScreen.renderToolTip()
instead of modifyingGuiScreen.drawHoveringText()
itself because that method is not aware of the ItemStack of which the tooltip is being rendered and the method may also used for other, unrelated texts.Examples
Modifying the background and border colors (including translucency)
Modifying the coordinates
23-26-47.mp4
Changing the font
... and combinations of all of the above.