Invert logic to match existing toggles

This commit is contained in:
Dean Herbert 2018-04-25 16:15:23 +09:00
parent c517b73375
commit 4f53185d43
3 changed files with 23 additions and 22 deletions

View File

@ -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
}
}

View File

@ -15,8 +15,8 @@ public class VisualSettings : PlayerSettingsGroup
private readonly PlayerSliderBar<double> dimSliderBar;
private readonly PlayerSliderBar<double> 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<double>(OsuSetting.DimLevel);
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
showStoryboardToggle.Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
ignoreBeatmapSkinToggle.Bindable = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapSkin);
ignoreBeatmapHitsoundsToggle.Bindable = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapHitsounds);
beatmapSkinsToggle.Bindable = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapHitsoundsToggle.Bindable = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
}
}
}

View File

@ -16,10 +16,13 @@ public class LocalSkinOverrideContainer : Container, ISkinSource
{
public event Action SourceChanged;
private Bindable<bool> beatmapSkins = new Bindable<bool>();
private Bindable<bool> beatmapHitsounds = new Bindable<bool>();
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<bool> ignoreBeatmapSkin = new Bindable<bool>();
private Bindable<bool> ignoreBeatmapHitsounds = new Bindable<bool>();
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
ignoreBeatmapSkin = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapSkin);
ignoreBeatmapSkin.ValueChanged += val => onSourceChanged();
ignoreBeatmapSkin.TriggerChange();
beatmapSkins = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapSkins.ValueChanged += val => onSourceChanged();
beatmapSkins.TriggerChange();
ignoreBeatmapHitsounds = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapHitsounds);
ignoreBeatmapHitsounds.ValueChanged += val => onSourceChanged();
ignoreBeatmapHitsounds.TriggerChange();
beatmapHitsounds = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
beatmapHitsounds.ValueChanged += val => onSourceChanged();
beatmapHitsounds.TriggerChange();
}
protected override void LoadComplete()