1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

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.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Input.States;
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)
{
sampleClick?.Play();
Action?.Invoke();
}
return base.OnClick(state);
return base.OnClick(e);
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
if (isEnabled)
sampleHover?.Play();
return base.OnHover(state);
return base.OnHover(e);
}
[BackgroundDependencyLoader]

View File

@ -5,6 +5,7 @@ using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Input.States;
using osu.Game.Online.API.Requests.Responses;
using System;
@ -95,7 +96,7 @@ namespace osu.Game.Overlays.Changelog
Selected?.Invoke(source.LatestBuild, EventArgs.Empty);
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
foreach (StreamBadge streamBadge in badgesContainer.Children)
{
@ -109,10 +110,10 @@ namespace osu.Game.Overlays.Changelog
else
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)
{
@ -121,7 +122,7 @@ namespace osu.Game.Overlays.Changelog
else if (streamBadge.LatestBuild.UpdateStream.Id == selectedStreamId)
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.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Framework.Input.States;
using osu.Game.Graphics.UserInterface;
using System;
@ -114,18 +115,18 @@ namespace osu.Game.Overlays.Changelog.Header
.FadeIn(duration, easing);
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
if (!IsActivated)
sampleHover?.Play();
return base.OnHover(state);
return base.OnHover(e);
}
protected override bool OnClick(InputState state)
protected override bool OnClick(ClickEvent e)
{
OnActivated();
sampleActivate?.Play();
return base.OnClick(state);
return base.OnClick(e);
}
protected virtual void OnActivated()

View File

@ -4,6 +4,7 @@
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Input.Events;
using osu.Framework.Input.States;
namespace osu.Game.Overlays.Changelog.Header
@ -48,23 +49,23 @@ namespace osu.Game.Overlays.Changelog.Header
SetTextColour(badgeColour, 100);
}
protected override bool OnClick(InputState state)
protected override bool OnClick(ClickEvent e)
{
Activate();
return base.OnClick(state);
return base.OnClick(e);
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
LineBadge.Uncollapse();
return base.OnHover(state);
return base.OnHover(e);
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
if (!IsActivated)
LineBadge.Collapse();
base.OnHoverLost(state);
base.OnHoverLost(e);
}
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.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Framework.Input.States;
using osu.Game.Graphics;
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);
sampleClick?.Play();
return base.OnClick(state);
return base.OnClick(e);
}
protected override bool OnHover(InputState state)
protected override bool OnHover(HoverEvent e)
{
sampleHover?.Play();
DisableDim();
this.FadeIn(transition_duration);
lineBadge.Uncollapse();
return base.OnHover(state);
return base.OnHover(e);
}
protected override void OnHoverLost(InputState state)
protected override void OnHoverLost(HoverLostEvent e)
{
if (!isActivated)
{
@ -132,7 +133,7 @@ namespace osu.Game.Overlays.Changelog
}
else
EnableDim();
base.OnHoverLost(state);
base.OnHoverLost(e);
}
public void EnableDim() => text.FadeTo(0.5f, transition_duration);

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays
private float savedScrollPosition;
// 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()
{