mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00:00
Use a safer method of setting the clock
This commit is contained in:
parent
d5943330b1
commit
558dbafb71
@ -108,13 +108,7 @@ namespace osu.Game.Rulesets.UI
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
// in case a parent gameplay clock isn't available, just use the parent clock.
|
||||
if (parentGameplayClock == null)
|
||||
parentGameplayClock = Clock;
|
||||
|
||||
Clock = gameplayClock;
|
||||
ProcessCustomClock = false;
|
||||
setClock();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -161,7 +155,7 @@ namespace osu.Game.Rulesets.UI
|
||||
private void updateClock()
|
||||
{
|
||||
if (parentGameplayClock == null)
|
||||
return;
|
||||
setClock(); // LoadComplete may not be run yet, but we still want the clock.
|
||||
|
||||
validState = true;
|
||||
|
||||
@ -210,6 +204,16 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
}
|
||||
|
||||
private void setClock()
|
||||
{
|
||||
// in case a parent gameplay clock isn't available, just use the parent clock.
|
||||
if (parentGameplayClock == null)
|
||||
parentGameplayClock = Clock;
|
||||
|
||||
Clock = gameplayClock;
|
||||
ProcessCustomClock = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Setting application (disables etc.)
|
||||
|
Loading…
Reference in New Issue
Block a user