From 68980fc477f65636ccdc268750959f6581e2fb57 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Tue, 2 Oct 2018 14:41:18 +0900 Subject: [PATCH] Adjust usage of Handle(Non)PositionalInput to follow framework update --- osu.Desktop/Overlays/VersionManager.cs | 3 --- .../Objects/Drawables/Pieces/CirclePiece.cs | 3 +++ .../Drawables/Pieces/SpinnerBackground.cs | 3 --- osu.Game/Graphics/Backgrounds/Triangles.cs | 4 ---- .../Graphics/Containers/LinkFlowContainer.cs | 2 -- osu.Game/Graphics/DrawableDate.cs | 2 -- .../Graphics/UserInterface/OsuDropdown.cs | 3 +++ osu.Game/Overlays/ChatOverlay.cs | 20 ++++++++++++++----- osu.Game/Overlays/OnScreenDisplay.cs | 3 --- osu.Game/Screens/Menu/LogoVisualisation.cs | 3 --- osu.Game/Screens/Menu/MenuSideFlashes.cs | 3 --- osu.Game/Screens/Play/SquareGraph.cs | 3 --- .../Select/Leaderboards/Placeholder.cs | 2 -- .../Drawables/DrawableStoryboard.cs | 2 -- osu.Game/osu.Game.csproj | 2 +- 15 files changed, 22 insertions(+), 36 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8881884fb4..96857d6b4f 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -27,9 +27,6 @@ namespace osu.Desktop.Overlays private NotificationOverlay notificationOverlay; private GameHost host; - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - [BackgroundDependencyLoader] private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host) { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs index bd7a4ad3f6..6bb6991cc0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs @@ -12,6 +12,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class CirclePiece : Container, IKeyBindingHandler { + // IsHovered is used + public override bool HandlePositionalInput => true; + public Func Hit; public CirclePiece() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs index 0401df7a91..584fd93a70 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs @@ -11,9 +11,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SpinnerBackground : CircularContainer, IHasAccentColour { - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - protected Box Disc; public Color4 AccentColour diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index bff9e49dce..4a86d0e4f6 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -30,10 +30,6 @@ namespace osu.Game.Graphics.Backgrounds /// private const float edge_smoothness = 1; - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - - public Color4 ColourLight = Color4.White; public Color4 ColourDark = Color4.Black; diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 7c17f95e80..e4e7828d0e 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -20,8 +20,6 @@ namespace osu.Game.Graphics.Containers { } - public override bool HandlePositionalInput => true; - private OsuGame game; private Action showNotImplementedError; diff --git a/osu.Game/Graphics/DrawableDate.cs b/osu.Game/Graphics/DrawableDate.cs index 1a7ed607e6..28f8bdf82f 100644 --- a/osu.Game/Graphics/DrawableDate.cs +++ b/osu.Game/Graphics/DrawableDate.cs @@ -54,8 +54,6 @@ namespace osu.Game.Graphics Scheduler.AddDelayed(updateTimeWithReschedule, timeUntilNextUpdate); } - public override bool HandlePositionalInput => true; - protected virtual string Format() => Date.Humanize(); private void updateTime() => Text = Format(); diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 830bde9dac..26caf09b1b 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -97,6 +97,9 @@ namespace osu.Game.Graphics.UserInterface #region DrawableOsuDropdownMenuItem public class DrawableOsuDropdownMenuItem : DrawableDropdownMenuItem, IHasAccentColour { + // IsHovered is used + public override bool HandlePositionalInput => true; + private Color4? accentColour; public Color4 AccentColour { diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 4832c85e74..eeadac8e8c 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -51,7 +51,7 @@ namespace osu.Game.Overlays private readonly ChatTabControl channelTabs; private readonly Container chatContainer; - private readonly Container tabsArea; + private readonly TabsArea tabsArea; private readonly Box chatBackground; private readonly Box tabBackground; @@ -145,11 +145,8 @@ namespace osu.Game.Overlays loading = new LoadingAnimation(), } }, - tabsArea = new Container + tabsArea = new TabsArea { - Name = @"tabs area", - RelativeSizeAxes = Axes.X, - Height = TAB_AREA_HEIGHT, Children = new Drawable[] { tabBackground = new Box @@ -541,5 +538,18 @@ namespace osu.Game.Overlays api.Queue(req); } + + private class TabsArea : Container + { + // IsHovered is used + public override bool HandlePositionalInput => true; + + public TabsArea() + { + Name = @"tabs area"; + RelativeSizeAxes = Axes.X; + Height = TAB_AREA_HEIGHT; + } + } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index e40004aa01..97c6554908 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -25,9 +25,6 @@ namespace osu.Game.Overlays { private readonly Container box; - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - private readonly SpriteText textLine1; private readonly SpriteText textLine2; private readonly SpriteText textLine3; diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 5d76206905..34fb0b196b 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -64,9 +64,6 @@ namespace osu.Game.Screens.Menu private readonly float[] frequencyAmplitudes = new float[256]; - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - private Shader shader; private readonly Texture texture; diff --git a/osu.Game/Screens/Menu/MenuSideFlashes.cs b/osu.Game/Screens/Menu/MenuSideFlashes.cs index a9e3310fbe..3de68fe914 100644 --- a/osu.Game/Screens/Menu/MenuSideFlashes.cs +++ b/osu.Game/Screens/Menu/MenuSideFlashes.cs @@ -19,9 +19,6 @@ namespace osu.Game.Screens.Menu { public class MenuSideFlashes : BeatSyncedContainer { - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - private readonly IBindable beatmap = new Bindable(); private Box leftBox; diff --git a/osu.Game/Screens/Play/SquareGraph.cs b/osu.Game/Screens/Play/SquareGraph.cs index 6b4918af75..bc4c87e191 100644 --- a/osu.Game/Screens/Play/SquareGraph.cs +++ b/osu.Game/Screens/Play/SquareGraph.cs @@ -21,9 +21,6 @@ namespace osu.Game.Screens.Play public int ColumnCount => columns.Length; - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; - private int progress; public int Progress { diff --git a/osu.Game/Screens/Select/Leaderboards/Placeholder.cs b/osu.Game/Screens/Select/Leaderboards/Placeholder.cs index 105f9e2064..468b43e54f 100644 --- a/osu.Game/Screens/Select/Leaderboards/Placeholder.cs +++ b/osu.Game/Screens/Select/Leaderboards/Placeholder.cs @@ -11,8 +11,6 @@ namespace osu.Game.Screens.Select.Leaderboards { protected const float TEXT_SIZE = 22; - public override bool HandlePositionalInput => true; - protected Placeholder() : base(cp => cp.TextSize = TEXT_SIZE) { diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs index 02a4b46f1c..ef03539998 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs @@ -18,8 +18,6 @@ namespace osu.Game.Storyboards.Drawables protected override Container Content => content; protected override Vector2 DrawScale => new Vector2(Parent.DrawHeight / 480); - public override bool HandleNonPositionalInput => false; - public override bool HandlePositionalInput => false; private bool passing = true; public bool Passing diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 48400084ca..66bae277b3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - +