mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:43:19 +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 HandleKeyboardInput => Interactive;
|
||||||
public override bool HandleMouseInput => Interactive;
|
public override bool HandleMouseInput => Interactive;
|
||||||
|
|
||||||
|
public override bool MaskingAffectsInput => false;
|
||||||
|
|
||||||
public override bool RemoveWhenNotAlive => false;
|
public override bool RemoveWhenNotAlive => false;
|
||||||
public override bool RemoveCompletedTransforms => false;
|
public override bool RemoveCompletedTransforms => false;
|
||||||
protected override bool RequiresChildrenUpdate => true;
|
protected override bool RequiresChildrenUpdate => true;
|
||||||
|
@ -136,9 +136,20 @@ namespace osu.Game.Rulesets.UI
|
|||||||
int loops = 0;
|
int loops = 0;
|
||||||
|
|
||||||
while (validState && requireMoreUpdateLoops && loops++ < max_catch_up_updates_per_frame)
|
while (validState && requireMoreUpdateLoops && loops++ < max_catch_up_updates_per_frame)
|
||||||
|
{
|
||||||
if (!base.UpdateSubTree())
|
if (!base.UpdateSubTree())
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,9 +184,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
// to ensure that the its time is valid for our children before input is processed
|
// to ensure that the its time is valid for our children before input is processed
|
||||||
Clock.ProcessFrame();
|
Clock.ProcessFrame();
|
||||||
|
|
||||||
// Process input
|
if (!isAttached)
|
||||||
|
{
|
||||||
|
// For non-replay input handling, this provides equivalent input ordering as if Update was not overridden
|
||||||
base.Update();
|
base.Update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user