1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:43:20 +08:00

Merge branch 'master' into move-overlay-ruleset-selectors

This commit is contained in:
Bartłomiej Dach 2023-01-14 15:22:14 +01:00 committed by GitHub
commit 5e1ea8b34f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 319 additions and 410 deletions

View File

@ -188,6 +188,7 @@ namespace osu.Game.Rulesets.Catch.Edit
if (EditorBeatmap.PlacementObject.Value is JuiceStream) if (EditorBeatmap.PlacementObject.Value is JuiceStream)
{ {
// Juice stream path is not subject to snapping. // Juice stream path is not subject to snapping.
if (BlueprintContainer.CurrentPlacement.PlacementActive is PlacementBlueprint.PlacementState.Active)
return null; return null;
} }

View File

@ -73,16 +73,6 @@ namespace osu.Game.Tests.Gameplay
} }
[Test] [Test]
[FlakyTest]
/*
* Fail rate around 0.15%
*
* TearDown : osu.Framework.Testing.Drawables.Steps.AssertButton+TracedException : gameplay clock time = 2500
* --TearDown
* at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
* at osu.Framework.Threading.Scheduler.Update()
* at osu.Framework.Graphics.Drawable.UpdateSubTree()
*/
public void TestSeekPerformsInGameplayTime( public void TestSeekPerformsInGameplayTime(
[Values(1.0, 0.5, 2.0)] double clockRate, [Values(1.0, 0.5, 2.0)] double clockRate,
[Values(0.0, 200.0, -200.0)] double userOffset, [Values(0.0, 200.0, -200.0)] double userOffset,
@ -92,6 +82,9 @@ namespace osu.Game.Tests.Gameplay
ClockBackedTestWorkingBeatmap working = null; ClockBackedTestWorkingBeatmap working = null;
GameplayClockContainer gameplayClockContainer = null; GameplayClockContainer gameplayClockContainer = null;
// ReSharper disable once NotAccessedVariable
BindableDouble trackAdjustment = null; // keeping a reference for track adjustment
if (setAudioOffsetBeforeConstruction) if (setAudioOffsetBeforeConstruction)
AddStep($"preset audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset)); AddStep($"preset audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
@ -103,16 +96,16 @@ namespace osu.Game.Tests.Gameplay
gameplayClockContainer.Reset(startClock: !whileStopped); gameplayClockContainer.Reset(startClock: !whileStopped);
}); });
AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(clockRate))); AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, trackAdjustment = new BindableDouble(clockRate)));
if (!setAudioOffsetBeforeConstruction) if (!setAudioOffsetBeforeConstruction)
AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset)); AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500)); AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500));
AddStep("gameplay clock time = 2500", () => Assert.AreEqual(gameplayClockContainer.CurrentTime, 2500, 10f)); AddAssert("gameplay clock time = 2500", () => gameplayClockContainer.CurrentTime, () => Is.EqualTo(2500).Within(10f));
AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000)); AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000));
AddStep("gameplay clock time = 10000", () => Assert.AreEqual(gameplayClockContainer.CurrentTime, 10000, 10f)); AddAssert("gameplay clock time = 10000", () => gameplayClockContainer.CurrentTime, () => Is.EqualTo(10000).Within(10f));
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)

View File

@ -181,7 +181,8 @@ namespace osu.Game.Tests.Visual.Gameplay
AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed); AddUntilStep("wait for fail", () => Player.GameplayState.HasFailed);
AddStep("exit", () => Player.Exit()); AddStep("exit", () => Player.Exit());
AddAssert("ensure failing submission", () => Player.SubmittedScore?.ScoreInfo.Passed == false); AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);
} }
[Test] [Test]
@ -209,7 +210,9 @@ namespace osu.Game.Tests.Visual.Gameplay
addFakeHit(); addFakeHit();
AddStep("exit", () => Player.Exit()); AddStep("exit", () => Player.Exit());
AddAssert("ensure failing submission", () => Player.SubmittedScore?.ScoreInfo.Passed == false);
AddUntilStep("wait for submission", () => Player.SubmittedScore != null);
AddAssert("ensure failing submission", () => Player.SubmittedScore.ScoreInfo.Passed == false);
} }
[Test] [Test]

View File

