mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Reorder the way input is handled for replays
Fixes https://github.com/ppy/osu/issues/1625 .
This commit is contained in:
parent
08ffd886e3
commit
57cd50c45e
@ -71,6 +71,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
public override bool HandleKeyboardInput => Interactive;
|
||||
public override bool HandleMouseInput => Interactive;
|
||||
|
||||
public override bool MaskingAffectsInput => false;
|
||||
|
||||
public override bool RemoveWhenNotAlive => false;
|
||||
public override bool RemoveCompletedTransforms => false;
|
||||
protected override bool RequiresChildrenUpdate => true;
|
||||
|
@ -136,9 +136,20 @@ namespace osu.Game.Rulesets.UI
|
||||
int loops = 0;
|
||||
|
||||
while (validState && requireMoreUpdateLoops && loops++ < max_catch_up_updates_per_frame)
|
||||
{
|
||||
if (!base.UpdateSubTree())
|
||||
return false;
|
||||
|
||||
if (isAttached)
|
||||
{
|
||||
// When handling replay input, we need to consider the possibility of fast-forwarding, which may cause the clock to be updated
|
||||
// to a point very far into the future, then playing a frame at that time. In such a case, lifetime MUST be updated before
|
||||
// input is handled. This is why base.Update is not called from the derived Update when handling replay input, and is instead
|
||||
// called manually at the correct time here.
|
||||
base.Update();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -173,8 +184,11 @@ namespace osu.Game.Rulesets.UI
|
||||
// to ensure that the its time is valid for our children before input is processed
|
||||
Clock.ProcessFrame();
|
||||
|
||||
// Process input
|
||||
base.Update();
|
||||
if (!isAttached)
|
||||
{
|
||||
// For non-replay input handling, this provides equivalent input ordering as if Update was not overridden
|
||||
base.Update();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
Loading…
Reference in New Issue
Block a user