From eaa464e548582da39515ded5d9421146eabdcfc6 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sun, 28 Nov 2021 02:58:08 +0100 Subject: [PATCH 01/10] Initial implementation of adjustable positional hitobject audio strength --- osu.Game/Configuration/OsuConfigManager.cs | 2 ++ osu.Game/Localisation/AudioSettingsStrings.cs | 5 ++++ .../Sections/Gameplay/AudioSettings.cs | 28 ++++++++++++++++++- .../Objects/Drawables/DrawableHitObject.cs | 4 ++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 84da3f666d..a124c1c5ae 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -97,6 +97,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.MenuParallax, true); // Gameplay + SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.8f, 0.1f, 1f); SetDefault(OsuSetting.DimLevel, 0.8, 0, 1, 0.01); SetDefault(OsuSetting.BlurLevel, 0, 0, 1, 0.01); SetDefault(OsuSetting.LightenDuringBreaks, true); @@ -251,6 +252,7 @@ namespace osu.Game.Configuration BlurLevel, LightenDuringBreaks, ShowStoryboard, + PositionalHitsoundsLevel, KeyOverlay, PositionalHitSounds, AlwaysPlayFirstComboBreak, diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index 008781c2e5..a55816b401 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -32,6 +32,11 @@ namespace osu.Game.Localisation /// /// "Master" /// + public static LocalisableString PositionalLevel => new TranslatableString(getKey(@"positional_hitsound_audio_level"), @"Positional hitsound audio level."); + + /// + /// "Level" + /// public static LocalisableString MasterVolume => new TranslatableString(getKey(@"master_volume"), @"Master"); /// diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs index dba64d695a..c239fd282a 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs @@ -2,10 +2,13 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Localisation; +using osu.Framework.Graphics.Containers; + namespace osu.Game.Overlays.Settings.Sections.Gameplay { @@ -13,9 +16,15 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { protected override LocalisableString Header => GameplaySettingsStrings.AudioHeader; + private Bindable positionalHitsoundsLevel; + + private FillFlowContainer> positionalHitsoundsSettings; + + [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(OsuConfigManager config,OsuConfigManager osuConfig) { + positionalHitsoundsLevel = osuConfig.GetBindable(OsuSetting.PositionalHitsoundsLevel); Children = new Drawable[] { new SettingsCheckbox @@ -23,6 +32,23 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay LabelText = GameplaySettingsStrings.PositionalHitsounds, Current = config.GetBindable(OsuSetting.PositionalHitSounds) }, + positionalHitsoundsSettings = new FillFlowContainer> + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Masking = true, + Children = new[] + { + new SettingsSlider + { + LabelText = AudioSettingsStrings.PositionalLevel, + Current = positionalHitsoundsLevel, + KeyboardStep = 0.01f, + DisplayAsPercentage = true, + }, + } + }, new SettingsCheckbox { LabelText = GameplaySettingsStrings.AlwaysPlayFirstComboBreak, diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 01817147ae..1a0fe8d004 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -22,6 +22,7 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Skinning; using osuTK.Graphics; +using osu.Game.Overlays.Settings.Sections.Gameplay; namespace osu.Game.Rulesets.Objects.Drawables { @@ -124,6 +125,7 @@ namespace osu.Game.Rulesets.Objects.Drawables public readonly Bindable StartTimeBindable = new Bindable(); private readonly BindableList samplesBindable = new BindableList(); private readonly Bindable userPositionalHitSounds = new Bindable(); + private readonly Bindable positionalHitsoundsLevel = new Bindable(); private readonly Bindable comboIndexBindable = new Bindable(); private readonly Bindable comboIndexWithOffsetsBindable = new Bindable(); @@ -532,7 +534,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// The lookup X position. Generally should be . protected double CalculateSamplePlaybackBalance(double position) { - const float balance_adjust_amount = 0.4f; + float balance_adjust_amount = positionalHitsoundsLevel.Value; return balance_adjust_amount * (userPositionalHitSounds.Value ? position - 0.5f : 0); } From e83115ad5e617843937eb751a74bc60538fa0796 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sun, 28 Nov 2021 03:25:11 +0100 Subject: [PATCH 02/10] Binding logic fix, nullification of unnecessary path --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index a124c1c5ae..ed0fe17e27 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -97,7 +97,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.MenuParallax, true); // Gameplay - SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.8f, 0.1f, 1f); + SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.8f, 0, 1); SetDefault(OsuSetting.DimLevel, 0.8, 0, 1, 0.01); SetDefault(OsuSetting.BlurLevel, 0, 0, 1, 0.01); SetDefault(OsuSetting.LightenDuringBreaks, true); diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 1a0fe8d004..601756485b 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -171,6 +171,7 @@ namespace osu.Game.Rulesets.Objects.Drawables private void load(OsuConfigManager config, ISkinSource skinSource) { config.BindWith(OsuSetting.PositionalHitSounds, userPositionalHitSounds); + config.BindWith(OsuSetting.PositionalHitsoundsLevel, positionalHitsoundsLevel); // Explicit non-virtual function call. base.AddInternal(Samples = new PausableSkinnableSound()); @@ -534,9 +535,9 @@ namespace osu.Game.Rulesets.Objects.Drawables /// The lookup X position. Generally should be . protected double CalculateSamplePlaybackBalance(double position) { - float balance_adjust_amount = positionalHitsoundsLevel.Value; + float balance_adjust_amount = positionalHitsoundsLevel.Value*2; - return balance_adjust_amount * (userPositionalHitSounds.Value ? position - 0.5f : 0); + return balance_adjust_amount * (true ? position - 0.5f : 0); } /// From ff9c68dd6aafcb0103e33f8f735674a6b1cb2b11 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sun, 28 Nov 2021 03:28:35 +0100 Subject: [PATCH 03/10] cleanup --- osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs index c239fd282a..9e677943c2 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs @@ -9,7 +9,6 @@ using osu.Game.Configuration; using osu.Game.Localisation; using osu.Framework.Graphics.Containers; - namespace osu.Game.Overlays.Settings.Sections.Gameplay { public class AudioSettings : SettingsSubsection @@ -20,7 +19,6 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay private FillFlowContainer> positionalHitsoundsSettings; - [BackgroundDependencyLoader] private void load(OsuConfigManager config,OsuConfigManager osuConfig) { From c3fb7937627301cb92359ff2939cd9e3197cae31 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sun, 28 Nov 2021 14:06:53 +0100 Subject: [PATCH 04/10] Fixed the problems that were brought up and deleted the old bind logic --- osu.Game/Configuration/OsuConfigManager.cs | 4 +--- osu.Game/Localisation/AudioSettingsStrings.cs | 2 +- osu.Game/Localisation/GameplaySettingsStrings.cs | 5 ----- .../Settings/Sections/Gameplay/AudioSettings.cs | 7 +------ .../Rulesets/Objects/Drawables/DrawableHitObject.cs | 11 +++++------ 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ed0fe17e27..90cf09dce1 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -97,7 +97,7 @@ namespace osu.Game.Configuration 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 @@ namespace osu.Game.Configuration 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 @@ namespace osu.Game.Configuration ShowStoryboard, PositionalHitsoundsLevel, KeyOverlay, - PositionalHitSounds, AlwaysPlayFirstComboBreak, FloatingComments, HUDVisibilityMode, diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index a55816b401..ba48c412c4 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -32,7 +32,7 @@ namespace osu.Game.Localisation /// /// "Master" /// - 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"); /// /// "Level" diff --git a/osu.Game/Localisation/GameplaySettingsStrings.cs b/osu.Game/Localisation/GameplaySettingsStrings.cs index fa92187650..84c3704e26 100644 --- a/osu.Game/Localisation/GameplaySettingsStrings.cs +++ b/osu.Game/Localisation/GameplaySettingsStrings.cs @@ -84,11 +84,6 @@ namespace osu.Game.Localisation /// public static LocalisableString AlwaysShowKeyOverlay => new TranslatableString(getKey(@"key_overlay"), @"Always show key overlay"); - /// - /// "Positional hitsounds" - /// - public static LocalisableString PositionalHitsounds => new TranslatableString(getKey(@"positional_hitsounds"), @"Positional hitsounds"); - /// /// "Always play first combo break sound" /// diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs index 9e677943c2..a5c5399e98 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs @@ -24,12 +24,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { positionalHitsoundsLevel = osuConfig.GetBindable(OsuSetting.PositionalHitsoundsLevel); Children = new Drawable[] - { - new SettingsCheckbox - { - LabelText = GameplaySettingsStrings.PositionalHitsounds, - Current = config.GetBindable(OsuSetting.PositionalHitSounds) - }, + { positionalHitsoundsSettings = new FillFlowContainer> { Direction = FillDirection.Vertical, diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 601756485b..ea153bd0e6 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -124,10 +124,8 @@ namespace osu.Game.Rulesets.Objects.Drawables public readonly Bindable StartTimeBindable = new Bindable(); private readonly BindableList samplesBindable = new BindableList(); - private readonly Bindable userPositionalHitSounds = new Bindable(); - private readonly Bindable positionalHitsoundsLevel = new Bindable(); - private readonly Bindable comboIndexBindable = new Bindable(); + private readonly Bindable positionalHitsoundsLevel = new Bindable(); private readonly Bindable comboIndexBindable = new Bindable(); private readonly Bindable comboIndexWithOffsetsBindable = new Bindable(); protected override bool RequiresChildrenUpdate => true; @@ -170,7 +168,6 @@ namespace osu.Game.Rulesets.Objects.Drawables [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 @@ namespace osu.Game.Rulesets.Objects.Drawables /// The lookup X position. Generally should be . 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; } /// From 9065179c523eb1f1cfdfa02559da4f9bdfddde60 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sun, 28 Nov 2021 14:09:30 +0100 Subject: [PATCH 05/10] Fix --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index ea153bd0e6..152f92985e 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -124,6 +124,7 @@ namespace osu.Game.Rulesets.Objects.Drawables public readonly Bindable StartTimeBindable = new Bindable(); private readonly BindableList samplesBindable = new BindableList(); + private readonly Bindable comboIndexBindable = new Bindable(); private readonly Bindable positionalHitsoundsLevel = new Bindable(); private readonly Bindable comboIndexBindable = new Bindable(); private readonly Bindable comboIndexWithOffsetsBindable = new Bindable(); From 9c42cc0c05e643c807fb8fc05afba98a95e0cd3c Mon Sep 17 00:00:00 2001 From: mk-56 Date: Sun, 28 Nov 2021 14:09:30 +0100 Subject: [PATCH 06/10] Fix --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index ea153bd0e6..01c573eb94 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -125,7 +125,8 @@ namespace osu.Game.Rulesets.Objects.Drawables public readonly Bindable StartTimeBindable = new Bindable(); private readonly BindableList samplesBindable = new BindableList(); - private readonly Bindable positionalHitsoundsLevel = new Bindable(); private readonly Bindable comboIndexBindable = new Bindable(); + private readonly Bindable positionalHitsoundsLevel = new Bindable(); + private readonly Bindable comboIndexBindable = new Bindable(); private readonly Bindable comboIndexWithOffsetsBindable = new Bindable(); protected override bool RequiresChildrenUpdate => true; From fd5af1fbe7e0f776d7b5ff5bd5ac7b4e3479fd70 Mon Sep 17 00:00:00 2001 From: mk-56 Date: Fri, 17 Dec 2021 13:16:06 +0100 Subject: [PATCH 07/10] Code refactor and name changes cleaned code up with Jetbrains i hope it suffices --- osu.Game/Localisation/AudioSettingsStrings.cs | 2 +- .../Settings/Sections/Gameplay/AudioSettings.cs | 10 +++++----- .../Rulesets/Objects/Drawables/DrawableHitObject.cs | 11 ++++------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/osu.Game/Localisation/AudioSettingsStrings.cs b/osu.Game/Localisation/AudioSettingsStrings.cs index ba48c412c4..f298717c99 100644 --- a/osu.Game/Localisation/AudioSettingsStrings.cs +++ b/osu.Game/Localisation/AudioSettingsStrings.cs @@ -32,7 +32,7 @@ namespace osu.Game.Localisation /// /// "Master" /// - 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"), @"Hitsound stereo separation"); /// /// "Level" diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs index a5c5399e98..4238ad1605 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs @@ -20,11 +20,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay private FillFlowContainer> positionalHitsoundsSettings; [BackgroundDependencyLoader] - private void load(OsuConfigManager config,OsuConfigManager osuConfig) + private void load(OsuConfigManager config, OsuConfigManager osuConfig) { positionalHitsoundsLevel = osuConfig.GetBindable(OsuSetting.PositionalHitsoundsLevel); Children = new Drawable[] - { + { positionalHitsoundsSettings = new FillFlowContainer> { Direction = FillDirection.Vertical, @@ -38,15 +38,15 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay LabelText = AudioSettingsStrings.PositionalLevel, Current = positionalHitsoundsLevel, KeyboardStep = 0.01f, - DisplayAsPercentage = true, - }, + DisplayAsPercentage = true + } } }, new SettingsCheckbox { LabelText = GameplaySettingsStrings.AlwaysPlayFirstComboBreak, Current = config.GetBindable(OsuSetting.AlwaysPlayFirstComboBreak) - }, + } }; } } diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 56e02e3ddd..4ab513bf19 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -22,7 +22,6 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Skinning; using osuTK.Graphics; -using osu.Game.Overlays.Settings.Sections.Gameplay; namespace osu.Game.Rulesets.Objects.Drawables { @@ -126,8 +125,7 @@ namespace osu.Game.Rulesets.Objects.Drawables private readonly BindableList samplesBindable = new BindableList(); private readonly Bindable comboIndexBindable = new Bindable(); - private readonly Bindable positionalHitsoundsLevel = new Bindable(); - private readonly Bindable comboIndexBindable = new Bindable(); + private readonly Bindable positionalHitsoundsLevel = new Bindable(); private readonly Bindable comboIndexWithOffsetsBindable = new Bindable(); protected override bool RequiresChildrenUpdate => true; @@ -534,10 +532,9 @@ namespace osu.Game.Rulesets.Objects.Drawables /// The lookup X position. Generally should be . protected double CalculateSamplePlaybackBalance(double position) { - double returnedvalue; - float balance_adjust_amount = positionalHitsoundsLevel.Value*2; - returnedvalue = balance_adjust_amount *(position - 0.5f ); - + float balanceAdjustAmount = positionalHitsoundsLevel.Value * 2; + double returnedvalue = balanceAdjustAmount * (position - 0.5f); + return returnedvalue; } From 5dd024aab7d8add3a143725b1a21beab946da70e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jan 2022 12:46:02 +0900 Subject: [PATCH 08/10] Remove outdated settings migration --- osu.Game/Configuration/OsuConfigManager.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 616e749c9b..6efbaa4d36 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -174,11 +174,6 @@ namespace osu.Game.Configuration if (!int.TryParse(pieces[1], out int monthDay)) return; int combined = (year * 10000) + monthDay; - - if (combined < 20210413) - { - SetValue(OsuSetting.EditorWaveformOpacity, 0.25f); - } } public override TrackedSettings CreateTrackedSettings() From 623d6d6d2d0635b55da3d99d499b0ef5a085b618 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jan 2022 12:46:20 +0900 Subject: [PATCH 09/10] Add migration of positional hitsounds setting to new level based setting --- osu.Game/Configuration/OsuConfigManager.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 6efbaa4d36..07d2026c65 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -98,6 +98,7 @@ namespace osu.Game.Configuration SetDefault(OsuSetting.MenuParallax, true); // Gameplay + SetDefault(OsuSetting.PositionalHitsounds, true); // replaced by level setting below, can be removed 20220703. SetDefault(OsuSetting.PositionalHitsoundsLevel, 0.2f, 0, 1); SetDefault(OsuSetting.DimLevel, 0.8, 0, 1, 0.01); SetDefault(OsuSetting.BlurLevel, 0, 0, 1, 0.01); @@ -174,6 +175,13 @@ namespace osu.Game.Configuration if (!int.TryParse(pieces[1], out int monthDay)) return; int combined = (year * 10000) + monthDay; + + if (combined < 20220103) + { + var positionalHitsoundsEnabled = GetBindable(OsuSetting.PositionalHitsounds); + if (!positionalHitsoundsEnabled.Value) + SetValue(OsuSetting.PositionalHitsoundsLevel, 0); + } } public override TrackedSettings CreateTrackedSettings() @@ -250,8 +258,9 @@ namespace osu.Game.Configuration BlurLevel, LightenDuringBreaks, ShowStoryboard, - PositionalHitsoundsLevel, KeyOverlay, + PositionalHitsounds, + PositionalHitsoundsLevel, AlwaysPlayFirstComboBreak, FloatingComments, HUDVisibilityMode, From 6356180b6abd5a11ab32508ad3dcd2984c561aee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jan 2022 12:53:58 +0900 Subject: [PATCH 10/10] Remove unnecessary code and fix double nesting causing filtering to not work --- .../Sections/Gameplay/AudioSettings.cs | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs index 4238ad1605..5029c6a617 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/AudioSettings.cs @@ -2,12 +2,10 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Localisation; -using osu.Framework.Graphics.Containers; namespace osu.Game.Overlays.Settings.Sections.Gameplay { @@ -15,32 +13,18 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { protected override LocalisableString Header => GameplaySettingsStrings.AudioHeader; - private Bindable positionalHitsoundsLevel; - - private FillFlowContainer> positionalHitsoundsSettings; - [BackgroundDependencyLoader] private void load(OsuConfigManager config, OsuConfigManager osuConfig) { - positionalHitsoundsLevel = osuConfig.GetBindable(OsuSetting.PositionalHitsoundsLevel); Children = new Drawable[] { - positionalHitsoundsSettings = new FillFlowContainer> + new SettingsSlider { - Direction = FillDirection.Vertical, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Masking = true, - Children = new[] - { - new SettingsSlider - { - LabelText = AudioSettingsStrings.PositionalLevel, - Current = positionalHitsoundsLevel, - KeyboardStep = 0.01f, - DisplayAsPercentage = true - } - } + LabelText = AudioSettingsStrings.PositionalLevel, + Keywords = new[] { @"positional", @"balance" }, + Current = osuConfig.GetBindable(OsuSetting.PositionalHitsoundsLevel), + KeyboardStep = 0.01f, + DisplayAsPercentage = true }, new SettingsCheckbox {