1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 14:12:56 +08:00

Add ability to adjust game clock's speed (pgup/pgdn).

A bit hacky, probably need to expose rate better.
This commit is contained in:
Dean Herbert 2016-12-05 19:33:38 +09:00
parent d4670fc64e
commit 4d27101aca

View File

@ -20,6 +20,7 @@ using osu.Game.Graphics.UserInterface.Volume;
using osu.Game.Database;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Timing;
using osu.Game.Modes;
using osu.Game.Overlays.Toolbar;
using osu.Game.Screens;
@ -154,11 +155,19 @@ namespace osu.Game
private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args)
{
if (args.Repeat) return false;
switch (args.Key)
{
case Key.F8:
chat.ToggleVisibility();
return true;
case Key.PageUp:
case Key.PageDown:
var rate = ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate * (args.Key == Key.PageUp ? 1.1f : 0.9f);
((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate = rate;
Logger.Log($@"Adjusting game clock to {rate}", LoggingTarget.Debug);
return true;
}
if (state.Keyboard.ControlPressed)