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

Apply suggestions

This commit is contained in:
EVAST9919 2017-11-21 12:22:19 +03:00
parent 0d1b5ae44f
commit 41498ffad3
2 changed files with 4 additions and 19 deletions

View File

@ -17,8 +17,6 @@ namespace osu.Game.Screens.Edit.Components
{
private readonly IconButton playButton;
private bool lastTrackState;
public PlaybackContainer()
{
PlaybackTabControl tabs;
@ -32,7 +30,7 @@ namespace osu.Game.Screens.Edit.Components
Scale = new Vector2(1.4f),
IconScale = new Vector2(1.4f),
Icon = FontAwesome.fa_play_circle_o,
Action = play,
Action = playPause,
Padding = new MarginPadding { Left = 20 }
},
new OsuSpriteText
@ -61,7 +59,7 @@ namespace osu.Game.Screens.Edit.Components
tabs.Current.ValueChanged += newValue => Track.Tempo.Value = newValue;
}
private void play()
private void playPause()
{
if (Track.IsRunning)
Track.Stop();
@ -73,13 +71,7 @@ namespace osu.Game.Screens.Edit.Components
{
base.Update();
var currentTrackState = Track.IsRunning;
if (currentTrackState == lastTrackState)
return;
playButton.Icon = currentTrackState ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;
lastTrackState = currentTrackState;
playButton.Icon = Track.IsRunning ? FontAwesome.fa_pause_circle_o : FontAwesome.fa_play_circle_o;
}
private class PlaybackTabControl : OsuTabControl<double>

View File

@ -12,7 +12,6 @@ namespace osu.Game.Screens.Edit.Components
private const int count_duration = 150;
private readonly OsuSpriteText trackTimer;
private double savedTime;
public TimeInfoContainer()
{
@ -33,13 +32,7 @@ namespace osu.Game.Screens.Edit.Components
{
base.Update();
var currentTime = Track.CurrentTime;
if (savedTime == currentTime)
return;
trackTimer.Text = TimeSpan.FromMilliseconds(currentTime).ToString(@"mm\:ss\:fff");
savedTime = currentTime;
trackTimer.Text = TimeSpan.FromMilliseconds(Track.CurrentTime).ToString(@"mm\:ss\:fff");
}
}
}