diff --git a/osu.Game/Input/IdleTracker.cs b/osu.Game/Input/IdleTracker.cs deleted file mode 100644 index bbc15fe7af..0000000000 --- a/osu.Game/Input/IdleTracker.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// 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 - { - 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); - } - } - } -} diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index bb163e9870..76a9102c5e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -26,7 +26,6 @@ using osu.Framework.Platform; using osu.Framework.Threading; using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Input; using osu.Game.Rulesets.Scoring; using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; @@ -87,8 +86,6 @@ namespace osu.Game public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight; - private IdleTracker idleTracker; - public readonly Bindable OverlayActivationMode = new Bindable(); private OsuScreen screenStack; @@ -314,7 +311,6 @@ namespace osu.Game }, mainContent = new Container { RelativeSizeAxes = Axes.Both }, overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, - idleTracker = new IdleTracker { RelativeSizeAxes = Axes.Both } }); loadComponentSingleFile(screenStack = new Loader(), d => @@ -376,7 +372,6 @@ namespace osu.Game Depth = -6, }, overlayContent.Add); - dependencies.Cache(idleTracker); dependencies.Cache(settings); dependencies.Cache(onscreenDisplay); dependencies.Cache(social); diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index bb29a23637..5c17317fc1 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -14,7 +14,6 @@ using osu.Framework.Input.Bindings; using osu.Framework.Logging; using osu.Framework.Threading; using osu.Game.Graphics; -using osu.Game.Input; using osu.Game.Input.Bindings; using osu.Game.Overlays; using OpenTK; @@ -65,8 +64,6 @@ namespace osu.Game.Screens.Menu private SampleChannel sampleBack; - private IdleTracker idleTracker; - public ButtonSystem() { RelativeSizeAxes = Axes.Both; @@ -105,10 +102,9 @@ namespace osu.Game.Screens.Menu private OsuGame game; [BackgroundDependencyLoader(true)] - private void load(AudioManager audio, OsuGame game, IdleTracker idleTracker) + private void load(AudioManager audio, OsuGame game) { this.game = game; - this.idleTracker = idleTracker; sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -270,8 +266,8 @@ namespace osu.Game.Screens.Menu protected override void Update() { - if (idleTracker?.IdleTime > 6000 && State != ButtonSystemState.Exit) - State = ButtonSystemState.Initial; + //if (OsuGame.IdleTime > 6000 && State != MenuState.Exit) + // State = MenuState.Initial; base.Update();