Stop progress as soon as we at 100%

This commit is contained in:
EVAST9919 2017-05-11 01:48:46 +03:00
parent 5b469eff69
commit d55c97a08a
2 changed files with 24 additions and 18 deletions

View File

@ -145,8 +145,11 @@ namespace osu.Game.Screens.Play
double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime);
if((int)progress * 100 < 100)
{
bar.UpdatePosition((float)progress);
graph.Progress = (int)(graph.ColumnCount * progress);
}
}
}
}

View File

@ -75,6 +75,8 @@ namespace osu.Game.Screens.Play
double songCurrentTime = AudioClock.CurrentTime - startTime;
if(songCurrentTime < endTime - startTime)
{
int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds;
if (currentSecond != previousSecond || previousTimespan < 0 && songCurrentTime > 0)
@ -90,7 +92,7 @@ namespace osu.Game.Screens.Play
timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss");
}
int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100);
int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100) + 1;
if (currentPercent != previousPercent)
{
@ -101,3 +103,4 @@ namespace osu.Game.Screens.Play
}
}
}
}