1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Apply NRT to MainMenuButton

This commit is contained in:
Dean Herbert 2023-11-24 11:05:57 +09:00
parent 8ad414488a
commit 1d1b3ca982
No known key found for this signature in database

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using System.Linq;
using osu.Framework;
@ -33,7 +31,7 @@ namespace osu.Game.Screens.Menu
/// </summary>
public partial class MainMenuButton : BeatSyncedContainer, IStateful<ButtonState>
{
public event Action<ButtonState> StateChanged;
public event Action<ButtonState>? StateChanged;
public readonly Key[] TriggerKeys;
@ -48,14 +46,14 @@ namespace osu.Game.Screens.Menu
/// </summary>
public ButtonSystemState VisibleState = ButtonSystemState.TopLevel;
private readonly Action clickAction;
private Sample sampleClick;
private Sample sampleHover;
private SampleChannel sampleChannel;
private readonly Action? clickAction;
private Sample? sampleClick;
private Sample? sampleHover;
private SampleChannel? sampleChannel;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => box.ReceivePositionalInputAt(screenSpacePos);
public MainMenuButton(LocalisableString text, string sampleName, IconUsage symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, params Key[] triggerKeys)
public MainMenuButton(LocalisableString text, string sampleName, IconUsage symbol, Color4 colour, Action? clickAction = null, float extraWidth = 0, params Key[] triggerKeys)
{
this.sampleName = sampleName;
this.clickAction = clickAction;