diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 6785b53cdd..a7dcaef500 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -16,6 +16,7 @@ namespace osu.Game.Configuration Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Skin, 0, 0, int.MaxValue); Set(OsuSetting.IgnoreBeatmapSkin, false); + Set(OsuSetting.IgnoreBeatmapHitsounds, false); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); @@ -135,6 +136,7 @@ namespace osu.Game.Configuration ScreenshotFormat, ScreenshotCaptureMenuCursor, SongSelectRightMouseScroll, - IgnoreBeatmapSkin + IgnoreBeatmapSkin, + IgnoreBeatmapHitsounds } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 8a2a8ac773..66d2d413fa 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -16,6 +16,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; private readonly PlayerCheckbox ignoreBeatmapSkinToggle; + private readonly PlayerCheckbox ignoreBeatmapHitsoundsToggle; public VisualSettings() { @@ -36,7 +37,8 @@ namespace osu.Game.Screens.Play.PlayerSettings Text = "Toggles:" }, showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, - ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" } + ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" }, + ignoreBeatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Ignore beatmap hitsounds" } }; } @@ -47,6 +49,7 @@ namespace osu.Game.Screens.Play.PlayerSettings blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); ignoreBeatmapSkinToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); + ignoreBeatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); } } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index 3332f73ac7..f4476eb3a6 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -32,7 +32,13 @@ namespace osu.Game.Skinning return fallbackSource.GetTexture(componentName); } - public SampleChannel GetSample(string sampleName) => source.GetSample(sampleName) ?? fallbackSource?.GetSample(sampleName); + public SampleChannel GetSample(string sampleName) + { + SampleChannel sourceChannel; + if (!ignoreBeatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) + return sourceChannel; + return fallbackSource?.GetSample(sampleName); + } public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct { @@ -75,6 +81,7 @@ namespace osu.Game.Skinning } private Bindable ignoreBeatmapSkin = new Bindable(); + private Bindable ignoreBeatmapHitsounds = new Bindable(); [BackgroundDependencyLoader] private void load(OsuConfigManager config) @@ -82,6 +89,10 @@ namespace osu.Game.Skinning ignoreBeatmapSkin = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); ignoreBeatmapSkin.ValueChanged += val => onSourceChanged(); ignoreBeatmapSkin.TriggerChange(); + + ignoreBeatmapHitsounds = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); + ignoreBeatmapHitsounds.ValueChanged += val => onSourceChanged(); + ignoreBeatmapHitsounds.TriggerChange(); } protected override void LoadComplete()