mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Visual settings: Ignore beatmap hitsounds
This commit is contained in:
parent
606e088713
commit
1ce38c7fc6
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
private readonly PlayerSliderBar<double> 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<double>(OsuSetting.BlurLevel);
|
||||
showStoryboardToggle.Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||
ignoreBeatmapSkinToggle.Bindable = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapSkin);
|
||||
ignoreBeatmapHitsoundsToggle.Bindable = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapHitsounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<TConfiguration, TValue>(Func<TConfiguration, TValue?> query) where TConfiguration : SkinConfiguration where TValue : struct
|
||||
{
|
||||
@ -75,6 +81,7 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
|
||||
private Bindable<bool> ignoreBeatmapSkin = new Bindable<bool>();
|
||||
private Bindable<bool> ignoreBeatmapHitsounds = new Bindable<bool>();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
@ -82,6 +89,10 @@ namespace osu.Game.Skinning
|
||||
ignoreBeatmapSkin = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapSkin);
|
||||
ignoreBeatmapSkin.ValueChanged += val => onSourceChanged();
|
||||
ignoreBeatmapSkin.TriggerChange();
|
||||
|
||||
ignoreBeatmapHitsounds = config.GetBindable<bool>(OsuSetting.IgnoreBeatmapHitsounds);
|
||||
ignoreBeatmapHitsounds.ValueChanged += val => onSourceChanged();
|
||||
ignoreBeatmapHitsounds.TriggerChange();
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user