1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 18:07:25 +08:00

Code refactor and name changes

cleaned code up with Jetbrains i hope it suffices
This commit is contained in:
mk-56 2021-12-17 13:16:06 +01:00
parent d2e11ea622
commit fd5af1fbe7
3 changed files with 10 additions and 13 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Localisation
/// <summary> /// <summary>
/// "Master" /// "Master"
/// </summary> /// </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"), @"Hitsound stereo separation");
/// <summary> /// <summary>
/// "Level" /// "Level"

View File

@ -20,11 +20,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
private FillFlowContainer<SettingsSlider<float>> positionalHitsoundsSettings; private FillFlowContainer<SettingsSlider<float>> positionalHitsoundsSettings;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config,OsuConfigManager osuConfig) private void load(OsuConfigManager config, OsuConfigManager osuConfig)
{ {
positionalHitsoundsLevel = osuConfig.GetBindable<float>(OsuSetting.PositionalHitsoundsLevel); positionalHitsoundsLevel = osuConfig.GetBindable<float>(OsuSetting.PositionalHitsoundsLevel);
Children = new Drawable[] Children = new Drawable[]
{ {
positionalHitsoundsSettings = new FillFlowContainer<SettingsSlider<float>> positionalHitsoundsSettings = new FillFlowContainer<SettingsSlider<float>>
{ {
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
@ -38,15 +38,15 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
LabelText = AudioSettingsStrings.PositionalLevel, LabelText = AudioSettingsStrings.PositionalLevel,
Current = positionalHitsoundsLevel, Current = positionalHitsoundsLevel,
KeyboardStep = 0.01f, KeyboardStep = 0.01f,
DisplayAsPercentage = true, DisplayAsPercentage = true
}, }
} }
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = GameplaySettingsStrings.AlwaysPlayFirstComboBreak, LabelText = GameplaySettingsStrings.AlwaysPlayFirstComboBreak,
Current = config.GetBindable<bool>(OsuSetting.AlwaysPlayFirstComboBreak) Current = config.GetBindable<bool>(OsuSetting.AlwaysPlayFirstComboBreak)
}, }
}; };
} }
} }

View File

@ -22,7 +22,6 @@ using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Game.Overlays.Settings.Sections.Gameplay;
namespace osu.Game.Rulesets.Objects.Drawables namespace osu.Game.Rulesets.Objects.Drawables
{ {
@ -126,8 +125,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
private readonly BindableList<HitSampleInfo> samplesBindable = new BindableList<HitSampleInfo>(); private readonly BindableList<HitSampleInfo> samplesBindable = new BindableList<HitSampleInfo>();
private readonly Bindable<int> comboIndexBindable = new Bindable<int>(); private readonly Bindable<int> comboIndexBindable = new Bindable<int>();
private readonly Bindable<float> positionalHitsoundsLevel = new Bindable<float>(); private readonly Bindable<float> positionalHitsoundsLevel = new Bindable<float>();
private readonly Bindable<int> comboIndexBindable = new Bindable<int>();
private readonly Bindable<int> comboIndexWithOffsetsBindable = new Bindable<int>(); private readonly Bindable<int> comboIndexWithOffsetsBindable = new Bindable<int>();
protected override bool RequiresChildrenUpdate => true; protected override bool RequiresChildrenUpdate => true;
@ -534,10 +532,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// <param name="position">The lookup X position. Generally should be <see cref="SamplePlaybackPosition"/>.</param> /// <param name="position">The lookup X position. Generally should be <see cref="SamplePlaybackPosition"/>.</param>
protected double CalculateSamplePlaybackBalance(double position) protected double CalculateSamplePlaybackBalance(double position)
{ {
double returnedvalue; float balanceAdjustAmount = positionalHitsoundsLevel.Value * 2;
float balance_adjust_amount = positionalHitsoundsLevel.Value*2; double returnedvalue = balanceAdjustAmount * (position - 0.5f);
returnedvalue = balance_adjust_amount *(position - 0.5f );
return returnedvalue; return returnedvalue;
} }