-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Implement legacy combo splash #17616
base: master
Are you sure you want to change the base?
Conversation
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. |
Where is the correct place to place these 2 settings (threshold check and sprite name)? I think, inside
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
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? |
You would make a specific return of the component in each ruleset's
You'd make the component handle both sides, rather than having two separate components.
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 |
If you don't want to derive the 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. |
[SettingSource("Side, where bursts will appear")] | ||
public Bindable<Side> BurstsSide { get; } = new Bindable<Side>(Side.Random); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about making this the new sort of setting rather than hooking it up to the old setting flow that reads from skin.ini
. This is kind of uncharted territory still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaik there was no way to change this in stable (for osu! and osu!taiko) and there is no setting for this in skin.ini
. I want to implement this here to make the component more flexible, so decided to use "modern" setting.
A mania-specific option for this exists, but it doesn't suit the behaviour implemented here (anchors are screen's sides, not playfield's ones):
Should i use it instead of "modern" setting anyway?
[SettingSource("Side, where bursts will appear")] | ||
public Bindable<Side> BurstsSide { get; } = new Bindable<Side>(Side.Random); | ||
|
||
public Bindable<int> Current { get; } = new BindableInt { MinValue = 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bindable shouldn't be public (or if you really want it to be, it should be externally immutable by exposing as IBindable<int>
).
|
||
private void OnNewCombo(int combo) | ||
{ | ||
if (BurstCondition(combo)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would invert and early-return to reduce nesting.
|
||
namespace osu.Game.Screens.Play.HUD | ||
{ | ||
public class LegacyComboSplash : Container<Container<Sprite>>, ISkinnableDrawable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generic type (Container<Container<Sprite>>
) is a bit much. Is this just for the test? If so, I'd recommend switching over to .ChildrenOfType<>()
there.
Both, | ||
Random |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In stable both is random, for what it's worth. Not sure a new option needs to be invented here.
case SkinnableTargetComponent targetComponent: | ||
if (targetComponent.Target == SkinnableTarget.MainHUDComponents) | ||
{ | ||
var components = base.GetDrawableComponent(component) as SkinnableTargetComponentsContainer; | ||
if (components == null) return null; | ||
|
||
foreach (var comboSplash in components.OfType<LegacyComboSplash>()) | ||
{ | ||
comboSplash.BurstCondition = combo => combo > 0 && combo % 100 == 0; | ||
} | ||
|
||
return components; | ||
} | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than doing this, it will be cleaner if you make a ManiaLegacyComboSplashSide
and return it below, and then include the conditional logic within the subclass (you can likely make it a virutal
/ override
pair if you do this).
I've brought this up-to-date, but still needs some work to get it in a good state. |
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):
2022-04-02.20-30-42.mp4
Closes #4629