Fixed the problems that were brought up and deleted the old bind logic

This commit is contained in:
mk-56 2021-11-28 14:06:53 +01:00
parent 9acff1be0a
commit c3fb793762
5 changed files with 8 additions and 21 deletions

View File

@ -97,7 +97,7 @@ protected override void InitialiseDefaults()
SetDefault(OsuSetting.MenuParallax, true);
// Gameplay
SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.8f, 0, 1);
SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.2f, 0, 1);
SetDefault(OsuSetting.DimLevel, 0.8, 0, 1, 0.01);
SetDefault(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
SetDefault(OsuSetting.LightenDuringBreaks, true);
@ -109,7 +109,6 @@ protected override void InitialiseDefaults()
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
SetDefault(OsuSetting.FadePlayfieldWhenHealthLow, true);
SetDefault(OsuSetting.KeyOverlay, false);
SetDefault(OsuSetting.PositionalHitSounds, true);
SetDefault(OsuSetting.AlwaysPlayFirstComboBreak, true);
SetDefault(OsuSetting.FloatingComments, false);
@ -254,7 +253,6 @@ public enum OsuSetting
ShowStoryboard,
PositionalHitsoundsLevel,
KeyOverlay,
PositionalHitSounds,
AlwaysPlayFirstComboBreak,
FloatingComments,
HUDVisibilityMode,

View File

@ -32,7 +32,7 @@ public static class AudioSettingsStrings
/// <summary>
/// "Master"
/// </summary>
public static LocalisableString PositionalLevel => new TranslatableString(getKey(@"positional_hitsound_audio_level"), @"Positional hitsound audio level.");
public static LocalisableString PositionalLevel => new TranslatableString(getKey(@"positional_hitsound_audio_level"), @"Positional hitsound audio level");
/// <summary>
/// "Level"

View File

@ -84,11 +84,6 @@ public static class GameplaySettingsStrings
/// </summary>
public static LocalisableString AlwaysShowKeyOverlay => new TranslatableString(getKey(@"key_overlay"), @"Always show key overlay");
/// <summary>
/// "Positional hitsounds"
/// </summary>
public static LocalisableString PositionalHitsounds => new TranslatableString(getKey(@"positional_hitsounds"), @"Positional hitsounds");
/// <summary>
/// "Always play first combo break sound"
/// </summary>

View File

@ -24,12 +24,7 @@ private void load(OsuConfigManager config,OsuConfigManager osuConfig)
{
positionalHitsoundsLevel = osuConfig.GetBindable<float>(OsuSetting.PositionalHitsoundsLevel);
Children = new Drawable[]
{
new SettingsCheckbox
{
LabelText = GameplaySettingsStrings.PositionalHitsounds,
Current = config.GetBindable<bool>(OsuSetting.PositionalHitSounds)
},
{
positionalHitsoundsSettings = new FillFlowContainer<SettingsSlider<float>>
{
Direction = FillDirection.Vertical,

View File

@ -124,10 +124,8 @@ public abstract class DrawableHitObject : PoolableDrawableWithLifetime<HitObject
public readonly Bindable<double> StartTimeBindable = new Bindable<double>();
private readonly BindableList<HitSampleInfo> samplesBindable = new BindableList<HitSampleInfo>();
private readonly Bindable<bool> userPositionalHitSounds = new Bindable<bool>();
private readonly Bindable<float> positionalHitsoundsLevel = new Bindable<float>();
private readonly Bindable<int> comboIndexBindable = new Bindable<int>();
private readonly Bindable<float> positionalHitsoundsLevel = new Bindable<float>(); private readonly Bindable<int> comboIndexBindable = new Bindable<int>();
private readonly Bindable<int> comboIndexWithOffsetsBindable = new Bindable<int>();
protected override bool RequiresChildrenUpdate => true;
@ -170,7 +168,6 @@ protected DrawableHitObject([CanBeNull] HitObject initialHitObject = null)
[BackgroundDependencyLoader]
private void load(OsuConfigManager config, ISkinSource skinSource)
{
config.BindWith(OsuSetting.PositionalHitSounds, userPositionalHitSounds);
config.BindWith(OsuSetting.PositionalHitsoundsLevel, positionalHitsoundsLevel);
// Explicit non-virtual function call.
@ -535,9 +532,11 @@ protected virtual void ApplySkin(ISkinSource skin, bool allowFallback)
/// <param name="position">The lookup X position. Generally should be <see cref="SamplePlaybackPosition"/>.</param>
protected double CalculateSamplePlaybackBalance(double position)
{
double returnedvalue;
float balance_adjust_amount = positionalHitsoundsLevel.Value*2;
return balance_adjust_amount * (true ? position - 0.5f : 0);
returnedvalue = balance_adjust_amount *(position - 0.5f );
return returnedvalue;
}
/// <summary>