Skip to content
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

[fix] SlotHighlight #288

Merged
merged 2 commits into from Sep 30, 2023

Conversation

lonefelidae16
Copy link
Contributor

fix #285

This also supports highlight opacity.

I remember an issue that it’d be nice to be able to see the slot background, and now it’s possible. But there are some limitations; the blending functionality is based on its alpha and sprite, so it needs to calculate backwards from the target color. In some cases, there are colors that cannot be produced.

This figure shows the case where the color of Item Slot Highlight Foreground is #8955ba00:
Screenshot from 2023-07-09 16-17-44

Note that resourcepacks and/or mods can easily change the sprites and it’s difficult to get the color you want.


Changes

  • update slotHighlight.HandledScreenMixin
    • method injection point has changed: drawSlotHighlight -> drawSlot
    • remove shadow methods/fields: drawSlot(DrawContext, Slot), focusedSlot
    • add shadow methods/fields: isPointOverSlot(Slot, double, double), x, y
    • supports opacity

* update `slotHighlight.HandledScreenMixin`
  - method injection point has changed: `drawSlotHighlight` -> `drawSlot`
  - supports opacity
@juancarloscp52 juancarloscp52 merged commit 810407e into juancarloscp52:1.20 Sep 30, 2023
@lonefelidae16 lonefelidae16 deleted the fix/slot-highlight branch April 30, 2024 01:33
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.

Disabling bedrock inventory slot highlight does not restore vanilla version
2 participants