1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 08:32:55 +08:00

Move string formatting inside the class

This commit is contained in:
EVAST9919 2017-05-01 07:00:44 +03:00
parent ba0fbacda0
commit 698ae0832f
2 changed files with 7 additions and 25 deletions

View File

@ -145,9 +145,9 @@ namespace osu.Game.Screens.Play
bar.UpdatePosition((float)progress);
graph.Progress = (int)(graph.ColumnCount * progress);
info.TimeCurrent = TimeSpan.FromMilliseconds(currentTime).ToString(@"m\:ss");
info.TimeLeft = TimeSpan.FromMilliseconds(lastHitTime - currentTime).ToString(@"m\:ss");
info.Progress = ((int)(currentTime / lastHitTime * 100)).ToString();
info.TimeCurrent = currentTime;
info.TimeLeft = lastHitTime - currentTime;
info.Progress = (int)(currentTime / lastHitTime * 100);
}
}
}

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using System;
namespace osu.Game.Screens.Play
{
@ -18,28 +19,9 @@ namespace osu.Game.Screens.Play
private const int margin = 10;
public string TimeCurrent
{
set
{
timeCurrent.Text = value;
}
}
public string TimeLeft
{
set
{
timeLeft.Text = @"-" + value;
}
}
public string Progress
{
set
{
progress.Text = value + @"%";
}
}
public double TimeCurrent { set { timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } }
public double TimeLeft { set { timeLeft.Text = @"- " + TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } }
public int Progress { set { progress.Text = value.ToString() + @"%"; } }
[BackgroundDependencyLoader]
private void load(OsuColour colours)