@ -1,13 +1,16 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
using osu.Framework.Testing;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Comments; using osu.Game.Overlays.Comments;
using osuTK; using osuTK;
@ -20,8 +23,8 @@ namespace osu.Game.Tests.Visual.UserInterface
[Cached] [Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
private TestCommentEditor commentEditor; private TestCommentEditor commentEditor = null!;
private TestCancellableCommentEditor cancellableCommentEditor; private TestCancellableCommentEditor cancellableCommentEditor = null!;
[SetUp] [SetUp]
public void SetUp() => Schedule(() => public void SetUp() => Schedule(() =>
@ -45,15 +48,16 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
AddStep("click on text box", () => AddStep("click on text box", () =>
{ {
InputManager.MoveMouseTo(commentEditor); InputManager.MoveMouseTo(commentEditor.ChildrenOfType<TextBox>().Single());
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
AddStep("enter text", () => commentEditor.Current.Value = "text"); AddStep("enter text", () => commentEditor.Current.Value = "text");
AddStep("press Enter", () => InputManager.Key(Key.Enter)); AddStep("press Enter", () => InputManager.Key(Key.Enter));
AddUntilStep("button is loading", () => commentEditor.IsSpinnerShown);
AddAssert("text committed", () => commentEditor.CommittedText == "text"); AddAssert("text committed", () => commentEditor.CommittedText == "text");
AddAssert("button is loading", () => commentEditor.IsLoading); AddUntilStep("button is not loading", () => !commentEditor.IsSpinnerShown);
} }
[Test] [Test]
@ -61,14 +65,14 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
AddStep("click on text box", () => AddStep("click on text box", () =>
{ {
InputManager.MoveMouseTo(commentEditor); InputManager.MoveMouseTo(commentEditor.ChildrenOfType<TextBox>().Single());
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
AddStep("press Enter", () => InputManager.Key(Key.Enter)); AddStep("press Enter", () => InputManager.Key(Key.Enter));
AddAssert("no text committed", () => commentEditor.CommittedText == null); AddAssert("button is not loading", () => !commentEditor.IsSpinnerShown);
AddAssert("button is not loading", () => !commentEditor.IsLoading); AddAssert("no text committed", () => commentEditor.CommittedText.Length == 0);
} }
[Test] [Test]
@ -76,7 +80,7 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
AddStep("click on text box", () => AddStep("click on text box", () =>
{ {
InputManager.MoveMouseTo(commentEditor); InputManager.MoveMouseTo(commentEditor.ChildrenOfType<TextBox>().Single());
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
AddStep("enter text", () => commentEditor.Current.Value = "some other text"); AddStep("enter text", () => commentEditor.Current.Value = "some other text");
@ -87,8 +91,9 @@ namespace osu.Game.Tests.Visual.UserInterface
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
AddUntilStep("button is loading", () => commentEditor.IsSpinnerShown);
AddAssert("text committed", () => commentEditor.CommittedText == "some other text"); AddAssert("text committed", () => commentEditor.CommittedText == "some other text");
AddAssert("button is loading", () => commentEditor.IsLoading); AddUntilStep("button is not loading", () => !commentEditor.IsSpinnerShown);
} }
[Test] [Test]
@ -96,7 +101,7 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
AddStep("click cancel button", () => AddStep("click cancel button", () =>
{ {
InputManager.MoveMouseTo(cancellableCommentEditor.ButtonsContainer); InputManager.MoveMouseTo(cancellableCommentEditor.ButtonsContainer[1]);
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
@ -108,28 +113,27 @@ namespace osu.Game.Tests.Visual.UserInterface
public new Bindable<string> Current => base.Current; public new Bindable<string> Current => base.Current;
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer; public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
public string CommittedText { get; private set; } public string CommittedText { get; private set; } = string.Empty;
public TestCommentEditor() public bool IsSpinnerShown => this.ChildrenOfType<LoadingSpinner>().Single().IsPresent;
{
OnCommit = onCommit;
}
private void onCommit(string value) protected override void OnCommit(string value)
{ {
ShowLoadingSpinner = true;
CommittedText = value; CommittedText = value;
Scheduler.AddDelayed(() => IsLoading = false, 1000); Scheduler.AddDelayed(() => ShowLoadingSpinner = false, 1000);
} }
protected override string FooterText => @"Footer text. And it is pretty long. Cool."; protected override LocalisableString FooterText => @"Footer text. And it is pretty long. Cool.";
protected override string CommitButtonText => @"Commit"; protected override LocalisableString CommitButtonText => @"Commit";
protected override string TextBoxPlaceholder => @"This text box is empty"; protected override LocalisableString TextBoxPlaceholder => @"This text box is empty";
} }
private partial class TestCancellableCommentEditor : CancellableCommentEditor private partial class TestCancellableCommentEditor : CancellableCommentEditor
{ {
public new FillFlowContainer ButtonsContainer => base.ButtonsContainer; public new FillFlowContainer ButtonsContainer => base.ButtonsContainer;
protected override string FooterText => @"Wow, another one. Sicc";
protected override LocalisableString FooterText => @"Wow, another one. Sicc";
public bool Cancelled { get; private set; } public bool Cancelled { get; private set; }
@ -138,8 +142,12 @@ namespace osu.Game.Tests.Visual.UserInterface
OnCancel = () => Cancelled = true; OnCancel = () => Cancelled = true;
} }
protected override string CommitButtonText => @"Save"; protected override void OnCommit(string text)
protected override string TextBoxPlaceholder => @"Multiline textboxes soon"; {
}
protected override LocalisableString CommitButtonText => @"Save";
protected override LocalisableString TextBoxPlaceholder => @"Multiline textboxes soon";
} }
} }
} }

View File

@ -15,10 +15,52 @@ namespace osu.Game.Localisation
public static LocalisableString HeaderTitle => new TranslatableString(getKey(@"header_title"), @"notifications"); public static LocalisableString HeaderTitle => new TranslatableString(getKey(@"header_title"), @"notifications");
/// <summary> /// <summary>
/// "waiting for 'ya" /// "waiting for &#39;ya"
/// </summary> /// </summary>
public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"waiting for 'ya"); public static LocalisableString HeaderDescription => new TranslatableString(getKey(@"header_description"), @"waiting for 'ya");
private static string getKey(string key) => $"{prefix}:{key}"; /// <summary>
/// "Running Tasks"
/// </summary>
public static LocalisableString RunningTasks => new TranslatableString(getKey(@"running_tasks"), @"Running Tasks");
/// <summary>
/// "Clear All"
/// </summary>
public static LocalisableString ClearAll => new TranslatableString(getKey(@"clear_all"), @"Clear All");
/// <summary>
/// "Cancel All"
/// </summary>
public static LocalisableString CancelAll => new TranslatableString(getKey(@"cancel_all"), @"Cancel All");
/// <summary>
/// "Your battery level is low! Charge your device to prevent interruptions during gameplay."
/// </summary>
public static LocalisableString BatteryLow => new TranslatableString(getKey(@"battery_low"), @"Your battery level is low! Charge your device to prevent interruptions during gameplay.");
/// <summary>
/// "Your game volume is too low to hear anything! Click here to restore it."
/// </summary>
public static LocalisableString GameVolumeTooLow => new TranslatableString(getKey(@"game_volume_too_low"), @"Your game volume is too low to hear anything! Click here to restore it.");
/// <summary>
/// "The current ruleset doesn&#39;t have an autoplay mod available!"
/// </summary>
public static LocalisableString NoAutoplayMod => new TranslatableString(getKey(@"no_autoplay_mod"), @"The current ruleset doesn't have an autoplay mod available!");
/// <summary>
/// "osu! doesn&#39;t seem to be able to play audio correctly.\n\nPlease try changing your audio device to a working setting."
/// </summary>
public static LocalisableString AudioPlaybackIssue => new TranslatableString(getKey(@"audio_playback_issue"),
@"osu! doesn't seem to be able to play audio correctly.\n\nPlease try changing your audio device to a working setting.");
/// <summary>
/// "The score overlay is currently disabled. You can toggle this by pressing {0}."
/// </summary>
public static LocalisableString ScoreOverlayDisabled(LocalisableString arg0) => new TranslatableString(getKey(@"score_overlay_disabled"),
@"The score overlay is currently disabled. You can toggle this by pressing {0}.", arg0);
private static string getKey(string key) => $@"{prefix}:{key}";
} }
} }

