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

Add initial animation for health bars #24986

Merged
merged 7 commits into from
Oct 7, 2023
Merged

Conversation

peppy
Copy link
Member

@peppy peppy commented Oct 2, 2023

Pretty jank and I'm not sure how to make better, or how to get it matching stable. Probably need to make a subcomponent which is operating in game time to track the interpolation correctly. Main goal was to breathe some life back into things, so maybe this is fine as a first step.

@bdach bdach force-pushed the health-animates-in-intro branch from 0a34168 to bd71403 Compare October 4, 2023 11:54
@pull-request-size pull-request-size bot added size/M and removed size/L labels Oct 4, 2023
@bdach
Copy link
Collaborator

bdach commented Oct 4, 2023

Attempted to resolve conflicts here (sorry for the force, screwed the first attempt). Please double check.

@peppy peppy added the next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! label Oct 6, 2023
@bdach
Copy link
Collaborator

bdach commented Oct 6, 2023

I've found and attempted to fix an issue wherein finishInitialAnimation() would potentially not actually properly terminate the animation, due to an in-progress Current bindable transform overriding changes to the health value coming from HealthProcessor. The fix is a bit funky but I can't find a better one, so please check it and make sure you're OK with it (and that you don't have a better alternative) before we proceed.

Looks good otherwise.

@@ -107,7 +107,9 @@ private void finishInitialAnimation()
// aside from the repeating `initialIncrease` scheduled task,
// there may also be a `Current` transform in progress from that schedule.
// ensure it plays out fully, to prevent changes to `Current.Value` being discarded by the ongoing transform.
FinishTransforms();
// and yes, this funky `targetMember` spec is seemingly the only way to do this
// (see: https://github.com/ppy/osu-framework/blob/fe2769171c6e26d1b6fdd6eb7ea8353162fe9065/osu.Framework/Graphics/Transforms/TransformBindable.cs#L21)
Copy link
Member Author

Choose a reason for hiding this comment

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

wow

@peppy
Copy link
Member Author

peppy commented Oct 7, 2023

The logic isn't pretty, but this is supposed to be a very quick implementation which gets built on (or replaced) so 🙈 .

@peppy peppy merged commit 7c7771a into ppy:master Oct 7, 2023
@peppy peppy deleted the health-animates-in-intro branch October 10, 2023 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:gameplay next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants