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:
parent
63e6ec1c9f
commit
c12c09ec4d
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user