mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 09:20:02 +09:00
Revert "Merge pull request #3415 from UselessToucan/return_to_large_logo_after_idle"
This reverts commit3e2e2a7000
, reversing changes made tod94801b6c6
.
This commit is contained in:
@ -1,41 +0,0 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
|
||||
namespace osu.Game.Input
|
||||
{
|
||||
public class IdleTracker : Component, IKeyBindingHandler<PlatformAction>
|
||||
{
|
||||
private double lastInteractionTime;
|
||||
public double IdleTime => Clock.CurrentTime - lastInteractionTime;
|
||||
|
||||
private bool updateLastInteractionTime()
|
||||
{
|
||||
lastInteractionTime = Clock.CurrentTime;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnPressed(PlatformAction action) => updateLastInteractionTime();
|
||||
|
||||
public bool OnReleased(PlatformAction action) => updateLastInteractionTime();
|
||||
|
||||
protected override bool Handle(UIEvent e)
|
||||
{
|
||||
switch (e)
|
||||
{
|
||||
case KeyDownEvent _:
|
||||
case KeyUpEvent _:
|
||||
case MouseDownEvent _:
|
||||
case MouseUpEvent _:
|
||||
case MouseMoveEvent _:
|
||||
return updateLastInteractionTime();
|
||||
default:
|
||||
return base.Handle(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user