mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Add global web setting for allowing explicit content
This commit is contained in:
parent
249be461d5
commit
24c1839739
@ -60,6 +60,8 @@ namespace osu.Game.Configuration
|
||||
Set(OsuSetting.ExternalLinkWarning, true);
|
||||
Set(OsuSetting.PreferNoVideo, false);
|
||||
|
||||
Set(OsuSetting.AllowExplicitContent, false);
|
||||
|
||||
// Audio
|
||||
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
||||
|
||||
@ -270,5 +272,6 @@ namespace osu.Game.Configuration
|
||||
EditorWaveformOpacity,
|
||||
DiscordRichPresence,
|
||||
AutomaticallyDownloadWhenSpectating,
|
||||
AllowExplicitContent,
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osuTK.Graphics;
|
||||
@ -140,10 +141,19 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
categoryFilter.Current.Value = SearchCategory.Leaderboard;
|
||||
}
|
||||
|
||||
private IBindable<bool> allowExplicitContent;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
private void load(OverlayColourProvider colourProvider, OsuConfigManager config)
|
||||
{
|
||||
background.Colour = colourProvider.Dark6;
|
||||
|
||||
allowExplicitContent = config.GetBindable<bool>(OsuSetting.AllowExplicitContent);
|
||||
allowExplicitContent.BindValueChanged(allow =>
|
||||
{
|
||||
// Update search control if global "explicit allowed" setting changed.
|
||||
Explicit.Value = allow.NewValue ? SearchExplicit.Show : SearchExplicit.Hide;
|
||||
}, true);
|
||||
}
|
||||
|
||||
public void TakeFocus() => textBox.TakeFocus();
|
||||
|
@ -33,6 +33,12 @@ namespace osu.Game.Overlays.Settings.Sections.Online
|
||||
Keywords = new[] { "spectator" },
|
||||
Current = config.GetBindable<bool>(OsuSetting.AutomaticallyDownloadWhenSpectating),
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Hide warnings for explicit content in beatmaps",
|
||||
Keywords = new[] { "nsfw", "18+", "offensive" },
|
||||
Current = config.GetBindable<bool>(OsuSetting.AllowExplicitContent),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user