1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 11:12:54 +08:00

Fix user-pressed keys remaining pressed whtn autoplay is turned on

This commit is contained in:
Bartłomiej Dach 2024-07-03 10:32:08 +02:00
parent 294aa09c41
commit 84c7d34b77
No known key found for this signature in database

View File

@ -109,11 +109,21 @@ namespace osu.Game.Rulesets.UI
get => replayInputHandler;
set
{
if (replayInputHandler == value)
return;
if (replayInputHandler != null)
{
RemoveHandler(replayInputHandler);
// ensures that all replay keys are released, and that the last replay state is correctly cleared
new ReplayStateReset().Apply(CurrentState, this);
}
else
{
// ensures that all user-pressed keys are released, so that the replay handler may trigger them itself
// setting `UseParentInput` will only sync releases (https://github.com/ppy/osu-framework/blob/45cd7c7c702c081334fce41e7771b9dc6481b28d/osu.Framework/Input/PassThroughInputManager.cs#L179-L182)
SyncInputState(CreateInitialState());
}
replayInputHandler = value;
UseParentInput = replayInputHandler == null;