mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Invoke RevertResult
on parent DHO when nested DHO is reverted
The behaviour described above was removed in
812a4b412a
, thus henceforth
contradicting `RevertResult`'s xmldoc. As it is relied on by some
external rulesets, bring it back to unbreak them.
This commit is contained in:
parent
0cc92ce5f9
commit
db86ced4b4
@ -239,6 +239,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
OnNestedDrawableCreated?.Invoke(drawableNested);
|
||||
|
||||
drawableNested.OnNewResult += onNewResult;
|
||||
drawableNested.OnRevertResult += onNestedRevertResult;
|
||||
drawableNested.ApplyCustomUpdateState += onApplyCustomUpdateState;
|
||||
|
||||
// This is only necessary for non-pooled DHOs. For pooled DHOs, this is handled inside GetPooledDrawableRepresentation().
|
||||
@ -312,6 +313,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
foreach (var obj in nestedHitObjects)
|
||||
{
|
||||
obj.OnNewResult -= onNewResult;
|
||||
obj.OnRevertResult -= onNestedRevertResult;
|
||||
obj.ApplyCustomUpdateState -= onApplyCustomUpdateState;
|
||||
}
|
||||
|
||||
@ -376,6 +378,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
OnRevertResult?.Invoke(this, Result);
|
||||
}
|
||||
|
||||
private void onNestedRevertResult(DrawableHitObject drawableHitObject, JudgementResult result) => OnRevertResult?.Invoke(drawableHitObject, result);
|
||||
|
||||
private void onApplyCustomUpdateState(DrawableHitObject drawableHitObject, ArmedState state) => ApplyCustomUpdateState?.Invoke(drawableHitObject, state);
|
||||
|
||||
private void onDefaultsApplied(HitObject hitObject)
|
||||
|
Loading…
Reference in New Issue
Block a user