Update overrided functions to match their bases

This commit is contained in:
Hōtarō Oreki
2018-10-18 20:56:43 +02:00
parent 7cc5128353
commit 510b52a503
6 changed files with 30 additions and 25 deletions

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Input.States; using osu.Framework.Input.States;
using System; using System;
@ -69,21 +70,21 @@ namespace osu.Game.Graphics.UserInterface
}; };
} }
protected override bool OnClick(InputState state) protected override bool OnClick(ClickEvent e)
{ {
if (isEnabled) if (isEnabled)
{ {
sampleClick?.Play(); sampleClick?.Play();
Action?.Invoke(); Action?.Invoke();
} }
return base.OnClick(state); return base.OnClick(e);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(HoverEvent e)
{ {
if (isEnabled) if (isEnabled)
sampleHover?.Play(); sampleHover?.Play();
return base.OnHover(state); return base.OnHover(e);
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -5,6 +5,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Input.States; using osu.Framework.Input.States;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using System; using System;
@ -95,7 +96,7 @@ namespace osu.Game.Overlays.Changelog
Selected?.Invoke(source.LatestBuild, EventArgs.Empty); Selected?.Invoke(source.LatestBuild, EventArgs.Empty);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(HoverEvent e)
{ {
foreach (StreamBadge streamBadge in badgesContainer.Children) foreach (StreamBadge streamBadge in badgesContainer.Children)
{ {
@ -109,10 +110,10 @@ namespace osu.Game.Overlays.Changelog
else else
streamBadge.Deactivate(); streamBadge.Deactivate();
} }
return base.OnHover(state); return base.OnHover(e);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(HoverLostEvent e)
{ {
foreach (StreamBadge streamBadge in badgesContainer.Children) foreach (StreamBadge streamBadge in badgesContainer.Children)
{ {
@ -121,7 +122,7 @@ namespace osu.Game.Overlays.Changelog
else if (streamBadge.LatestBuild.UpdateStream.Id == selectedStreamId) else if (streamBadge.LatestBuild.UpdateStream.Id == selectedStreamId)
streamBadge.DisableDim(); streamBadge.DisableDim();
} }
base.OnHoverLost(state); base.OnHoverLost(e);
} }
} }
} }

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Framework.Input.States; using osu.Framework.Input.States;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using System; using System;
@ -114,18 +115,18 @@ namespace osu.Game.Overlays.Changelog.Header
.FadeIn(duration, easing); .FadeIn(duration, easing);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(HoverEvent e)
{ {
if (!IsActivated) if (!IsActivated)
sampleHover?.Play(); sampleHover?.Play();
return base.OnHover(state); return base.OnHover(e);
} }
protected override bool OnClick(InputState state) protected override bool OnClick(ClickEvent e)
{ {
OnActivated(); OnActivated();
sampleActivate?.Play(); sampleActivate?.Play();
return base.OnClick(state); return base.OnClick(e);
} }
protected virtual void OnActivated() protected virtual void OnActivated()

View File

@ -4,6 +4,7 @@
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
using osu.Framework.Input.Events;
using osu.Framework.Input.States; using osu.Framework.Input.States;
namespace osu.Game.Overlays.Changelog.Header namespace osu.Game.Overlays.Changelog.Header
@ -48,23 +49,23 @@ namespace osu.Game.Overlays.Changelog.Header
SetTextColour(badgeColour, 100); SetTextColour(badgeColour, 100);
} }
protected override bool OnClick(InputState state) protected override bool OnClick(ClickEvent e)
{ {
Activate(); Activate();
return base.OnClick(state); return base.OnClick(e);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(HoverEvent e)
{ {
LineBadge.Uncollapse(); LineBadge.Uncollapse();
return base.OnHover(state); return base.OnHover(e);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(HoverLostEvent e)
{ {
if (!IsActivated) if (!IsActivated)
LineBadge.Collapse(); LineBadge.Collapse();
base.OnHoverLost(state); base.OnHoverLost(e);
} }
public void UpdateBadgeWidth() => LineBadge.ResizeWidthTo(Text.DrawWidth); public void UpdateBadgeWidth() => LineBadge.ResizeWidthTo(Text.DrawWidth);

View File

@ -8,6 +8,7 @@ using osu.Framework.Audio.Sample;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Framework.Input.States; using osu.Framework.Input.States;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
@ -107,23 +108,23 @@ namespace osu.Game.Overlays.Changelog
} }
} }
protected override bool OnClick(InputState state) protected override bool OnClick(ClickEvent e)
{ {
Activate(false); Activate(false);
sampleClick?.Play(); sampleClick?.Play();
return base.OnClick(state); return base.OnClick(e);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(HoverEvent e)
{ {
sampleHover?.Play(); sampleHover?.Play();
DisableDim(); DisableDim();
this.FadeIn(transition_duration); this.FadeIn(transition_duration);
lineBadge.Uncollapse(); lineBadge.Uncollapse();
return base.OnHover(state); return base.OnHover(e);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(HoverLostEvent e)
{ {
if (!isActivated) if (!isActivated)
{ {
@ -132,7 +133,7 @@ namespace osu.Game.Overlays.Changelog
} }
else else
EnableDim(); EnableDim();
base.OnHoverLost(state); base.OnHoverLost(e);
} }
public void EnableDim() => text.FadeTo(0.5f, transition_duration); public void EnableDim() => text.FadeTo(0.5f, transition_duration);

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays
private float savedScrollPosition; private float savedScrollPosition;
// receive input outside our bounds so we can trigger a close event on ourselves. // receive input outside our bounds so we can trigger a close event on ourselves.
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
public ChangelogOverlay() public ChangelogOverlay()
{ {