2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2017-09-21 03:33:07 +08:00
|
|
|
|
using System;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-11-06 13:58:05 +08:00
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2019-02-12 12:04:46 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2018-03-03 23:50:41 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-03-03 23:50:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Play.Break
|
2017-09-21 03:33:07 +08:00
|
|
|
|
{
|
2017-11-06 13:58:05 +08:00
|
|
|
|
public class RemainingTimeCounter : Counter
|
2017-09-21 03:33:07 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly OsuSpriteText counter;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-09-21 03:33:07 +08:00
|
|
|
|
public RemainingTimeCounter()
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
2017-11-06 13:58:05 +08:00
|
|
|
|
InternalChild = counter = new OsuSpriteText
|
2017-09-21 03:33:07 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2019-02-22 18:42:09 +08:00
|
|
|
|
Font = OsuFont.Numeric.With(size: 33),
|
2017-09-21 03:33:07 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-11-06 13:58:05 +08:00
|
|
|
|
protected override void OnCountChanged(double count) => counter.Text = ((int)Math.Ceiling(count / 1000)).ToString();
|
2017-09-21 03:33:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|