Skip to content

Conversation

viciscat
Copy link
Collaborator

As the name implies, this adds a nice little preview of the contents of a Personal Compactor/Deletor when hovering it. Pretty cool right?

Images

If there are no items, only the slot count is showed (mainly used for AH):

To make this go brrrr, i made a new class, mixin and an invoker.

This update integrates a tooltip display for personal compactor items in the Skyblocker mod. The tooltip shows the contents of the personal compactor when hovered over. This is useful for players to quickly check the contents of their compactor without needing to open it. The commit includes creating a new Java file 'CompactorPreviewTooltipComponent.java' for the compactor tooltip component, adding new inject method 'skyblocker$addTooltipComponent' in 'HandledScreenMixin.java' executed when drawing mouseover tooltip, adding 'DrawContextInvoker.java' for invoking the 'drawTooltip' method in the 'DrawContext' class, and adding 'getItemStack' method in the 'ItemRegistry.java'.
Made it so it doesn't render the slots if no items (mainly for AH)
Copy link
Collaborator

@kevinthegreat1 kevinthegreat1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. It's a great feature! Just have some code style stuff to keep the codebase clean.

Split the logic for CompactorDeletorPreview to reduce the complexity within the HandledScreenMixin.java file. This change helps to make the code simpler and easier to maintain.
Refactored code by moving the BackpackPreview class to a new 'item' sub-package.
@viciscat
Copy link
Collaborator Author

Made the changes you asked for.

@LifeIsAParadox LifeIsAParadox added this to the 1.14 milestone Sep 15, 2023
@kevinthegreat1 kevinthegreat1 merged commit 045e5c5 into SkyblockerMod:master Sep 16, 2023
@viciscat viciscat deleted the compactor_preview branch February 14, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants