diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 3efaa02a31..6785b53cdd 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -15,6 +15,7 @@ namespace osu.Game.Configuration // UI/selection defaults Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Skin, 0, 0, int.MaxValue); + Set(OsuSetting.IgnoreBeatmapSkin, false); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); @@ -133,6 +134,7 @@ namespace osu.Game.Configuration Skin, ScreenshotFormat, ScreenshotCaptureMenuCursor, - SongSelectRightMouseScroll + SongSelectRightMouseScroll, + IgnoreBeatmapSkin } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 92d069a224..8a2a8ac773 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -15,6 +15,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly PlayerSliderBar dimSliderBar; private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; + private readonly PlayerCheckbox ignoreBeatmapSkinToggle; public VisualSettings() { @@ -34,7 +35,8 @@ namespace osu.Game.Screens.Play.PlayerSettings { Text = "Toggles:" }, - showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" } + showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, + ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" } }; } @@ -44,6 +46,7 @@ namespace osu.Game.Screens.Play.PlayerSettings dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); + ignoreBeatmapSkinToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); } } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index bfbb1719df..3332f73ac7 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -4,9 +4,11 @@ using System; using osu.Framework.Allocation; using osu.Framework.Audio.Sample; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Textures; +using osu.Game.Configuration; namespace osu.Game.Skinning { @@ -14,9 +16,21 @@ namespace osu.Game.Skinning { public event Action SourceChanged; - public Drawable GetDrawableComponent(string componentName) => source.GetDrawableComponent(componentName) ?? fallbackSource?.GetDrawableComponent(componentName); + public Drawable GetDrawableComponent(string componentName) + { + Drawable sourceDrawable; + if (!ignoreBeatmapSkin && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) + return sourceDrawable; + return fallbackSource?.GetDrawableComponent(componentName); + } - public Texture GetTexture(string componentName) => source.GetTexture(componentName) ?? fallbackSource.GetTexture(componentName); + public Texture GetTexture(string componentName) + { + Texture sourceTexture; + if (!ignoreBeatmapSkin && (sourceTexture = source.GetTexture(componentName)) != null) + return sourceTexture; + return fallbackSource.GetTexture(componentName); + } public SampleChannel GetSample(string sampleName) => source.GetSample(sampleName) ?? fallbackSource?.GetSample(sampleName); @@ -60,6 +74,16 @@ namespace osu.Game.Skinning return dependencies; } + private Bindable ignoreBeatmapSkin = new Bindable(); + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + ignoreBeatmapSkin = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); + ignoreBeatmapSkin.ValueChanged += val => onSourceChanged(); + ignoreBeatmapSkin.TriggerChange(); + } + protected override void LoadComplete() { base.LoadComplete();