Previously CompositeDrawable.CheckChildrenLife() would be run before lifetimeManager.Update() which lead to the new drawables being inserted into the container but not being made alive immediately, leading to the drawable not becoming visibile until the next update loop.
This change pulls back a significant degree of overspecialisation and
rigidity in the class structure of `HitWindows` to make subsequent
changes to hit windows, whose purpose is to improve replay playback
accuracy, possible to do cleanly.
Notably:
- `HitWindows` is full abstract now. In a few use cases, and as a
reference for ruleset implementors, `DefaultHitWindows` is provided as
a separate class instead.
This fixes the weirdness wherein `HitWindows` always declared 6 fields
for result types but some of them would never be set to a non-zero
value or read.
- `HitWindow.GetRanges()` is deleted because it is overspecialised and
prevents being able to adjust hitwindows by ±0.5ms cleanly which will
be required later.
The fallout of this is that the assertion that used `GetRanges()` in
the `HitWindows` ctor must use something else now, and the closest
thing to it was `GetAllAvailableWindows()`, which didn't return
the miss window - so I made it return the miss window and fixed the
one consumer that didn't want it (bar hit error meter) to skip it.
- Diff also contains some clean-up around `DifficultyRange` to unify
handling of it.
Mostly closes https://github.com/ppy/osu/issues/33505.
Compare
https://github.com/ppy/osu/blob/97e6187f0d7c3dbee896596a623e34627135bf0e/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs#L56-L59
I say "mostly" here because I'm rather skeptical that this is 100% rock
solid still, for one reason - namely that the game stores path control
point coordinates relative to the head, then turns them into absolute
coordinates when encoding, and then on decoding turns them back into
coordinates relative to the head, which in floating-point world is a Bad
Idea because of round-off error. But I'm not fixing that without
introducing a completely new beatmap format or rewriting half the
editor to address that, so I'll just pretend that I don't know any
of this until someone notices.
Closes https://github.com/ppy/osu/issues/33231.
I'm not sure how to reproduce the instances of this reported to sentry
with `Drawable{Slider,Spinner}`, but this bug is about to be made worse
by `DrawableHoldNote` in mania getting its own `JudgementResult` subtype
in https://github.com/ppy/osu/pull/33194 - for that one to reproduce
just start gameplay test while editor is seeked to a time instant where
a hold note is mid-hold.
There's possibly an argument here that `CreateResult()` should live on
`HitObject` and not `DrawableHitObject`, and I'd even be partial to such
an argument, but doing that would be a rather hard ruleset API break
(albeit trivial one to resolve), and also may dredge up past
conversations about `Judgement` and `JudgementResult` (cf.
https://github.com/ppy/osu/pull/26563) that I would rather not get into
again.
Notably this is not source-breaking for rulesets. It may be
binary-breaking, I haven't tested.
Also didn't notice a particular case here, but if all code passes up
until we get to the `foreach (var h in nestedHitObjects)` below, then we
could end up stuck here for quite a while.
Having these be separate implementations sounded awesome at the time,
but it only ever led to confusion. There's no practical difference if,
for example, catch sees hitobjects with `IHasPosition` instead of
`IHasXPosition`.