From 4f53185d436c6e8fc4d69ff914e340084aa392bc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Apr 2018 16:15:23 +0900 Subject: [PATCH] Invert logic to match existing toggles --- osu.Game/Configuration/OsuConfigManager.cs | 9 +++---- .../Play/PlayerSettings/VisualSettings.cs | 12 +++++----- .../Skinning/LocalSkinOverrideContainer.cs | 24 +++++++++---------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index a7dcaef500..509622c2fe 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -15,8 +15,6 @@ protected override void InitialiseDefaults() // UI/selection defaults 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); @@ -62,6 +60,9 @@ protected override void InitialiseDefaults() Set(OsuSetting.ShowFpsDisplay, false); Set(OsuSetting.ShowStoryboard, true); + Set(OsuSetting.BeatmapSkins, true); + Set(OsuSetting.BeatmapHitsounds, true); + Set(OsuSetting.CursorRotation, true); Set(OsuSetting.MenuParallax, true); @@ -136,7 +137,7 @@ public enum OsuSetting ScreenshotFormat, ScreenshotCaptureMenuCursor, SongSelectRightMouseScroll, - IgnoreBeatmapSkin, - IgnoreBeatmapHitsounds + BeatmapSkins, + BeatmapHitsounds } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 66d2d413fa..439e344020 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -15,8 +15,8 @@ public class VisualSettings : PlayerSettingsGroup private readonly PlayerSliderBar dimSliderBar; private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; - private readonly PlayerCheckbox ignoreBeatmapSkinToggle; - private readonly PlayerCheckbox ignoreBeatmapHitsoundsToggle; + private readonly PlayerCheckbox beatmapSkinsToggle; + private readonly PlayerCheckbox beatmapHitsoundsToggle; public VisualSettings() { @@ -37,8 +37,8 @@ public VisualSettings() Text = "Toggles:" }, showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, - ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" }, - ignoreBeatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Ignore beatmap hitsounds" } + beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" }, + beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" } }; } @@ -48,8 +48,8 @@ private void load(OsuConfigManager config) dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); - ignoreBeatmapSkinToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); - ignoreBeatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); + beatmapSkinsToggle.Bindable = config.GetBindable(OsuSetting.BeatmapSkins); + beatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds); } } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index f4476eb3a6..bab2a956be 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -16,10 +16,13 @@ public class LocalSkinOverrideContainer : Container, ISkinSource { public event Action SourceChanged; + private Bindable beatmapSkins = new Bindable(); + private Bindable beatmapHitsounds = new Bindable(); + public Drawable GetDrawableComponent(string componentName) { Drawable sourceDrawable; - if (!ignoreBeatmapSkin && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) + if (beatmapSkins && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) return sourceDrawable; return fallbackSource?.GetDrawableComponent(componentName); } @@ -27,7 +30,7 @@ public Drawable GetDrawableComponent(string componentName) public Texture GetTexture(string componentName) { Texture sourceTexture; - if (!ignoreBeatmapSkin && (sourceTexture = source.GetTexture(componentName)) != null) + if (beatmapSkins && (sourceTexture = source.GetTexture(componentName)) != null) return sourceTexture; return fallbackSource.GetTexture(componentName); } @@ -35,7 +38,7 @@ public Texture GetTexture(string componentName) public SampleChannel GetSample(string sampleName) { SampleChannel sourceChannel; - if (!ignoreBeatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) + if (beatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) return sourceChannel; return fallbackSource?.GetSample(sampleName); } @@ -80,19 +83,16 @@ protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnl return dependencies; } - private Bindable ignoreBeatmapSkin = new Bindable(); - private Bindable ignoreBeatmapHitsounds = new Bindable(); - [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - ignoreBeatmapSkin = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); - ignoreBeatmapSkin.ValueChanged += val => onSourceChanged(); - ignoreBeatmapSkin.TriggerChange(); + beatmapSkins = config.GetBindable(OsuSetting.BeatmapSkins); + beatmapSkins.ValueChanged += val => onSourceChanged(); + beatmapSkins.TriggerChange(); - ignoreBeatmapHitsounds = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); - ignoreBeatmapHitsounds.ValueChanged += val => onSourceChanged(); - ignoreBeatmapHitsounds.TriggerChange(); + beatmapHitsounds = config.GetBindable(OsuSetting.BeatmapHitsounds); + beatmapHitsounds.ValueChanged += val => onSourceChanged(); + beatmapHitsounds.TriggerChange(); } protected override void LoadComplete()