1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:43:22 +08:00

Add tooltip

This commit is contained in:
Salman Alshamrani 2024-12-23 10:59:06 -05:00
parent 7e3477f4bb
commit 6b635d588f
2 changed files with 9 additions and 1 deletions

View File

@ -28,6 +28,11 @@ This includes content that may not be correctly licensed for osu! usage. Browse
/// </summary>
public static LocalisableString UserContentConfirmButtonText => new TranslatableString(getKey(@"understood"), @"I understand");
/// <summary>
/// "Toggling this filter is disabled in this platform."
/// </summary>
public static LocalisableString FeaturedArtistsDisabledTooltip => new TranslatableString(getKey(@"featured_artists_disabled_tooltip"), @"Toggling this filter is disabled in this platform.");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
@ -113,7 +114,7 @@ namespace osu.Game.Overlays.BeatmapListing
}
}
private partial class FeaturedArtistsTabItem : MultipleSelectionFilterTabItem
private partial class FeaturedArtistsTabItem : MultipleSelectionFilterTabItem, IHasTooltip
{
private Bindable<bool> disclaimerShown = null!;
@ -137,6 +138,8 @@ namespace osu.Game.Overlays.BeatmapListing
[Resolved]
private OsuGame? game { get; set; }
public LocalisableString TooltipText => !Enabled.Value ? BeatmapOverlayStrings.FeaturedArtistsDisabledTooltip : string.Empty;
protected override void LoadComplete()
{
base.LoadComplete();