mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:07:38 +08:00
0d51e4f6ce
Going simple with a bool instead of making `TooltipText` init-able, as the current cases will just init `string.Empty`. And not sure if we want custom tooltip text in the future.
24 lines
694 B
C#
24 lines
694 B
C#
// 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.
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
|
using osu.Framework.Graphics.Sprites;
|
|
using osu.Framework.Localisation;
|
|
|
|
namespace osu.Game.Graphics.Sprites
|
|
{
|
|
public sealed partial class TruncatingSpriteText : OsuSpriteText, IHasTooltip
|
|
{
|
|
public bool ShowTooltip { get; init; } = true;
|
|
|
|
public LocalisableString TooltipText => Text;
|
|
|
|
public override bool HandlePositionalInput => IsTruncated && ShowTooltip;
|
|
|
|
public TruncatingSpriteText()
|
|
{
|
|
((SpriteText)this).Truncate = true;
|
|
}
|
|
}
|
|
}
|