mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:42:55 +08:00
Rename sourceClock
This commit is contained in:
parent
fee258f2f2
commit
3d52ead213
@ -54,8 +54,13 @@ namespace osu.Game.Screens.Play
|
|||||||
public CursorContainer Cursor => RulesetContainer.Cursor;
|
public CursorContainer Cursor => RulesetContainer.Cursor;
|
||||||
public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded.Value;
|
public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded.Value;
|
||||||
|
|
||||||
private IAdjustableClock adjustableSourceClock;
|
private IAdjustableClock sourceClock;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The final usable gameplay clock with user-set offsets applied.
|
||||||
|
/// </summary>
|
||||||
private FramedOffsetClock offsetClock;
|
private FramedOffsetClock offsetClock;
|
||||||
|
|
||||||
private DecoupleableInterpolatingFramedClock decoupledClock;
|
private DecoupleableInterpolatingFramedClock decoupledClock;
|
||||||
|
|
||||||
private PauseContainer pauseContainer;
|
private PauseContainer pauseContainer;
|
||||||
@ -138,7 +143,7 @@ namespace osu.Game.Screens.Play
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
adjustableSourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock();
|
sourceClock = (IAdjustableClock)working.Track ?? new StopwatchClock();
|
||||||
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
||||||
|
|
||||||
var firstObjectTime = RulesetContainer.Objects.First().StartTime;
|
var firstObjectTime = RulesetContainer.Objects.First().StartTime;
|
||||||
@ -236,11 +241,11 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void applyRateFromMods()
|
private void applyRateFromMods()
|
||||||
{
|
{
|
||||||
if (adjustableSourceClock == null) return;
|
if (sourceClock == null) return;
|
||||||
|
|
||||||
adjustableSourceClock.Rate = 1;
|
sourceClock.Rate = 1;
|
||||||
foreach (var mod in Beatmap.Value.Mods.Value.OfType<IApplicableToClock>())
|
foreach (var mod in Beatmap.Value.Mods.Value.OfType<IApplicableToClock>())
|
||||||
mod.ApplyToClock(adjustableSourceClock);
|
mod.ApplyToClock(sourceClock);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeStoryboard(bool asyncLoad)
|
private void initializeStoryboard(bool asyncLoad)
|
||||||
@ -328,11 +333,11 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
adjustableSourceClock.Reset();
|
sourceClock.Reset();
|
||||||
|
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
decoupledClock.ChangeSource(adjustableSourceClock);
|
decoupledClock.ChangeSource(sourceClock);
|
||||||
applyRateFromMods();
|
applyRateFromMods();
|
||||||
|
|
||||||
this.Delay(750).Schedule(() =>
|
this.Delay(750).Schedule(() =>
|
||||||
|
Loading…
Reference in New Issue
Block a user