Implement legacy combo splash
This is a MVP implementation of combo splashes from osu!stable. Supports multiple (comboburst-N.png) sprites.
Demo (BMS's skin, default skin, custom legacy skin):
https://user-images.githubusercontent.com/53872073/161394720-45fe3f59-35e1-49a0-a340-efbf477c9b03.mp4
Closes https://github.com/ppy/osu/issues/4629
Aside from the above, there are unresolved code inspections (please run inspectcode locally to check) and this component should come with a test scene to be able to preview it without launching the game.
The component is also missing several features and quirks from stable (among others: ruleset-specific burst sprites and burst combo thresholds, being able to toggle on/off the order randomisation, being able to display the burst from both sides of the screen). But I suppose this was signposted as an MVP, just not sure how viable it is given all of the aforementioned omissions.
Also the Z-order is weird - as is the burst can display on top of the combo counter and other HUD elements which seems undesirable.
ruleset-specific
Where is the correct place to place these 2 settings (threshold check and sprite name)? I think, inside Ruleset?
being able to display the burst from both sides of the screen
To have the burst from both sides player is supposed to add a second component, flip it and anchor to the opposite side, but in this case both bursts will appear every time. Stable shows the splash from the random side each time. I'm not sure how to implement this. Something like "share an bindable between all ComboSplashes that will somehow block ValueChangedEvent for everything except the first ComboSplash; it will choose random ComboSplash from available and trigger animation on it" may work, but feels weird.
Z-order
The latest added component to the skin is always on top. If this to be fixed locally by rearranging skin components somehow, it will become a problem again when sprite placing will be implemented. Maybe, it's better to handle this on skin editor level by adding "bring to back/front" options?
Where is the correct place to place these 2 settings (threshold check and sprite name)? I think, inside
Ruleset?
You would make a specific return of the component in each ruleset's LegacyTransformer. And potentially falback to a default at LegacySkin for rulesets that don't have support.
To have the burst from both sides player is supposed to add a second component, flip it and anchor to the opposite side, but in this case both bursts will appear every time. Stable shows the splash from the random side each time. I'm not sure how to implement this. Something like "share an bindable between all
ComboSplashes that will somehow blockValueChangedEventfor everything except the firstComboSplash; it will choose randomComboSplashfrom available and trigger animation on it" may work, but feels weird.
You'd make the component handle both sides, rather than having two separate components.
The latest added component to the skin is always on top. If this to be fixed locally by rearranging skin components somehow, it will become a problem again when sprite placing will be implemented. Maybe, it's better to handle this on skin editor level by adding "bring to back/front" options?
This is out of scope. Handle the default case, not the skin editor case.
I'm still not sure how to properly override sprites. Does GetDrawableComponent in legacy transformer fire before component's BDL?
I'm still not sure how to properly override sprites. Does
GetDrawableComponentin legacy transformer fire before component's BDL?
If you don't want to derive the LegacyComboSplash component, you can nest a skin component inside your component and make an OsuSkinComponents lookup for it. Then you can implement the logic in each ruleset's transformer mapping that lookup to the correct sprite name. Something like this:
diff --git a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs
index 71657ed532..c5f4e5d351 100644
--- a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs
+++ b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs
@@ -20,5 +20,6 @@ public enum OsuSkinComponents
SliderBody,
SpinnerBody,
ApproachCircle,
+ ComboSplash
}
}
diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs
index 900ad6f6d3..dbf2480021 100644
--- a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs
+++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs
@@ -32,8 +32,8 @@ public override Drawable GetDrawableComponent(ISkinComponent component)
{
switch (osuComponent.Component)
{
- case OsuSkinComponents.FollowPoint:
- return this.GetAnimation(component.LookupName, true, true, true, startAtCurrentTime: false);
+ case OsuSkinComponents.ComboSplash:
+ return this.GetAnimation("osu-combo-splash", false, false);
case OsuSkinComponents.SliderFollowCircle:
var followCircle = this.GetAnimation("sliderfollowcircle", true, true, true);
Let me know if this doesn't make sense (I haven't tested so I may be missing something).
This didn't allow to abstract from rulesets due to deriving from gameplay skin elements, if i understood correctly.
I created local ISkinComponent subclass, and used it to get a container for sprites with specific names via GetDrawableComponent. Not sure that i done everything properly.
Also, seems that only pippi's sprite is presented in game resources. Sprites for catch and mania are missed.
I've brought this up-to-date, but still needs some work to get it in a good state.
I don't know how to use it. Could you record a video to teach me
any news on this?