2022-03-01 14:13:27 +09: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 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2022-03-01 14:13:27 +09:00
|
|
|
using osu.Framework.Allocation;
|
2022-03-01 16:14:57 +09:00
|
|
|
using osu.Framework.Bindables;
|
2022-03-01 14:13:27 +09:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Configuration;
|
2022-01-27 20:53:48 -08:00
|
|
|
using osu.Game.Localisation;
|
2022-03-01 16:14:57 +09:00
|
|
|
using osu.Game.Scoring;
|
2022-03-01 14:13:27 +09:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.PlayerSettings
|
|
|
|
{
|
|
|
|
public partial class AudioSettings : PlayerSettingsGroup
|
|
|
|
{
|
2023-12-27 19:14:17 +01:00
|
|
|
private Bindable<ScoreInfo> referenceScore { get; } = new Bindable<ScoreInfo>();
|
2022-03-01 16:14:57 +09:00
|
|
|
|
2022-03-01 14:13:27 +09:00
|
|
|
private readonly PlayerCheckbox beatmapHitsoundsToggle;
|
|
|
|
|
|
|
|
public AudioSettings()
|
|
|
|
: base("Audio Settings")
|
|
|
|
{
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2022-01-27 20:53:48 -08:00
|
|
|
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = SkinSettingsStrings.BeatmapHitsounds },
|
2022-03-01 16:14:57 +09:00
|
|
|
new BeatmapOffsetControl
|
|
|
|
{
|
2023-12-27 19:14:17 +01:00
|
|
|
ReferenceScore = { BindTarget = referenceScore },
|
2022-03-01 16:14:57 +09:00
|
|
|
},
|
2022-03-01 14:13:27 +09:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2023-12-27 19:14:17 +01:00
|
|
|
private void load(OsuConfigManager config, SessionStatics statics)
|
2022-03-01 14:13:27 +09:00
|
|
|
{
|
|
|
|
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
2023-12-27 19:14:17 +01:00
|
|
|
statics.BindWith(Static.LastLocalUserScore, referenceScore);
|
2022-03-01 14:13:27 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|