mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Turn on featured artist filter by default and add disclaimer when toggling for the first time
This commit is contained in:
@ -19,6 +19,7 @@ namespace osu.Game.Configuration
|
|||||||
SetDefault(Static.LoginOverlayDisplayed, false);
|
SetDefault(Static.LoginOverlayDisplayed, false);
|
||||||
SetDefault(Static.MutedAudioNotificationShownOnce, false);
|
SetDefault(Static.MutedAudioNotificationShownOnce, false);
|
||||||
SetDefault(Static.LowBatteryNotificationShownOnce, false);
|
SetDefault(Static.LowBatteryNotificationShownOnce, false);
|
||||||
|
SetDefault(Static.FeaturedArtistDisclaimerShownOnce, false);
|
||||||
SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null);
|
SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null);
|
||||||
SetDefault<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
|
SetDefault<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
|
||||||
}
|
}
|
||||||
@ -42,6 +43,7 @@ namespace osu.Game.Configuration
|
|||||||
LoginOverlayDisplayed,
|
LoginOverlayDisplayed,
|
||||||
MutedAudioNotificationShownOnce,
|
MutedAudioNotificationShownOnce,
|
||||||
LowBatteryNotificationShownOnce,
|
LowBatteryNotificationShownOnce,
|
||||||
|
FeaturedArtistDisclaimerShownOnce,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Info about seasonal backgrounds available fetched from API - see <see cref="APISeasonalBackgrounds"/>.
|
/// Info about seasonal backgrounds available fetched from API - see <see cref="APISeasonalBackgrounds"/>.
|
||||||
@ -53,6 +55,6 @@ namespace osu.Game.Configuration
|
|||||||
/// The last playback time in milliseconds of a hover sample (from <see cref="HoverSounds"/>).
|
/// The last playback time in milliseconds of a hover sample (from <see cref="HoverSounds"/>).
|
||||||
/// Used to debounce hover sounds game-wide to avoid volume saturation, especially in scrolling views with many UI controls like <see cref="SettingsOverlay"/>.
|
/// Used to debounce hover sounds game-wide to avoid volume saturation, especially in scrolling views with many UI controls like <see cref="SettingsOverlay"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LastHoverSoundPlaybackTime
|
LastHoverSoundPlaybackTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
osu.Game/Localisation/BeatmapOverlayStrings.cs
Normal file
34
osu.Game/Localisation/BeatmapOverlayStrings.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// 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.Localisation;
|
||||||
|
|
||||||
|
namespace osu.Game.Localisation
|
||||||
|
{
|
||||||
|
public static class BeatmapOverlayStrings
|
||||||
|
{
|
||||||
|
private const string prefix = @"osu.Game.Resources.Localisation.BeatmapOverlayStrings";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "User content disclaimer"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString UserContentDisclaimer => new TranslatableString(getKey(@"user_content_disclaimer"), @"User content disclaimer");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "By turning off the "featured artist" filter, all user uploaded content will be displayed.
|
||||||
|
///
|
||||||
|
/// This includes content which may not be correctly licensed for use and as such may not be safe for streaming, sharing, or consumption."
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString ByTurningOffTheFeatured => new TranslatableString(getKey(@"by_turning_off_the_featured"),
|
||||||
|
@"By turning off the ""featured artist"" filter, all user uploaded content will be displayed.
|
||||||
|
|
||||||
|
This includes content which may not be correctly licensed for use and as such may not be safe for streaming, sharing, or consumption.");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "I understand"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString Understood => new TranslatableString(getKey(@"understood"), @"I understand");
|
||||||
|
|
||||||
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
|
}
|
||||||
|
}
|
@ -3,10 +3,18 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Localisation;
|
||||||
|
using osu.Game.Overlays.Dialog;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
using CommonStrings = osu.Game.Resources.Localisation.Web.CommonStrings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapListing
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
{
|
{
|
||||||
@ -32,6 +40,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
private partial class FeaturedArtistsTabItem : MultipleSelectionFilterTabItem
|
private partial class FeaturedArtistsTabItem : MultipleSelectionFilterTabItem
|
||||||
{
|
{
|
||||||
|
private Bindable<bool> disclaimerShown;
|
||||||
|
|
||||||
public FeaturedArtistsTabItem()
|
public FeaturedArtistsTabItem()
|
||||||
: base(SearchGeneral.FeaturedArtists)
|
: base(SearchGeneral.FeaturedArtists)
|
||||||
{
|
{
|
||||||
@ -40,7 +50,60 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private SessionStatics sessionStatics { get; set; }
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private IDialogOverlay dialogOverlay { get; set; }
|
||||||
|
|
||||||
protected override Color4 GetStateColour() => colours.Orange1;
|
protected override Color4 GetStateColour() => colours.Orange1;
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
disclaimerShown = sessionStatics.GetBindable<bool>(Static.FeaturedArtistDisclaimerShownOnce);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnClick(ClickEvent e)
|
||||||
|
{
|
||||||
|
if (!disclaimerShown.Value && dialogOverlay != null)
|
||||||
|
{
|
||||||
|
dialogOverlay.Push(new FeaturedArtistConfirmDialog(() =>
|
||||||
|
{
|
||||||
|
disclaimerShown.Value = true;
|
||||||
|
base.OnClick(e);
|
||||||
|
}));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OnClick(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal partial class FeaturedArtistConfirmDialog : PopupDialog
|
||||||
|
{
|
||||||
|
public FeaturedArtistConfirmDialog(Action confirm)
|
||||||
|
{
|
||||||
|
HeaderText = BeatmapOverlayStrings.UserContentDisclaimer;
|
||||||
|
BodyText = BeatmapOverlayStrings.ByTurningOffTheFeatured;
|
||||||
|
|
||||||
|
Icon = FontAwesome.Solid.ExclamationTriangle;
|
||||||
|
|
||||||
|
Buttons = new PopupDialogButton[]
|
||||||
|
{
|
||||||
|
new PopupDialogDangerousButton
|
||||||
|
{
|
||||||
|
Text = BeatmapOverlayStrings.Understood,
|
||||||
|
Action = confirm
|
||||||
|
},
|
||||||
|
new PopupDialogCancelButton
|
||||||
|
{
|
||||||
|
Text = CommonStrings.ButtonsCancel,
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user