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

[Tweak] Add visualization for pause menu item cycling #3118

Merged
merged 1 commit into from Aug 20, 2023

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Aug 13, 2023

This adds a new visualization in the pause menu to indicate when there are multiple items available for a "slot". When a slot is not being cycled, small icons to the bottom left/right will be displayed for the previous and next cycle items. When hovering over a cycle-able slot, a small A button indicator is displayed. Once cycling, the two extra item icons will animate to full size - left and right of the slot.

This has no change of behavior for the actual cycle logic. It is strictly a visual addition only. I've designed this do be usable with any inventory slot, but currently is only being used for adult/child trade slots. Eventually, after this PR and #1915 are merged, there is opportunity to also redo the trade cycle logic itself more generically.

The rendering of this is possible using the following techniques:
Basically I have one group of vertices defined for the left and right items that is centered around 0,0 (item + shadow shape), and I translate the current matrix to the center of the desired slot. This makes it so the same vertices can be reused for all possible inventory slots (and multiple slots in the same render frame!). The "actively cycling" vs "not cycling" states effect is just additional matrix transformations, so again the same vertices are used, just at a different scale and position.

This PR can either by merged before or after #1915, but ideally which ever is merged first, the other should match the changes.

Closes #2605

image
image

2023-08-13.16-16-57.mp4

Build Artifacts

@briaguya-ai
Copy link
Contributor

this looks really cool! could you share a video of how it works with only 2 (or just 1) item in a trade slot?

@Archez
Copy link
Contributor Author

Archez commented Aug 13, 2023

this looks really cool! could you share a video of how it works with only 2 (or just 1) item in a trade slot?

Sure! Basically with no left or right, nothing is rendered. If there is only a left or only a right, then only that respective item is rendered. In the case of adult trade for example, if the same 2nd item is set for both left and right, then only the left is rendered. The adult trade Prev/Next funcs will return the same item if you only have 2 adult trade items.

2023-08-13.17-38-10.mp4

@briaguya-ai
Copy link
Contributor

oh yeah, it still has the "you can enter select but you can't switch" behavior, but that's completely unrelated to this enhancement

@Archez
Copy link
Contributor Author

Archez commented Aug 13, 2023

oh yeah, it still has the "you can enter select but you can't switch" behavior, but that's completely unrelated to this enhancement

Fixing that falls in line with my desire to unify/standardize the item cycling behavior as I mentioned above in a follow up PR 👍

Copy link
Contributor

@PurpleHato PurpleHato left a comment

Choose a reason for hiding this comment

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

LGTM! And also looks really sick, great job on that!

@garrettjoecox garrettjoecox merged commit 0ce2d30 into HarbourMasters:develop Aug 20, 2023
8 checks passed
@Archez Archez deleted the visual-item-cycling branch August 21, 2023 00:37
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.

[UI/UX] Indicate which inventory slots have alternative items you can cycle between
5 participants