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:
parent
ba0fbacda0
commit
698ae0832f
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user