View File

@ -8,7 +8,7 @@ namespace osu.Game.Online.API.Requests.Responses
public class APIUserGroup public class APIUserGroup
{ {
[JsonProperty(@"colour")] [JsonProperty(@"colour")]
public string Colour { get; set; } = null!; public string? Colour { get; set; }
[JsonProperty(@"has_listing")] [JsonProperty(@"has_listing")]
public bool HasListings { get; set; } public bool HasListings { get; set; }

View File

@ -1,76 +1,24 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Resources.Localisation.Web; using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
{ {
public abstract partial class CancellableCommentEditor : CommentEditor public abstract partial class CancellableCommentEditor : CommentEditor
{ {
public Action OnCancel; public Action? OnCancel;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
ButtonsContainer.Add(new CancelButton ButtonsContainer.Add(new EditorButton
{ {
Anchor = Anchor.CentreRight, Action = () => OnCancel?.Invoke(),
Origin = Anchor.CentreRight, Text = CommonStrings.ButtonsCancel,
Action = () => OnCancel?.Invoke()
}); });
} }
private partial class CancelButton : OsuHoverContainer
{
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
private readonly Box background;
public CancelButton()
: base(HoverSampleSet.Button)
{
AutoSizeAxes = Axes.Both;
Child = new CircularContainer
{
Masking = true,
Height = 25,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both
},
new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
Margin = new MarginPadding { Horizontal = 20 },
Text = CommonStrings.ButtonsCancel
}
}
};
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
IdleColour = colourProvider.Light4;
HoverColour = colourProvider.Light3;
}
}
} }
} }

View File

@ -1,22 +1,20 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Graphics.Sprites;
using osuTK.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using System.Collections.Generic; using osu.Game.Graphics.UserInterfaceV2;
using System;
using osuTK; using osuTK;
using osu.Framework.Bindables; using osuTK.Graphics;
namespace osu.Game.Overlays.Comments namespace osu.Game.Overlays.Comments
{ {
@ -24,25 +22,31 @@ namespace osu.Game.Overlays.Comments
{ {
private const int side_padding = 8; private const int side_padding = 8;
public Action<string> OnCommit; protected abstract LocalisableString FooterText { get; }
public bool IsLoading protected abstract LocalisableString CommitButtonText { get; }
protected abstract LocalisableString TextBoxPlaceholder { get; }
protected FillFlowContainer ButtonsContainer { get; private set; } = null!;
protected readonly Bindable<string> Current = new Bindable<string>(string.Empty);
private RoundedButton commitButton = null!;
private LoadingSpinner loadingSpinner = null!;
protected bool ShowLoadingSpinner
{ {
get => commitButton.IsLoading; set
set => commitButton.IsLoading = value; {
if (value)
loadingSpinner.Show();
else
loadingSpinner.Hide();
updateCommitButtonState();
}
} }
protected abstract string FooterText { get; }
protected abstract string CommitButtonText { get; }
protected abstract string TextBoxPlaceholder { get; }
protected FillFlowContainer ButtonsContainer { get; private set; }
protected readonly Bindable<string> Current = new Bindable<string>();
private CommitButton commitButton;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider) private void load(OverlayColourProvider colourProvider)
@ -79,7 +83,7 @@ namespace osu.Game.Overlays.Comments
}, },
new Container new Container
{ {
Name = "Footer", Name = @"Footer",
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 35, Height = 35,
Padding = new MarginPadding { Horizontal = side_padding }, Padding = new MarginPadding { Horizontal = side_padding },
@ -92,54 +96,64 @@ namespace osu.Game.Overlays.Comments
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
Text = FooterText Text = FooterText
}, },
ButtonsContainer = new FillFlowContainer new FillFlowContainer
{ {
Name = "Buttons",
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(5, 0), Spacing = new Vector2(5, 0),
Child = commitButton = new CommitButton(CommitButtonText) Children = new Drawable[]
{
ButtonsContainer = new FillFlowContainer
{
Name = @"Buttons",
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5, 0),
Child = commitButton = new EditorButton
{
Text = CommitButtonText,
Action = () => OnCommit(Current.Value)
}
},
loadingSpinner = new LoadingSpinner
{ {
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Action = () => Size = new Vector2(18),
{ },
OnCommit?.Invoke(Current.Value);
Current.Value = string.Empty;
}
}
} }
},
} }
} }
} }
} }
}); });
textBox.OnCommit += (_, _) => textBox.OnCommit += (_, _) => commitButton.TriggerClick();
{
if (commitButton.IsBlocked.Value)
return;
commitButton.TriggerClick();
};
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
Current.BindValueChanged(_ => updateCommitButtonState(), true);
Current.BindValueChanged(text => commitButton.IsBlocked.Value = string.IsNullOrEmpty(text.NewValue), true);
} }
protected abstract void OnCommit(string text);
private void updateCommitButtonState() =>
commitButton.Enabled.Value = loadingSpinner.State.Value == Visibility.Hidden && !string.IsNullOrEmpty(Current.Value);
private partial class EditorTextBox : BasicTextBox private partial class EditorTextBox : BasicTextBox
{ {
protected override float LeftRightPadding => side_padding; protected override float LeftRightPadding => side_padding;
protected override Color4 SelectionColour => Color4.Gray; protected override Color4 SelectionColour => Color4.Gray;
private OsuSpriteText placeholder; private OsuSpriteText placeholder = null!;
public EditorTextBox() public EditorTextBox()
{ {
@ -163,88 +177,26 @@ namespace osu.Game.Overlays.Comments
protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) }, Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) }
}; };
} }
private partial class CommitButton : LoadingButton protected partial class EditorButton : RoundedButton
{ {
private const int duration = 200; public EditorButton()
public readonly BindableBool IsBlocked = new BindableBool();
public override bool PropagatePositionalInputSubTree => !IsBlocked.Value && base.PropagatePositionalInputSubTree;
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
private readonly string text;
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
private OsuSpriteText drawableText;
private Box background;
private Box blockedBackground;
public CommitButton(string text)
{ {
this.text = text; Width = 80;
Height = 25;
AutoSizeAxes = Axes.Both; Anchor = Anchor.CentreRight;
LoadingAnimationSize = new Vector2(10); Origin = Anchor.CentreRight;
} }
[BackgroundDependencyLoader] protected override SpriteText CreateText()
private void load()
{ {
IdleColour = colourProvider.Light4; var t = base.CreateText();
HoverColour = colourProvider.Light3; t.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 12);
blockedBackground.Colour = colourProvider.Background5; return t;
} }
protected override void LoadComplete()
{
base.LoadComplete();
IsBlocked.BindValueChanged(onBlockedStateChanged, true);
}
private void onBlockedStateChanged(ValueChangedEvent<bool> isBlocked)
{
drawableText.FadeColour(isBlocked.NewValue ? colourProvider.Foreground1 : Color4.White, duration, Easing.OutQuint);
background.FadeTo(isBlocked.NewValue ? 0 : 1, duration, Easing.OutQuint);
}
protected override Drawable CreateContent() => new CircularContainer
{
Masking = true,
Height = 25,
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
blockedBackground = new Box
{
RelativeSizeAxes = Axes.Both
},
background = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0
},
drawableText = new OsuSpriteText
{
AlwaysPresent = true,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
Margin = new MarginPadding { Horizontal = 20 },
Text = text,
}
}
};
protected override void OnLoadStarted() => drawableText.FadeOut(duration, Easing.OutQuint);
protected override void OnLoadFinished() => drawableText.FadeIn(duration, Easing.OutQuint);
} }
} }
} }

