mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Update tooltip implementations
This commit is contained in:
@ -12,7 +12,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Graphics
|
||||
{
|
||||
public class DateTooltip : VisibilityContainer, ITooltip
|
||||
public class DateTooltip : VisibilityContainer, ITooltip<DateTimeOffset>
|
||||
{
|
||||
private readonly OsuSpriteText dateText, timeText;
|
||||
private readonly Box background;
|
||||
@ -63,14 +63,10 @@ namespace osu.Game.Graphics
|
||||
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
|
||||
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint);
|
||||
|
||||
public bool SetContent(object content)
|
||||
public void SetContent(DateTimeOffset date)
|
||||
{
|
||||
if (!(content is DateTimeOffset date))
|
||||
return false;
|
||||
|
||||
dateText.Text = $"{date:d MMMM yyyy} ";
|
||||
timeText.Text = $"{date:HH:mm:ss \"UTC\"z}";
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Move(Vector2 pos) => Position = pos;
|
||||
|
Reference in New Issue
Block a user