1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 03:22:54 +08:00

Move logic to LoadComplete instead

This commit is contained in:
Jamie Taylor 2021-02-11 09:57:14 +09:00
parent 63e6ec1c9f
commit c12c09ec4d

View File

@ -28,8 +28,6 @@ namespace osu.Game.Overlays.OSD
private SampleChannel sampleOff;
private SampleChannel sampleChange;
private bool playedSample;
public TrackedSettingToast(SettingDescription description)
: base(description.Name, description.Value, description.Shortcut)
{
@ -77,11 +75,9 @@ namespace osu.Game.Overlays.OSD
optionLights.Add(new OptionLight { Glowing = i == selectedOption });
}
protected override void Update()
protected override void LoadComplete()
{
base.Update();
if (playedSample) return;
base.LoadComplete();
if (optionCount == 1)
{
@ -97,8 +93,6 @@ namespace osu.Game.Overlays.OSD
sampleChange.Frequency.Value = 1 + (double)selectedOption / (optionCount - 1) * 0.25f;
sampleChange.Play();
}
playedSample = true;
}
[BackgroundDependencyLoader]