mirror of https://github.com/ppy/osu
Update match start text prefix in real time
This commit is contained in:
parent
899942611f
commit
a8fa09103c
|
@ -192,12 +192,7 @@ private void matchChanged(ValueChangedEvent<TournamentMatch> match)
|
|||
Origin = Anchor.CentreLeft,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new TournamentSpriteText
|
||||
{
|
||||
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)
|
||||
new ScheduleMatchDate(match.NewValue.Date.Value)
|
||||
{
|
||||
Font = OsuFont.Torus.With(size: 24, weight: FontWeight.Regular)
|
||||
}
|
||||
|
@ -251,6 +246,18 @@ public ScheduleMatch(TournamentMatch match, bool showTimestamp = true)
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
|
Loading…
Reference in New Issue