mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Reset KeyCounter if targetState was not found
This commit is contained in:
@ -136,7 +136,11 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetCount() => CountPresses = 0;
|
public void ResetCount()
|
||||||
|
{
|
||||||
|
CountPresses = 0;
|
||||||
|
states.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
public void SaveState()
|
public void SaveState()
|
||||||
{
|
{
|
||||||
@ -155,6 +159,12 @@ namespace osu.Game.Screens.Play
|
|||||||
public void RestoreState(double time)
|
public void RestoreState(double time)
|
||||||
{
|
{
|
||||||
var targetState = states.LastOrDefault(state => state.Time <= time);
|
var targetState = states.LastOrDefault(state => state.Time <= time);
|
||||||
|
if (targetState == null)
|
||||||
|
{
|
||||||
|
ResetCount();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var targetIndex = states.IndexOf(targetState);
|
var targetIndex = states.IndexOf(targetState);
|
||||||
|
|
||||||
states.RemoveRange(targetIndex + 1, states.Count - (targetIndex + 1));
|
states.RemoveRange(targetIndex + 1, states.Count - (targetIndex + 1));
|
||||||
|
Reference in New Issue
Block a user