-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. 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.Allocation; | ||
|
@@ -36,13 +34,13 @@ public partial class HoldForMenuButton : FillFlowContainer | |
|
||
public readonly Bindable<bool> ReplayLoaded = new Bindable<bool>(); | ||
|
||
private HoldButton button; | ||
private HoldButton button = null!; | ||
|
||
public Action Action { get; set; } | ||
public Action? Action { get; set; } | ||
|
||
private OsuSpriteText text; | ||
private OsuSpriteText text = null!; | ||
|
||
private Bindable<bool> alwaysShow; | ||
private Bindable<bool> alwaysShow = null!; | ||
|
||
public HoldForMenuButton() | ||
{ | ||
|
@@ -53,8 +51,8 @@ public HoldForMenuButton() | |
AlwaysPresent = true; | ||
} | ||
|
||
[BackgroundDependencyLoader(true)] | ||
private void load(Player player, OsuConfigManager config) | ||
[BackgroundDependencyLoader] | ||
private void load(Player? player, OsuConfigManager config) | ||
{ | ||
Children = new Drawable[] | ||
{ | ||
|
@@ -70,7 +68,7 @@ private void load(Player player, OsuConfigManager config) | |
HoverLost = () => text.FadeOut(500, Easing.OutQuint), | ||
IsPaused = { BindTarget = IsPaused }, | ||
ReplayLoaded = { BindTarget = ReplayLoaded }, | ||
Action = () => Action(), | ||
Action = () => Action?.Invoke(), | ||
} | ||
}; | ||
|
||
|
@@ -80,9 +78,9 @@ private void load(Player player, OsuConfigManager config) | |
} | ||
|
||
[Resolved] | ||
private SessionStatics sessionStatics { get; set; } | ||
private SessionStatics sessionStatics { get; set; } = null!; | ||
|
||
private Bindable<bool> touchActive; | ||
private Bindable<bool> touchActive = null!; | ||
|
||
protected override void LoadComplete() | ||
{ | ||
|
@@ -144,23 +142,23 @@ protected override void Update() | |
|
||
private partial class HoldButton : HoldToConfirmContainer, IKeyBindingHandler<GlobalAction> | ||
{ | ||
private SpriteIcon icon; | ||
private CircularProgress circularProgress; | ||
private Circle overlayCircle; | ||
private SpriteIcon icon = null!; | ||
private CircularProgress circularProgress = null!; | ||
private Circle overlayCircle = null!; | ||
|
||
public readonly Bindable<bool> IsPaused = new Bindable<bool>(); | ||
|
||
public readonly Bindable<bool> ReplayLoaded = new Bindable<bool>(); | ||
|
||
protected override bool AllowMultipleFires => true; | ||
|
||
public Action HoverGained; | ||
public Action HoverLost; | ||
public Action? HoverGained; | ||
public Action? HoverLost; | ||
|
||
private const double shake_duration = 20; | ||
|
||
private bool pendingAnimation; | ||
private ScheduledDelegate shakeOperation; | ||
private ScheduledDelegate? shakeOperation; | ||
|
||
public HoldButton(bool isDangerousAction) | ||
: base(isDangerousAction) | ||
|