mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 23:23:04 +08:00
Add function to reset break index
This commit is contained in:
parent
91fa8a6552
commit
806d41daf4
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play
|
|||||||
breaks = value;
|
breaks = value;
|
||||||
|
|
||||||
// reset index in case the new breaks list is smaller than last one
|
// reset index in case the new breaks list is smaller than last one
|
||||||
currentBreakIndex = 0;
|
resetBreakIndex();
|
||||||
|
|
||||||
initializeBreaks();
|
initializeBreaks();
|
||||||
}
|
}
|
||||||
@ -130,12 +130,17 @@ namespace osu.Game.Screens.Play
|
|||||||
updateBreakTimeBindable();
|
updateBreakTimeBindable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetBreakIndex()
|
||||||
|
{
|
||||||
|
isBreakTime.Value = false;
|
||||||
|
currentBreakIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
private void updateBreakTimeBindable()
|
private void updateBreakTimeBindable()
|
||||||
{
|
{
|
||||||
if (breaks?.Any() != true)
|
if (breaks?.Any() != true)
|
||||||
{
|
{
|
||||||
isBreakTime.Value = false;
|
resetBreakIndex();
|
||||||
currentBreakIndex = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user