View File

@ -7,10 +7,10 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Users.Drawables;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Login
{ {
public const float LABEL_LEFT_MARGIN = 20; public const float LABEL_LEFT_MARGIN = 20;
private readonly SpriteIcon statusIcon; private readonly StatusIcon statusIcon;
public Color4 StatusColour public Color4 StatusColour
{ {
@ -101,11 +101,10 @@ namespace osu.Game.Overlays.Login
Icon.Size = new Vector2(14); Icon.Size = new Vector2(14);
Icon.Margin = new MarginPadding(0); Icon.Margin = new MarginPadding(0);
Foreground.Add(statusIcon = new SpriteIcon Foreground.Add(statusIcon = new StatusIcon
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Icon = FontAwesome.Regular.Circle,
Size = new Vector2(14), Size = new Vector2(14),
}); });

View File

@ -92,8 +92,8 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Children = new[] Children = new[]
{ {
new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, "Clear All"), new NotificationSection(AccountsStrings.NotificationsTitle, new[] { typeof(SimpleNotification) }, NotificationsStrings.ClearAll),
new NotificationSection(@"Running Tasks", new[] { typeof(ProgressNotification) }, @"Cancel All"), new NotificationSection(NotificationsStrings.RunningTasks, new[] { typeof(ProgressNotification) }, NotificationsStrings.CancelAll),
} }
} }
} }

View File

@ -33,15 +33,15 @@ namespace osu.Game.Overlays.Notifications
public IEnumerable<Type> AcceptedNotificationTypes { get; } public IEnumerable<Type> AcceptedNotificationTypes { get; }
private readonly string clearButtonText; private readonly LocalisableString clearButtonText;
private readonly LocalisableString titleText; private readonly LocalisableString titleText;
public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, string clearButtonText) public NotificationSection(LocalisableString title, IEnumerable<Type> acceptedNotificationTypes, LocalisableString clearButtonText)
{ {
AcceptedNotificationTypes = acceptedNotificationTypes.ToArray(); AcceptedNotificationTypes = acceptedNotificationTypes.ToArray();
this.clearButtonText = clearButtonText.ToUpperInvariant(); this.clearButtonText = clearButtonText.ToUpper();
titleText = title; titleText = title;
} }

View File

@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
new OsuSpriteText new OsuSpriteText
{ {
Text = group.ShortName, Text = group.ShortName,
Colour = Color4Extensions.FromHex(group.Colour), Colour = Color4Extensions.FromHex(group.Colour ?? Colour4.White.ToHex()),
Shadow = false, Shadow = false,
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true) Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true)
} }

View File

