mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:15:08 +08:00
User setting for always playing first combo break
This commit is contained in:
parent
149efec985
commit
f893d523f5
@ -91,6 +91,7 @@ namespace osu.Game.Configuration
|
||||
Set(OsuSetting.FadePlayfieldWhenHealthLow, true);
|
||||
Set(OsuSetting.KeyOverlay, false);
|
||||
Set(OsuSetting.PositionalHitSounds, true);
|
||||
Set(OsuSetting.AlwaysPlayComboBreak, false);
|
||||
Set(OsuSetting.ScoreMeter, ScoreMeterType.HitErrorBoth);
|
||||
|
||||
Set(OsuSetting.FloatingComments, false);
|
||||
@ -180,6 +181,7 @@ namespace osu.Game.Configuration
|
||||
ShowStoryboard,
|
||||
KeyOverlay,
|
||||
PositionalHitSounds,
|
||||
AlwaysPlayComboBreak,
|
||||
ScoreMeter,
|
||||
FloatingComments,
|
||||
ShowInterface,
|
||||
|
@ -67,6 +67,12 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
||||
LabelText = "Positional hitsounds",
|
||||
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>
|
||||
{
|
||||
LabelText = "Score meter type",
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -16,27 +17,34 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private SkinnableSound comboBreakSample;
|
||||
|
||||
private Bindable<bool> alwaysPlay;
|
||||
private bool firstTime = true;
|
||||
|
||||
public ComboEffects(ScoreProcessor processor)
|
||||
{
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("combobreak"));
|
||||
alwaysPlay = config.GetBindable<bool>(OsuSetting.AlwaysPlayComboBreak);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
processor.Combo.BindValueChanged(onComboChange, true);
|
||||
processor.Combo.BindValueChanged(onComboChange);
|
||||
}
|
||||
|
||||
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();
|
||||
firstTime = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user