1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

User setting for always playing first combo break

This commit is contained in:
Endrik Tombak 2020-04-19 12:23:41 +03:00
parent 149efec985
commit f893d523f5
3 changed files with 19 additions and 3 deletions

View File

@ -91,6 +91,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.FadePlayfieldWhenHealthLow, true); Set(OsuSetting.FadePlayfieldWhenHealthLow, true);
Set(OsuSetting.KeyOverlay, false); Set(OsuSetting.KeyOverlay, false);
Set(OsuSetting.PositionalHitSounds, true); Set(OsuSetting.PositionalHitSounds, true);
Set(OsuSetting.AlwaysPlayComboBreak, false);
Set(OsuSetting.ScoreMeter, ScoreMeterType.HitErrorBoth); Set(OsuSetting.ScoreMeter, ScoreMeterType.HitErrorBoth);
Set(OsuSetting.FloatingComments, false); Set(OsuSetting.FloatingComments, false);
@ -180,6 +181,7 @@ namespace osu.Game.Configuration
ShowStoryboard, ShowStoryboard,
KeyOverlay, KeyOverlay,
PositionalHitSounds, PositionalHitSounds,
AlwaysPlayComboBreak,
ScoreMeter, ScoreMeter,
FloatingComments, FloatingComments,
ShowInterface, ShowInterface,

View File

@ -67,6 +67,12 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
LabelText = "Positional hitsounds", LabelText = "Positional hitsounds",
Bindable = config.GetBindable<bool>(OsuSetting.PositionalHitSounds) Bindable = config.GetBindable<bool>(OsuSetting.PositionalHitSounds)
}, },
new SettingsCheckbox
{
LabelText = "Always play first combo break sound",
Keywords = new[] { "regardless", "combobreak.wav" },
Bindable = config.GetBindable<bool>(OsuSetting.AlwaysPlayComboBreak)
},
new SettingsEnumDropdown<ScoreMeterType> new SettingsEnumDropdown<ScoreMeterType>
{ {
LabelText = "Score meter type", LabelText = "Score meter type",

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Audio; using osu.Game.Audio;
using osu.Game.Configuration;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -16,27 +17,34 @@ namespace osu.Game.Screens.Play
private SkinnableSound comboBreakSample; private SkinnableSound comboBreakSample;
private Bindable<bool> alwaysPlay;
private bool firstTime = true;
public ComboEffects(ScoreProcessor processor) public ComboEffects(ScoreProcessor processor)
{ {
this.processor = processor; this.processor = processor;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(OsuConfigManager config)
{ {
InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("combobreak")); InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("combobreak"));
alwaysPlay = config.GetBindable<bool>(OsuSetting.AlwaysPlayComboBreak);
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
processor.Combo.BindValueChanged(onComboChange, true); processor.Combo.BindValueChanged(onComboChange);
} }
private void onComboChange(ValueChangedEvent<int> combo) private void onComboChange(ValueChangedEvent<int> combo)
{ {
if (combo.NewValue == 0 && combo.OldValue > 20) if (combo.NewValue == 0 && (combo.OldValue > 20 || alwaysPlay.Value && firstTime))
{
comboBreakSample?.Play(); comboBreakSample?.Play();
firstTime = false;
}
} }
} }
} }