1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00
osu-lazer/osu.Game/Graphics/Sprites/TruncatingSpriteText.cs
Joseph Madamba 0d51e4f6ce
Fix mod select panels having conflicting tooltips
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.
2023-06-10 12:24:58 -07:00

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;
}
}
}