2022-03-01 13:13:27 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2022-03-01 13:13:27 +08:00
|
|
|
using osu.Framework.Allocation;
|
2022-03-01 15:14:57 +08:00
|
|
|
using osu.Framework.Bindables;
|
2022-03-01 13:13:27 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Configuration;
|
2022-01-28 12:53:48 +08:00
|
|
|
using osu.Game.Localisation;
|
2022-03-01 15:14:57 +08:00
|
|
|
using osu.Game.Scoring;
|
2022-03-01 13:13:27 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.PlayerSettings
|
|
|
|
{
|
|
|
|
public partial class AudioSettings : PlayerSettingsGroup
|
|
|
|
{
|
2023-12-28 02:14:17 +08:00
|
|
|
private Bindable<ScoreInfo> referenceScore { get; } = new Bindable<ScoreInfo>();
|
2022-03-01 15:14:57 +08:00
|
|
|
|
2022-03-01 13:13:27 +08:00
|
|
|
private readonly PlayerCheckbox beatmapHitsoundsToggle;
|
|
|
|
|
|
|
|
public AudioSettings()
|
|
|
|
: base("Audio Settings")
|
|
|
|
{
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2022-01-28 12:53:48 +08:00
|
|
|
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapHitsounds },
|
2022-03-01 15:14:57 +08:00
|
|
|
new BeatmapOffsetControl
|
|
|
|
{
|
2023-12-28 02:14:17 +08:00
|
|
|
ReferenceScore = { BindTarget = referenceScore },
|
2022-03-01 15:14:57 +08:00
|
|
|
},
|
2022-03-01 13:13:27 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2023-12-28 02:14:17 +08:00
|
|
|
private void load(OsuConfigManager config, SessionStatics statics)
|
2022-03-01 13:13:27 +08:00
|
|
|
{
|
|
|
|
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
2023-12-28 02:14:17 +08:00
|
|
|
statics.BindWith(Static.LastLocalUserScore, referenceScore);
|
2022-03-01 13:13:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|