mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 23:12:56 +08:00
Update match start text prefix in real time
This commit is contained in:
parent
899942611f
commit
a8fa09103c
@ -192,12 +192,7 @@ namespace osu.Game.Tournament.Screens.Schedule
|
|||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new TournamentSpriteText
|
new ScheduleMatchDate(match.NewValue.Date.Value)
|
||||||
{
|
|
||||||
Text = match.NewValue.Date.Value.CompareTo(DateTimeOffset.Now) > 0 ? "Starting " : "Started ",
|
|
||||||
Font = OsuFont.Torus.With(size: 24, weight: FontWeight.Regular)
|
|
||||||
},
|
|
||||||
new DrawableDate(match.NewValue.Date.Value)
|
|
||||||
{
|
{
|
||||||
Font = OsuFont.Torus.With(size: 24, weight: FontWeight.Regular)
|
Font = OsuFont.Torus.With(size: 24, weight: FontWeight.Regular)
|
||||||
}
|
}
|
||||||
@ -251,6 +246,18 @@ namespace osu.Game.Tournament.Screens.Schedule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ScheduleMatchDate : DrawableDate
|
||||||
|
{
|
||||||
|
public ScheduleMatchDate(DateTimeOffset date, float textSize = OsuFont.DEFAULT_FONT_SIZE, bool italic = true)
|
||||||
|
: base(date, textSize, italic)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Format() => Date < DateTimeOffset.Now
|
||||||
|
? $"Started {base.Format()}"
|
||||||
|
: $"Starting {base.Format()}";
|
||||||
|
}
|
||||||
|
|
||||||
public class ScheduleContainer : Container
|
public class ScheduleContainer : Container
|
||||||
{
|
{
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
|
Loading…
Reference in New Issue
Block a user