mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Update tooltip implementations
This commit is contained in:
@ -31,12 +31,9 @@ namespace osu.Game.Graphics.Cursor
|
||||
private readonly OsuSpriteText text;
|
||||
private bool instantMovement = true;
|
||||
|
||||
public override bool SetContent(object content)
|
||||
public override void SetContent(LocalisableString contentString)
|
||||
{
|
||||
if (!(content is LocalisableString contentString))
|
||||
return false;
|
||||
|
||||
if (contentString == text.Text) return true;
|
||||
if (contentString == text.Text) return;
|
||||
|
||||
text.Text = contentString;
|
||||
|
||||
@ -47,8 +44,6 @@ namespace osu.Game.Graphics.Cursor
|
||||
}
|
||||
else
|
||||
AutoSizeDuration = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public OsuTooltip()
|
||||
|
@ -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