1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Change AudioClock type to IFrameBasedClock and comment its usage

This commit is contained in:
Roman Kapustin 2018-09-07 21:39:41 +03:00
parent dae54d252d
commit 125b569ccb
2 changed files with 6 additions and 5 deletions

View File

@ -69,7 +69,7 @@ namespace osu.Game.Screens.Play
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
KeyCounter = CreateKeyCounter(adjustableClock), KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock),
HoldToQuit = CreateQuitButton(), HoldToQuit = CreateQuitButton(),
} }
} }
@ -194,7 +194,7 @@ namespace osu.Game.Screens.Play
Margin = new MarginPadding { Top = 20 } Margin = new MarginPadding { Top = 20 }
}; };
protected virtual KeyCounterCollection CreateKeyCounter(IClock offsetClock) => new KeyCounterCollection protected virtual KeyCounterCollection CreateKeyCounter(IFrameBasedClock offsetClock) => new KeyCounterCollection
{ {
FadeTime = 50, FadeTime = 50,
Anchor = Anchor.BottomRight, Anchor = Anchor.BottomRight,

View File

@ -38,8 +38,9 @@ namespace osu.Game.Screens.Play
key.FadeTime = FadeTime; key.FadeTime = FadeTime;
key.KeyDownTextColor = KeyDownTextColor; key.KeyDownTextColor = KeyDownTextColor;
key.KeyUpTextColor = KeyUpTextColor; key.KeyUpTextColor = KeyUpTextColor;
if (AudioClock != null && AudioClock is IFrameBasedClock basedClock) // Use the same clock object as SongProgress for saving KeyCounter state
key.Clock = basedClock; if (AudioClock != null)
key.Clock = AudioClock;
} }
public void ResetCount() public void ResetCount()
@ -121,7 +122,7 @@ namespace osu.Game.Screens.Play
public override bool HandleKeyboardInput => receptor == null; public override bool HandleKeyboardInput => receptor == null;
public override bool HandleMouseInput => receptor == null; public override bool HandleMouseInput => receptor == null;
public IClock AudioClock { get; set; } public IFrameBasedClock AudioClock { get; set; }
private Receptor receptor; private Receptor receptor;