@ -36,7 +36,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected new EditorSelectionHandler SelectionHandler => (EditorSelectionHandler)base.SelectionHandler; protected new EditorSelectionHandler SelectionHandler => (EditorSelectionHandler)base.SelectionHandler;
private PlacementBlueprint currentPlacement; public PlacementBlueprint CurrentPlacement { get; private set; }
/// <remarks> /// <remarks>
/// Positional input must be received outside the container's bounds, /// Positional input must be received outside the container's bounds,
@ -137,13 +137,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void updatePlacementNewCombo() private void updatePlacementNewCombo()
{ {
if (currentPlacement?.HitObject is IHasComboInformation c) if (CurrentPlacement?.HitObject is IHasComboInformation c)
c.NewCombo = NewCombo.Value == TernaryState.True; c.NewCombo = NewCombo.Value == TernaryState.True;
} }
private void updatePlacementSamples() private void updatePlacementSamples()
{ {
if (currentPlacement == null) return; if (CurrentPlacement == null) return;
foreach (var kvp in SelectionHandler.SelectionSampleStates) foreach (var kvp in SelectionHandler.SelectionSampleStates)
sampleChanged(kvp.Key, kvp.Value.Value); sampleChanged(kvp.Key, kvp.Value.Value);
@ -151,9 +151,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void sampleChanged(string sampleName, TernaryState state) private void sampleChanged(string sampleName, TernaryState state)
{ {
if (currentPlacement == null) return; if (CurrentPlacement == null) return;
var samples = currentPlacement.HitObject.Samples; var samples = CurrentPlacement.HitObject.Samples;
var existingSample = samples.FirstOrDefault(s => s.Name == sampleName); var existingSample = samples.FirstOrDefault(s => s.Name == sampleName);
@ -225,7 +225,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
// if no time was found from positional snapping, we should still quantize to the beat. // if no time was found from positional snapping, we should still quantize to the beat.
snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null); snapResult.Time ??= Beatmap.SnapTime(EditorClock.CurrentTime, null);
currentPlacement.UpdateTimeAndPosition(snapResult); CurrentPlacement.UpdateTimeAndPosition(snapResult);
} }
#endregion #endregion
@ -234,9 +234,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
{ {
base.Update(); base.Update();
if (currentPlacement != null) if (CurrentPlacement != null)
{ {
switch (currentPlacement.PlacementActive) switch (CurrentPlacement.PlacementActive)
{ {
case PlacementBlueprint.PlacementState.Waiting: case PlacementBlueprint.PlacementState.Waiting:
if (!Composer.CursorInPlacementArea) if (!Composer.CursorInPlacementArea)
@ -252,7 +252,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (Composer.CursorInPlacementArea) if (Composer.CursorInPlacementArea)
ensurePlacementCreated(); ensurePlacementCreated();
if (currentPlacement != null) if (CurrentPlacement != null)
updatePlacementPosition(); updatePlacementPosition();
} }
@ -281,13 +281,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void ensurePlacementCreated() private void ensurePlacementCreated()
{ {
if (currentPlacement != null) return; if (CurrentPlacement != null) return;
var blueprint = CurrentTool?.CreatePlacementBlueprint(); var blueprint = CurrentTool?.CreatePlacementBlueprint();
if (blueprint != null) if (blueprint != null)
{ {
placementBlueprintContainer.Child = currentPlacement = blueprint; placementBlueprintContainer.Child = CurrentPlacement = blueprint;
// Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame // Fixes a 1-frame position discrepancy due to the first mouse move event happening in the next frame
updatePlacementPosition(); updatePlacementPosition();
@ -300,11 +300,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void removePlacement() private void removePlacement()
{ {
if (currentPlacement == null) return; if (CurrentPlacement == null) return;
currentPlacement.EndPlacement(false); CurrentPlacement.EndPlacement(false);
currentPlacement.Expire(); CurrentPlacement.Expire();
currentPlacement = null; CurrentPlacement = null;
} }
private HitObjectCompositionTool currentTool; private HitObjectCompositionTool currentTool;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
namespace osu.Game.Screens.Edit.Design namespace osu.Game.Screens.Edit.Design
{ {
public partial class DesignScreen : EditorScreen public partial class DesignScreen : EditorScreen

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Setup
{ {
public override LocalisableString Title => EditorSetupStrings.ColoursHeader; public override LocalisableString Title => EditorSetupStrings.ColoursHeader;
private LabelledColourPalette comboColours; private LabelledColourPalette comboColours = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
@ -19,16 +17,16 @@ namespace osu.Game.Screens.Edit.Setup
{ {
internal partial class DesignSection : SetupSection internal partial class DesignSection : SetupSection
{ {
protected LabelledSwitchButton EnableCountdown; protected LabelledSwitchButton EnableCountdown = null!;
protected FillFlowContainer CountdownSettings; protected FillFlowContainer CountdownSettings = null!;
protected LabelledEnumDropdown<CountdownType> CountdownSpeed; protected LabelledEnumDropdown<CountdownType> CountdownSpeed = null!;
protected LabelledNumberBox CountdownOffset; protected LabelledNumberBox CountdownOffset = null!;
private LabelledSwitchButton widescreenSupport; private LabelledSwitchButton widescreenSupport = null!;
private LabelledSwitchButton epilepsyWarning; private LabelledSwitchButton epilepsyWarning = null!;
private LabelledSwitchButton letterboxDuringBreaks; private LabelledSwitchButton letterboxDuringBreaks = null!;
private LabelledSwitchButton samplesMatchPlaybackRate; private LabelledSwitchButton samplesMatchPlaybackRate = null!;
public override LocalisableString Title => EditorSetupStrings.DesignHeader; public override LocalisableString Title => EditorSetupStrings.DesignHeader;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -17,10 +15,10 @@ namespace osu.Game.Screens.Edit.Setup
{ {
internal partial class DifficultySection : SetupSection internal partial class DifficultySection : SetupSection
{ {
private LabelledSliderBar<float> circleSizeSlider; private LabelledSliderBar<float> circleSizeSlider = null!;
private LabelledSliderBar<float> healthDrainSlider; private LabelledSliderBar<float> healthDrainSlider = null!;
private LabelledSliderBar<float> approachRateSlider; private LabelledSliderBar<float> approachRateSlider = null!;
private LabelledSliderBar<float> overallDifficultySlider; private LabelledSliderBar<float> overallDifficultySlider = null!;
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader; public override LocalisableString Title => EditorSetupStrings.DifficultyHeader;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -30,7 +28,7 @@ namespace osu.Game.Screens.Edit.Setup
internal partial class PopoverTextBox : OsuTextBox internal partial class PopoverTextBox : OsuTextBox
{ {
public Action OnFocused; public Action? OnFocused;
protected override bool OnDragStart(DragStartEvent e) protected override bool OnDragStart(DragStartEvent e)
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -16,16 +14,16 @@ namespace osu.Game.Screens.Edit.Setup
{ {
public partial class MetadataSection : SetupSection public partial class MetadataSection : SetupSection
{ {
protected LabelledTextBox ArtistTextBox; protected LabelledTextBox ArtistTextBox = null!;
protected LabelledTextBox RomanisedArtistTextBox; protected LabelledTextBox RomanisedArtistTextBox = null!;
protected LabelledTextBox TitleTextBox; protected LabelledTextBox TitleTextBox = null!;
protected LabelledTextBox RomanisedTitleTextBox; protected LabelledTextBox RomanisedTitleTextBox = null!;
private LabelledTextBox creatorTextBox; private LabelledTextBox creatorTextBox = null!;
private LabelledTextBox difficultyTextBox; private LabelledTextBox difficultyTextBox = null!;
private LabelledTextBox sourceTextBox; private LabelledTextBox sourceTextBox = null!;
private LabelledTextBox tagsTextBox; private LabelledTextBox tagsTextBox = null!;
public override LocalisableString Title => EditorSetupStrings.MetadataHeader; public override LocalisableString Title => EditorSetupStrings.MetadataHeader;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Localisation; using osu.Game.Localisation;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -18,12 +16,12 @@ namespace osu.Game.Screens.Edit.Setup
{ {
internal partial class SetupScreenHeader : OverlayHeader internal partial class SetupScreenHeader : OverlayHeader
{ {
public SetupScreenHeaderBackground Background { get; private set; } public SetupScreenHeaderBackground Background { get; private set; } = null!;
[Resolved] [Resolved]
private SectionsContainer<SetupSection> sections { get; set; } private SectionsContainer<SetupSection> sections { get; set; } = null!;
private SetupScreenTabControl tabControl; private SetupScreenTabControl tabControl = null!;
protected override OverlayTitle CreateTitle() => new SetupScreenTitle(); protected override OverlayTitle CreateTitle() => new SetupScreenTitle();

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -18,10 +16,10 @@ namespace osu.Game.Screens.Edit.Setup
public partial class SetupScreenHeaderBackground : CompositeDrawable public partial class SetupScreenHeaderBackground : CompositeDrawable
{ {
[Resolved] [Resolved]
private OsuColour colours { get; set; } private OsuColour colours { get; set; } = null!;
[Resolved] [Resolved]
private IBindable<WorkingBeatmap> working { get; set; } private IBindable<WorkingBeatmap> working { get; set; } = null!;
private readonly Container content; private readonly Container content;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -16,7 +14,7 @@ namespace osu.Game.Screens.Edit.Setup
{ {
public abstract partial class SetupSection : Container public abstract partial class SetupSection : Container
{ {
private FillFlowContainer flow; private FillFlowContainer flow = null!;
/// <summary> /// <summary>
/// Used to align some of the child <see cref="LabelledDrawable{T}"/>s together to achieve a grid-like look. /// Used to align some of the child <see cref="LabelledDrawable{T}"/>s together to achieve a grid-like look.
@ -24,10 +22,10 @@ namespace osu.Game.Screens.Edit.Setup
protected const float LABEL_WIDTH = 160; protected const float LABEL_WIDTH = 160;
[Resolved] [Resolved]
protected OsuColour Colours { get; private set; } protected OsuColour Colours { get; private set; } = null!;
[Resolved] [Resolved]
protected EditorBeatmap Beatmap { get; private set; } protected EditorBeatmap Beatmap { get; private set; } = null!;
protected override Container<Drawable> Content => flow; protected override Container<Drawable> Content => flow;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics; using osu.Framework.Graphics;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -15,10 +13,10 @@ namespace osu.Game.Screens.Edit.Timing
{ {
internal partial class EffectSection : Section<EffectControlPoint> internal partial class EffectSection : Section<EffectControlPoint>
{ {
private LabelledSwitchButton kiai; private LabelledSwitchButton kiai = null!;
private LabelledSwitchButton omitBarLine; private LabelledSwitchButton omitBarLine = null!;
private SliderWithTextBoxInput<double> scrollSpeedSlider; private SliderWithTextBoxInput<double> scrollSpeedSlider = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -55,7 +53,7 @@ namespace osu.Game.Screens.Edit.Timing
private bool isRebinding; private bool isRebinding;
protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint> point) protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint?> point)
{ {
if (point.NewValue != null) if (point.NewValue != null)
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -17,21 +15,21 @@ namespace osu.Game.Screens.Edit.Timing
{ {
internal partial class GroupSection : CompositeDrawable internal partial class GroupSection : CompositeDrawable
{ {
private LabelledTextBox textBox; private LabelledTextBox textBox = null!;
private OsuButton button; private OsuButton button = null!;
[Resolved] [Resolved]
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } = null!;
[Resolved] [Resolved]
protected EditorBeatmap Beatmap { get; private set; } protected EditorBeatmap Beatmap { get; private set; } = null!;
[Resolved] [Resolved]
private EditorClock clock { get; set; } private EditorClock clock { get; set; } = null!;
[Resolved(canBeNull: true)] [Resolved]
private IEditorChangeHandler changeHandler { get; set; } private IEditorChangeHandler? changeHandler { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Globalization; using System.Globalization;
using osu.Framework.Bindables; using osu.Framework.Bindables;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -35,7 +33,7 @@ namespace osu.Game.Screens.Edit.Timing
set => current.Current = value; set => current.Current = value;
} }
private OsuNumberBox numeratorBox; private OsuNumberBox numeratorBox = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -1,10 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
@ -28,24 +25,23 @@ namespace osu.Game.Screens.Edit.Timing
{ {
public partial class MetronomeDisplay : BeatSyncedContainer public partial class MetronomeDisplay : BeatSyncedContainer
{ {
private Container swing; private Container swing = null!;
private OsuSpriteText bpmText; private OsuSpriteText bpmText = null!;
private Drawable weight; private Drawable weight = null!;
private Drawable stick; private Drawable stick = null!;
private IAdjustableClock metronomeClock; private IAdjustableClock metronomeClock = null!;
private Sample sampleTick; private Sample? sampleTick;
private Sample sampleTickDownbeat; private Sample? sampleTickDownbeat;
private Sample sampleLatch; private Sample? sampleLatch;
[CanBeNull] private ScheduledDelegate? tickPlaybackDelegate;
private ScheduledDelegate tickPlaybackDelegate;
[Resolved] [Resolved]
private OverlayColourProvider overlayColourProvider { get; set; } private OverlayColourProvider overlayColourProvider { get; set; } = null!;
public bool EnableClicking { get; set; } = true; public bool EnableClicking { get; set; } = true;
@ -225,13 +221,13 @@ namespace osu.Game.Screens.Edit.Timing
private double beatLength; private double beatLength;
private TimingControlPoint timingPoint; private TimingControlPoint timingPoint = null!;
private bool isSwinging; private bool isSwinging;
private readonly BindableInt interpolatedBpm = new BindableInt(); private readonly BindableInt interpolatedBpm = new BindableInt();
private ScheduledDelegate latchDelegate; private ScheduledDelegate? latchDelegate;
protected override void LoadComplete() protected override void LoadComplete()
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
@ -23,10 +21,10 @@ namespace osu.Game.Screens.Edit.Timing
private readonly Drawable button; private readonly Drawable button;
private Sample sample; private Sample? sample;
public Action RepeatBegan; public Action? RepeatBegan;
public Action RepeatEnded; public Action? RepeatEnded;
/// <summary> /// <summary>
/// An additive modifier for the frequency of the sample played on next actuation. /// An additive modifier for the frequency of the sample played on next actuation.
@ -61,7 +59,7 @@ namespace osu.Game.Screens.Edit.Timing
base.OnMouseUp(e); base.OnMouseUp(e);
} }
private ScheduledDelegate adjustDelegate; private ScheduledDelegate? adjustDelegate;
private double adjustDelay = initial_delay; private double adjustDelay = initial_delay;
private void beginRepeat() private void beginRepeat()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -21,9 +19,9 @@ namespace osu.Game.Screens.Edit.Timing
private readonly string label; private readonly string label;
protected Drawable Background { get; private set; } protected Drawable Background { get; private set; } = null!;
protected FillFlowContainer Content { get; private set; } protected FillFlowContainer Content { get; private set; } = null!;
public RowAttribute(ControlPoint point, string label) public RowAttribute(ControlPoint point, string label)
{ {

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -15,7 +13,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{ {
private readonly BindableNumber<double> speedMultiplier; private readonly BindableNumber<double> speedMultiplier;
private OsuSpriteText text; private OsuSpriteText text = null!;
public DifficultyRowAttribute(DifficultyControlPoint difficulty) public DifficultyRowAttribute(DifficultyControlPoint difficulty)
: base(difficulty, "difficulty") : base(difficulty, "difficulty")

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -16,9 +14,9 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
private readonly Bindable<bool> omitBarLine; private readonly Bindable<bool> omitBarLine;
private readonly BindableNumber<double> scrollSpeed; private readonly BindableNumber<double> scrollSpeed;
private AttributeText kiaiModeBubble; private AttributeText kiaiModeBubble = null!;
private AttributeText omitBarLineBubble; private AttributeText omitBarLineBubble = null!;
private AttributeText text; private AttributeText text = null!;
public EffectRowAttribute(EffectControlPoint effect) public EffectRowAttribute(EffectControlPoint effect)
: base(effect, "effect") : base(effect, "effect")

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -13,8 +11,8 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{ {
public partial class SampleRowAttribute : RowAttribute public partial class SampleRowAttribute : RowAttribute
{ {
private AttributeText sampleText; private AttributeText sampleText = null!;
private OsuSpriteText volumeText; private OsuSpriteText volumeText = null!;
private readonly Bindable<string> sampleBank; private readonly Bindable<string> sampleBank;
private readonly BindableNumber<int> volume; private readonly BindableNumber<int> volume;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions; using osu.Framework.Extensions;
@ -17,7 +15,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes
{ {
private readonly BindableNumber<double> beatLength; private readonly BindableNumber<double> beatLength;
private readonly Bindable<TimeSignature> timeSignature; private readonly Bindable<TimeSignature> timeSignature;
private OsuSpriteText text; private OsuSpriteText text = null!;
public TimingRowAttribute(TimingControlPoint timing) public TimingRowAttribute(TimingControlPoint timing)
: base(timing, "timing") : base(timing, "timing")

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -19,23 +17,23 @@ namespace osu.Game.Screens.Edit.Timing
internal abstract partial class Section<T> : CompositeDrawable internal abstract partial class Section<T> : CompositeDrawable
where T : ControlPoint where T : ControlPoint
{ {
private OsuCheckbox checkbox; private OsuCheckbox checkbox = null!;
private Container content; private Container content = null!;
protected FillFlowContainer Flow { get; private set; } protected FillFlowContainer Flow { get; private set; } = null!;
protected Bindable<T> ControlPoint { get; } = new Bindable<T>(); protected Bindable<T?> ControlPoint { get; } = new Bindable<T?>();
private const float header_height = 50; private const float header_height = 50;
[Resolved] [Resolved]
protected EditorBeatmap Beatmap { get; private set; } protected EditorBeatmap Beatmap { get; private set; } = null!;
[Resolved] [Resolved]
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } protected Bindable<ControlPointGroup> SelectedGroup { get; private set; } = null!;
[Resolved(canBeNull: true)] [Resolved]
protected IEditorChangeHandler ChangeHandler { get; private set; } protected IEditorChangeHandler? ChangeHandler { get; private set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colours) private void load(OverlayColourProvider colours)
@ -128,7 +126,7 @@ namespace osu.Game.Screens.Edit.Timing
ControlPoint.BindValueChanged(OnControlPointChanged, true); ControlPoint.BindValueChanged(OnControlPointChanged, true);
} }
protected abstract void OnControlPointChanged(ValueChangedEvent<T> point); protected abstract void OnControlPointChanged(ValueChangedEvent<T?> point);
protected abstract T CreatePoint(); protected abstract T CreatePoint();
} }

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Globalization; using System.Globalization;
using osu.Framework.Bindables; using osu.Framework.Bindables;

View File

@ -37,10 +37,10 @@ namespace osu.Game.Screens.Edit.Timing
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!; private OverlayColourProvider colourProvider { get; set; } = null!;
[Resolved(canBeNull: true)] [Resolved]
private Bindable<ControlPointGroup>? selectedGroup { get; set; } private Bindable<ControlPointGroup>? selectedGroup { get; set; }
[Resolved(canBeNull: true)] [Resolved]
private IBeatSyncProvider? beatSyncSource { get; set; } private IBeatSyncProvider? beatSyncSource { get; set; }
private Circle hoverLayer = null!; private Circle hoverLayer = null!;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -22,7 +20,7 @@ namespace osu.Game.Screens.Edit.Timing
/// </summary> /// </summary>
public partial class TimingAdjustButton : CompositeDrawable public partial class TimingAdjustButton : CompositeDrawable
{ {
public Action<double> Action; public Action<double>? Action;
private readonly double adjustAmount; private readonly double adjustAmount;
@ -44,10 +42,10 @@ namespace osu.Game.Screens.Edit.Timing
private readonly RepeatingButtonBehaviour repeatBehaviour; private readonly RepeatingButtonBehaviour repeatBehaviour;
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } private OverlayColourProvider colourProvider { get; set; } = null!;
[Resolved] [Resolved]
private EditorBeatmap editorBeatmap { get; set; } private EditorBeatmap editorBeatmap { get; set; } = null!;
public TimingAdjustButton(double adjustAmount) public TimingAdjustButton(double adjustAmount)
{ {
@ -104,7 +102,7 @@ namespace osu.Game.Screens.Edit.Timing
if (hoveredBox == null) if (hoveredBox == null)
return false; return false;
Action(adjustAmount * hoveredBox.Multiplier); Action?.Invoke(adjustAmount * hoveredBox.Multiplier);
hoveredBox.Flash(); hoveredBox.Flash();
@ -119,6 +117,9 @@ namespace osu.Game.Screens.Edit.Timing
private readonly Box box; private readonly Box box;
private readonly OsuSpriteText text; private readonly OsuSpriteText text;
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
public IncrementBox(int index, double amount) public IncrementBox(int index, double amount)
{ {
Multiplier = Math.Sign(index) * convertMultiplier(index); Multiplier = Math.Sign(index) * convertMultiplier(index);
@ -156,9 +157,6 @@ namespace osu.Game.Screens.Edit.Timing
}; };
} }
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -13,8 +11,8 @@ namespace osu.Game.Screens.Edit.Timing
{ {
internal partial class TimingSection : Section<TimingControlPoint> internal partial class TimingSection : Section<TimingControlPoint>
{ {
private LabelledTimeSignature timeSignature; private LabelledTimeSignature timeSignature = null!;
private BPMTextBox bpmTextEntry; private BPMTextBox bpmTextEntry = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -45,7 +43,7 @@ namespace osu.Game.Screens.Edit.Timing
private bool isRebinding; private bool isRebinding;
protected override void OnControlPointChanged(ValueChangedEvent<TimingControlPoint> point) protected override void OnControlPointChanged(ValueChangedEvent<TimingControlPoint?> point)
{ {
if (point.NewValue != null) if (point.NewValue != null)
{ {

View File

@ -20,6 +20,7 @@ using osu.Game.Audio;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Localisation;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
@ -201,7 +202,7 @@ namespace osu.Game.Screens.Menu
{ {
notifications.Post(new SimpleErrorNotification notifications.Post(new SimpleErrorNotification
{ {
Text = "osu! doesn't seem to be able to play audio correctly.\n\nPlease try changing your audio device to a working setting." Text = NotificationsStrings.AudioPlaybackIssue
}); });
} }
}, 5000); }, 5000);

View File

@ -24,6 +24,7 @@ using osu.Game.Screens.Play.HUD;
using osu.Game.Screens.Play.HUD.ClicksPerSecond; using osu.Game.Screens.Play.HUD.ClicksPerSecond;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK; using osuTK;
using osu.Game.Localisation;
namespace osu.Game.Screens.Play namespace osu.Game.Screens.Play
{ {
@ -172,7 +173,7 @@ namespace osu.Game.Screens.Play
notificationOverlay?.Post(new SimpleNotification notificationOverlay?.Post(new SimpleNotification
{ {
Text = $"The score overlay is currently disabled. You can toggle this by pressing {config.LookupKeyBindings(GlobalAction.ToggleInGameInterface)}." Text = NotificationsStrings.ScoreOverlayDisabled(config.LookupKeyBindings(GlobalAction.ToggleInGameInterface))
}); });
} }

View File

@ -20,6 +20,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Input; using osu.Game.Input;
using osu.Game.Localisation;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
@ -130,16 +131,16 @@ namespace osu.Game.Screens.Play
private bool quickRestart; private bool quickRestart;
[Resolved(CanBeNull = true)] [Resolved]
private INotificationOverlay? notificationOverlay { get; set; } private INotificationOverlay? notificationOverlay { get; set; }
[Resolved(CanBeNull = true)] [Resolved]
private VolumeOverlay? volumeOverlay { get; set; } private VolumeOverlay? volumeOverlay { get; set; }
[Resolved] [Resolved]
private AudioManager audioManager { get; set; } = null!; private AudioManager audioManager { get; set; } = null!;
[Resolved(CanBeNull = true)] [Resolved]
private BatteryInfo? batteryInfo { get; set; } private BatteryInfo? batteryInfo { get; set; }
public PlayerLoader(Func<Player> createPlayer) public PlayerLoader(Func<Player> createPlayer)
@ -550,7 +551,7 @@ namespace osu.Game.Screens.Play
public MutedNotification() public MutedNotification()
{ {
Text = "Your game volume is too low to hear anything! Click here to restore it."; Text = NotificationsStrings.GameVolumeTooLow;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -605,7 +606,7 @@ namespace osu.Game.Screens.Play
public BatteryWarningNotification() public BatteryWarningNotification()
{ {
Text = "Your battery level is low! Charge your device to prevent interruptions during gameplay."; Text = NotificationsStrings.BatteryLow;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Localisation;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
@ -24,7 +25,7 @@ namespace osu.Game.Screens.Select
{ {
private OsuScreen? playerLoader; private OsuScreen? playerLoader;
[Resolved(CanBeNull = true)] [Resolved]
private INotificationOverlay? notifications { get; set; } private INotificationOverlay? notifications { get; set; }
public override bool AllowExternalScreenChange => true; public override bool AllowExternalScreenChange => true;
@ -89,7 +90,7 @@ namespace osu.Game.Screens.Select
{ {
notifications?.Post(new SimpleNotification notifications?.Post(new SimpleNotification
{ {
Text = "The current ruleset doesn't have an autoplay mod avalaible!" Text = NotificationsStrings.NoAutoplayMod
}); });
return false; return false;
} }

View File

@ -0,0 +1,26 @@
// 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.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osuTK;
namespace osu.Game.Users.Drawables
{
public partial class StatusIcon : CircularContainer
{
public StatusIcon()
{
Size = new Vector2(25);
BorderThickness = 4;
BorderColour = Colour4.White; // the colour is being applied through Colour - since it's multiplicative it applies to the border as well
Masking = true;
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Colour4.White.Opacity(0)
};
}
}
}

View File

@ -10,7 +10,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.Sprites;
using osu.Game.Users.Drawables; using osu.Game.Users.Drawables;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
@ -25,7 +24,7 @@ namespace osu.Game.Users
protected TextFlowContainer LastVisitMessage { get; private set; } protected TextFlowContainer LastVisitMessage { get; private set; }
private SpriteIcon statusIcon; private StatusIcon statusIcon;
private OsuSpriteText statusMessage; private OsuSpriteText statusMessage;
protected ExtendedUserPanel(APIUser user) protected ExtendedUserPanel(APIUser user)
@ -59,11 +58,7 @@ namespace osu.Game.Users
Action = Action, Action = Action,
}; };
protected SpriteIcon CreateStatusIcon() => statusIcon = new SpriteIcon protected Container CreateStatusIcon() => statusIcon = new StatusIcon();
{
Icon = FontAwesome.Regular.Circle,
Size = new Vector2(25)
};
protected FillFlowContainer CreateStatusMessage(bool rightAlignedChildren) protected FillFlowContainer CreateStatusMessage(bool rightAlignedChildren)
{ {