1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Merge branch 'master' into remove-score-multiplier-on-custom-mod-settings

This commit is contained in:
Salman Ahmed 2022-07-20 08:57:43 +03:00 committed by GitHub
commit 6ce6f6f7df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 191 additions and 279 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.716.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.716.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.719.1" /> <PackageReference Include="ppy.osu.Framework.Android" Version="2022.720.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Transitive Dependencies"> <ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. --> <!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -16,6 +16,7 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components; using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components; using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
using osuTK; using osuTK;
using osuTK.Input; using osuTK.Input;
@ -24,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
{ {
public class SliderPlacementBlueprint : PlacementBlueprint public class SliderPlacementBlueprint : PlacementBlueprint
{ {
public new Objects.Slider HitObject => (Objects.Slider)base.HitObject; public new Slider HitObject => (Slider)base.HitObject;
private SliderBodyPiece bodyPiece; private SliderBodyPiece bodyPiece;
private HitCirclePiece headCirclePiece; private HitCirclePiece headCirclePiece;
@ -42,7 +43,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
private IDistanceSnapProvider snapProvider { get; set; } private IDistanceSnapProvider snapProvider { get; set; }
public SliderPlacementBlueprint() public SliderPlacementBlueprint()
: base(new Objects.Slider()) : base(new Slider())
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
@ -82,7 +83,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
case SliderPlacementState.Initial: case SliderPlacementState.Initial:
BeginPlacement(); BeginPlacement();
var nearestDifficultyPoint = editorBeatmap.HitObjects.LastOrDefault(h => h.GetEndTime() < HitObject.StartTime)?.DifficultyControlPoint?.DeepClone() as DifficultyControlPoint; var nearestDifficultyPoint = editorBeatmap.HitObjects
.LastOrDefault(h => h is Slider && h.GetEndTime() < HitObject.StartTime)?
.DifficultyControlPoint?.DeepClone() as DifficultyControlPoint;
HitObject.DifficultyControlPoint = nearestDifficultyPoint ?? new DifficultyControlPoint(); HitObject.DifficultyControlPoint = nearestDifficultyPoint ?? new DifficultyControlPoint();
HitObject.Position = ToLocalSpace(result.ScreenSpacePosition); HitObject.Position = ToLocalSpace(result.ScreenSpacePosition);

View File

@ -1,10 +1,12 @@
// 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.
using System.Diagnostics;
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.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables;
using osuTK.Graphics; using osuTK.Graphics;
@ -32,19 +34,35 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking) protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
{ {
const float scale_duration = 300f; Debug.Assert(ParentObject != null);
const float fade_duration = 300f;
this.ScaleTo(tracking.NewValue ? DrawableSliderBall.FOLLOW_AREA : 1f, scale_duration, Easing.OutQuint) const float duration = 300f;
.FadeTo(tracking.NewValue ? 1f : 0, fade_duration, Easing.OutQuint);
if (ParentObject.Judged)
return;
if (tracking.NewValue)
{
if (Precision.AlmostEquals(0, Alpha))
this.ScaleTo(1);
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA, duration, Easing.OutQuint)
.FadeTo(1f, duration, Easing.OutQuint);
}
else
{
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.2f, duration / 2, Easing.OutQuint)
.FadeTo(0, duration / 2, Easing.OutQuint);
}
} }
protected override void OnSliderEnd() protected override void OnSliderEnd()
{ {
const float fade_duration = 450f; const float fade_duration = 300;
// intentionally pile on an extra FadeOut to make it happen much faster // intentionally pile on an extra FadeOut to make it happen much faster
this.FadeOut(fade_duration / 4, Easing.Out); this.ScaleTo(1, fade_duration, Easing.OutQuint);
this.FadeOut(fade_duration / 2, Easing.OutQuint);
} }
} }
} }

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 NUnit.Framework; using NUnit.Framework;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -17,7 +15,7 @@ namespace osu.Game.Tests.Mods
[TestFixture] [TestFixture]
public class ModDifficultyAdjustTest public class ModDifficultyAdjustTest
{ {
private TestModDifficultyAdjust testMod; private TestModDifficultyAdjust testMod = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()
@ -148,7 +146,7 @@ namespace osu.Game.Tests.Mods
yield return new TestModDifficultyAdjust(); yield return new TestModDifficultyAdjust();
} }
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null)
{ {
throw new System.NotImplementedException(); throw new System.NotImplementedException();
} }

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 NUnit.Framework; using NUnit.Framework;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;

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 NUnit.Framework; using NUnit.Framework;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;

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 Moq; using Moq;
@ -164,19 +162,19 @@ namespace osu.Game.Tests.Mods
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new InvalidMultiplayerMod() }, new Mod[] { new OsuModHidden(), new InvalidMultiplayerMod() },
null Array.Empty<Type>()
}, },
// invalid free mod is valid for local. // invalid free mod is valid for local.
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new InvalidMultiplayerFreeMod() }, new Mod[] { new OsuModHidden(), new InvalidMultiplayerFreeMod() },
null Array.Empty<Type>()
}, },
// valid pair. // valid pair.
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new OsuModHardRock() }, new Mod[] { new OsuModHidden(), new OsuModHardRock() },
null Array.Empty<Type>()
}, },
}; };
@ -216,13 +214,13 @@ namespace osu.Game.Tests.Mods
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new InvalidMultiplayerFreeMod() }, new Mod[] { new OsuModHidden(), new InvalidMultiplayerFreeMod() },
null Array.Empty<Type>()
}, },
// valid pair. // valid pair.
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new OsuModHardRock() }, new Mod[] { new OsuModHidden(), new OsuModHardRock() },
null Array.Empty<Type>()
}, },
}; };
@ -256,19 +254,19 @@ namespace osu.Game.Tests.Mods
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new OsuModApproachDifferent() }, new Mod[] { new OsuModHidden(), new OsuModApproachDifferent() },
null, Array.Empty<Type>(),
}, },
// incompatible pair with derived class is valid for free mods. // incompatible pair with derived class is valid for free mods.
new object[] new object[]
{ {
new Mod[] { new OsuModDeflate(), new OsuModSpinIn() }, new Mod[] { new OsuModDeflate(), new OsuModSpinIn() },
null, Array.Empty<Type>(),
}, },
// valid pair. // valid pair.
new object[] new object[]
{ {
new Mod[] { new OsuModHidden(), new OsuModHardRock() }, new Mod[] { new OsuModHidden(), new OsuModHardRock() },
null Array.Empty<Type>()
}, },
}; };
@ -277,12 +275,12 @@ namespace osu.Game.Tests.Mods
{ {
bool isValid = ModUtils.CheckValidForGameplay(inputMods, out var invalid); bool isValid = ModUtils.CheckValidForGameplay(inputMods, out var invalid);
Assert.That(isValid, Is.EqualTo(expectedInvalid == null)); Assert.That(isValid, Is.EqualTo(expectedInvalid.Length == 0));
if (isValid) if (isValid)
Assert.IsNull(invalid); Assert.IsNull(invalid);
else else
Assert.That(invalid.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid)); Assert.That(invalid?.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid));
} }
[TestCaseSource(nameof(invalid_multiplayer_mod_test_scenarios))] [TestCaseSource(nameof(invalid_multiplayer_mod_test_scenarios))]
@ -290,12 +288,12 @@ namespace osu.Game.Tests.Mods
{ {
bool isValid = ModUtils.CheckValidRequiredModsForMultiplayer(inputMods, out var invalid); bool isValid = ModUtils.CheckValidRequiredModsForMultiplayer(inputMods, out var invalid);
Assert.That(isValid, Is.EqualTo(expectedInvalid == null)); Assert.That(isValid, Is.EqualTo(expectedInvalid.Length == 0));
if (isValid) if (isValid)
Assert.IsNull(invalid); Assert.IsNull(invalid);
else else
Assert.That(invalid.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid)); Assert.That(invalid?.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid));
} }
[TestCaseSource(nameof(invalid_free_mod_test_scenarios))] [TestCaseSource(nameof(invalid_free_mod_test_scenarios))]
@ -303,12 +301,12 @@ namespace osu.Game.Tests.Mods
{ {
bool isValid = ModUtils.CheckValidFreeModsForMultiplayer(inputMods, out var invalid); bool isValid = ModUtils.CheckValidFreeModsForMultiplayer(inputMods, out var invalid);
Assert.That(isValid, Is.EqualTo(expectedInvalid == null)); Assert.That(isValid, Is.EqualTo(expectedInvalid.Length == 0));
if (isValid) if (isValid)
Assert.IsNull(invalid); Assert.IsNull(invalid);
else else
Assert.That(invalid.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid)); Assert.That(invalid?.Select(t => t.GetType()), Is.EquivalentTo(expectedInvalid));
} }
public abstract class CustomMod1 : Mod, IModCompatibilitySpecification public abstract class CustomMod1 : Mod, IModCompatibilitySpecification

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.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -29,10 +27,10 @@ namespace osu.Game.Tests.Mods
[TestCase(typeof(ManiaRuleset))] [TestCase(typeof(ManiaRuleset))]
public void TestAllMultiModsFromRulesetAreIncompatible(Type rulesetType) public void TestAllMultiModsFromRulesetAreIncompatible(Type rulesetType)
{ {
var ruleset = (Ruleset)Activator.CreateInstance(rulesetType); var ruleset = Activator.CreateInstance(rulesetType) as Ruleset;
Assert.That(ruleset, Is.Not.Null); Assert.That(ruleset, Is.Not.Null);
var allMultiMods = getMultiMods(ruleset); var allMultiMods = getMultiMods(ruleset!);
Assert.Multiple(() => Assert.Multiple(() =>
{ {

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 NUnit.Framework; using NUnit.Framework;
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 System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -33,7 +31,7 @@ namespace osu.Game.Tests.Mods
return Array.Empty<Mod>(); return Array.Empty<Mod>();
} }
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => throw new NotImplementedException(); public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => throw new NotImplementedException();
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => throw new NotImplementedException(); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => throw new NotImplementedException();

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 NUnit.Framework; using NUnit.Framework;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using osu.Framework.Timing; using osu.Framework.Timing;
@ -19,8 +17,8 @@ namespace osu.Game.Tests.Rulesets.Mods
private const double start_time = 1000; private const double start_time = 1000;
private const double duration = 9000; private const double duration = 9000;
private TrackVirtual track; private TrackVirtual track = null!;
private OsuPlayfield playfield; private OsuPlayfield playfield = null!;
[SetUp] [SetUp]
public void SetUp() public void SetUp()

View File

@ -402,16 +402,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Test] [Test]
public void TestPlayStartsWithCorrectBeatmapWhileAtSongSelect() public void TestPlayStartsWithCorrectBeatmapWhileAtSongSelect()
{ {
createRoom(() => new Room PlaylistItem? item = null;
createRoom(() =>
{ {
Name = { Value = "Test Room" }, item = new PlaylistItem(beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo)
Playlist =
{ {
new PlaylistItem(beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo) RulesetID = new OsuRuleset().RulesetInfo.OnlineID
{ };
RulesetID = new OsuRuleset().RulesetInfo.OnlineID return new Room
} {
} Name = { Value = "Test Room" },
Playlist = { item }
};
}); });
pressReadyButton(); pressReadyButton();
@ -419,7 +421,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("Enter song select", () => AddStep("Enter song select", () =>
{ {
var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerComponents.CurrentScreen).CurrentSubScreen; var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerComponents.CurrentScreen).CurrentSubScreen;
((MultiplayerMatchSubScreen)currentSubScreen).OpenSongSelection(multiplayerClient.ClientRoom?.Settings.PlaylistItemId); ((MultiplayerMatchSubScreen)currentSubScreen).OpenSongSelection(item);
}); });
AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.BeatmapSetsLoaded == true); AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.BeatmapSetsLoaded == true);
@ -440,16 +442,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Test] [Test]
public void TestPlayStartsWithCorrectRulesetWhileAtSongSelect() public void TestPlayStartsWithCorrectRulesetWhileAtSongSelect()
{ {
createRoom(() => new Room PlaylistItem? item = null;
createRoom(() =>
{ {
Name = { Value = "Test Room" }, item = new PlaylistItem(beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo)
Playlist =
{ {
new PlaylistItem(beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo) RulesetID = new OsuRuleset().RulesetInfo.OnlineID
{ };
RulesetID = new OsuRuleset().RulesetInfo.OnlineID return new Room
} {
} Name = { Value = "Test Room" },
Playlist = { item }
};
}); });
pressReadyButton(); pressReadyButton();
@ -457,7 +461,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("Enter song select", () => AddStep("Enter song select", () =>
{ {
var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerComponents.CurrentScreen).CurrentSubScreen; var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerComponents.CurrentScreen).CurrentSubScreen;
((MultiplayerMatchSubScreen)currentSubScreen).OpenSongSelection(multiplayerClient.ClientRoom?.Settings.PlaylistItemId); ((MultiplayerMatchSubScreen)currentSubScreen).OpenSongSelection(item);
}); });
AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.BeatmapSetsLoaded == true); AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.BeatmapSetsLoaded == true);
@ -478,16 +482,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Test] [Test]
public void TestPlayStartsWithCorrectModsWhileAtSongSelect() public void TestPlayStartsWithCorrectModsWhileAtSongSelect()
{ {
createRoom(() => new Room PlaylistItem? item = null;
createRoom(() =>
{ {
Name = { Value = "Test Room" }, item = new PlaylistItem(beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo)
Playlist =
{ {
new PlaylistItem(beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo) RulesetID = new OsuRuleset().RulesetInfo.OnlineID
{ };
RulesetID = new OsuRuleset().RulesetInfo.OnlineID return new Room
} {
} Name = { Value = "Test Room" },
Playlist = { item }
};
}); });
pressReadyButton(); pressReadyButton();
@ -495,7 +501,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("Enter song select", () => AddStep("Enter song select", () =>
{ {
var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerComponents.CurrentScreen).CurrentSubScreen; var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerComponents.CurrentScreen).CurrentSubScreen;
((MultiplayerMatchSubScreen)currentSubScreen).OpenSongSelection(multiplayerClient.ClientRoom?.Settings.PlaylistItemId); ((MultiplayerMatchSubScreen)currentSubScreen).OpenSongSelection(item);
}); });
AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.BeatmapSetsLoaded == true); AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.BeatmapSetsLoaded == true);

View File

@ -255,18 +255,25 @@ namespace osu.Game.Tests.Visual.Online
}; };
const int initial_great_count = 2000; const int initial_great_count = 2000;
const int initial_tick_count = 100;
int greatCount = initial_great_count; int greatCount = initial_great_count;
int tickCount = initial_tick_count;
foreach (var s in scores.Scores) foreach (var s in scores.Scores)
{ {
s.Statistics = new Dictionary<HitResult, int> s.Statistics = new Dictionary<HitResult, int>
{ {
{ HitResult.Great, greatCount -= 100 }, { HitResult.Great, greatCount },
{ HitResult.LargeTickHit, tickCount },
{ HitResult.Ok, RNG.Next(100) }, { HitResult.Ok, RNG.Next(100) },
{ HitResult.Meh, RNG.Next(100) }, { HitResult.Meh, RNG.Next(100) },
{ HitResult.Miss, initial_great_count - greatCount } { HitResult.Miss, initial_great_count - greatCount },
{ HitResult.LargeTickMiss, initial_tick_count - tickCount },
}; };
greatCount -= 100;
tickCount -= RNG.Next(1, 5);
} }
return scores; return scores;

View File

@ -14,15 +14,15 @@ namespace osu.Game.Audio
[Serializable] [Serializable]
public class HitSampleInfo : ISampleInfo, IEquatable<HitSampleInfo> public class HitSampleInfo : ISampleInfo, IEquatable<HitSampleInfo>
{ {
public const string HIT_NORMAL = @"hitnormal";
public const string HIT_WHISTLE = @"hitwhistle"; public const string HIT_WHISTLE = @"hitwhistle";
public const string HIT_FINISH = @"hitfinish"; public const string HIT_FINISH = @"hitfinish";
public const string HIT_NORMAL = @"hitnormal";
public const string HIT_CLAP = @"hitclap"; public const string HIT_CLAP = @"hitclap";
/// <summary> /// <summary>
/// All valid sample addition constants. /// All valid sample addition constants.
/// </summary> /// </summary>
public static IEnumerable<string> AllAdditions => new[] { HIT_WHISTLE, HIT_CLAP, HIT_FINISH }; public static IEnumerable<string> AllAdditions => new[] { HIT_WHISTLE, HIT_FINISH, HIT_CLAP };
/// <summary> /// <summary>
/// The name of the sample to load. /// The name of the sample to load.

View File

@ -3,21 +3,21 @@
#nullable disable #nullable disable
using osuTK; using System;
using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
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.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration;
using System;
using JetBrains.Annotations;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Configuration;
using osuTK;
namespace osu.Game.Graphics.Cursor namespace osu.Game.Graphics.Cursor
{ {
@ -35,6 +35,7 @@ namespace osu.Game.Graphics.Cursor
private Vector2 positionMouseDown; private Vector2 positionMouseDown;
private Sample tapSample; private Sample tapSample;
private Vector2 lastMovePosition;
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load([NotNull] OsuConfigManager config, [CanBeNull] ScreenshotManager screenshotManager, AudioManager audio) private void load([NotNull] OsuConfigManager config, [CanBeNull] ScreenshotManager screenshotManager, AudioManager audio)
@ -47,16 +48,25 @@ namespace osu.Game.Graphics.Cursor
tapSample = audio.Samples.Get(@"UI/cursor-tap"); tapSample = audio.Samples.Get(@"UI/cursor-tap");
} }
protected override void Update()
{
base.Update();
if (dragRotationState != DragRotationState.NotDragging
&& Vector2.Distance(positionMouseDown, lastMovePosition) > 60)
{
// make the rotation centre point floating.
positionMouseDown = Interpolation.ValueAt(0.04f, positionMouseDown, lastMovePosition, 0, Clock.ElapsedFrameTime);
}
}
protected override bool OnMouseMove(MouseMoveEvent e) protected override bool OnMouseMove(MouseMoveEvent e)
{ {
if (dragRotationState != DragRotationState.NotDragging) if (dragRotationState != DragRotationState.NotDragging)
{ {
// make the rotation centre point floating. lastMovePosition = e.MousePosition;
if (Vector2.Distance(positionMouseDown, e.MousePosition) > 60)
positionMouseDown = Interpolation.ValueAt(0.005f, positionMouseDown, e.MousePosition, 0, Clock.ElapsedFrameTime);
var position = e.MousePosition; float distance = Vector2Extensions.Distance(lastMovePosition, positionMouseDown);
float distance = Vector2Extensions.Distance(position, positionMouseDown);
// don't start rotating until we're moved a minimum distance away from the mouse down location, // don't start rotating until we're moved a minimum distance away from the mouse down location,
// else it can have an annoying effect. // else it can have an annoying effect.

View File

@ -23,6 +23,7 @@ using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Extensions.LocalisationExtensions;
using osu.Framework.Graphics.Cursor;
using osu.Game.Resources.Localisation.Web; using osu.Game.Resources.Localisation.Web;
namespace osu.Game.Overlays.BeatmapSet.Scores namespace osu.Game.Overlays.BeatmapSet.Scores
@ -38,8 +39,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private readonly FillFlowContainer backgroundFlow; private readonly FillFlowContainer backgroundFlow;
private Color4 highAccuracyColour;
public ScoreTable() public ScoreTable()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
@ -57,12 +56,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
}); });
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
highAccuracyColour = colours.GreenLight;
}
/// <summary> /// <summary>
/// The statistics that appear in the table, in order of appearance. /// The statistics that appear in the table, in order of appearance.
/// </summary> /// </summary>
@ -158,12 +151,10 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Current = scoreManager.GetBindableTotalScoreString(score), Current = scoreManager.GetBindableTotalScoreString(score),
Font = OsuFont.GetFont(size: text_size, weight: index == 0 ? FontWeight.Bold : FontWeight.Medium) Font = OsuFont.GetFont(size: text_size, weight: index == 0 ? FontWeight.Bold : FontWeight.Medium)
}, },
new OsuSpriteText new StatisticText(score.Accuracy, 1, showTooltip: false)
{ {
Margin = new MarginPadding { Right = horizontal_inset }, Margin = new MarginPadding { Right = horizontal_inset },
Text = score.DisplayAccuracy, Text = score.DisplayAccuracy,
Font = OsuFont.GetFont(size: text_size),
Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White
}, },
new UpdateableFlag(score.User.CountryCode) new UpdateableFlag(score.User.CountryCode)
{ {
@ -171,14 +162,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
ShowPlaceholderOnUnknown = false, ShowPlaceholderOnUnknown = false,
}, },
username, username,
new OsuSpriteText
{
Text = score.MaxCombo.ToLocalisableString(@"0\x"),
Font = OsuFont.GetFont(size: text_size),
#pragma warning disable 618 #pragma warning disable 618
Colour = score.MaxCombo == score.BeatmapInfo.MaxCombo ? highAccuracyColour : Color4.White new StatisticText(score.MaxCombo, score.BeatmapInfo.MaxCombo, @"0\x"),
#pragma warning restore 618 #pragma warning restore 618
}
}; };
var availableStatistics = score.GetStatisticsForDisplay().ToDictionary(tuple => tuple.Result); var availableStatistics = score.GetStatisticsForDisplay().ToDictionary(tuple => tuple.Result);
@ -188,23 +174,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
if (!availableStatistics.TryGetValue(result.result, out var stat)) if (!availableStatistics.TryGetValue(result.result, out var stat))
stat = new HitResultDisplayStatistic(result.result, 0, null, result.displayName); stat = new HitResultDisplayStatistic(result.result, 0, null, result.displayName);
content.Add(new OsuSpriteText content.Add(new StatisticText(stat.Count, stat.MaxCount, @"N0") { Colour = stat.Count == 0 ? Color4.Gray : Color4.White });
{
Text = stat.MaxCount == null ? stat.Count.ToLocalisableString(@"N0") : (LocalisableString)$"{stat.Count}/{stat.MaxCount}",
Font = OsuFont.GetFont(size: text_size),
Colour = stat.Count == 0 ? Color4.Gray : Color4.White
});
} }
if (showPerformancePoints) if (showPerformancePoints)
{ {
Debug.Assert(score.PP != null); Debug.Assert(score.PP != null);
content.Add(new StatisticText(score.PP.Value, format: @"N0"));
content.Add(new OsuSpriteText
{
Text = score.PP.ToLocalisableString(@"N0"),
Font = OsuFont.GetFont(size: text_size)
});
} }
content.Add(new ScoreboardTime(score.Date, text_size) content.Add(new ScoreboardTime(score.Date, text_size)
@ -243,5 +219,31 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Colour = colourProvider.Foreground1; Colour = colourProvider.Foreground1;
} }
} }
private class StatisticText : OsuSpriteText, IHasTooltip
{
private readonly double count;
private readonly double? maxCount;
private readonly bool showTooltip;
public LocalisableString TooltipText => maxCount == null || !showTooltip ? string.Empty : $"{count}/{maxCount}";
public StatisticText(double count, double? maxCount = null, string format = null, bool showTooltip = true)
{
this.count = count;
this.maxCount = maxCount;
this.showTooltip = showTooltip;
Text = count.ToLocalisableString(format);
Font = OsuFont.GetFont(size: text_size);
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
if (count == maxCount)
Colour = colours.GreenLight;
}
}
} }
} }

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.Bindables; using osu.Framework.Bindables;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -29,7 +27,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary> /// <summary>
/// A function that can extract the current value of this setting from a beatmap difficulty for display purposes. /// A function that can extract the current value of this setting from a beatmap difficulty for display purposes.
/// </summary> /// </summary>
public Func<IBeatmapDifficultyInfo, float> ReadCurrentFromDifficulty; public Func<IBeatmapDifficultyInfo, float>? ReadCurrentFromDifficulty;
public float Precision public float Precision
{ {

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;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
/// <summary> /// <summary>

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
/// <summary> /// <summary>

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
public interface IApplicableToAudio : IApplicableToTrack, IApplicableToSample public interface IApplicableToAudio : IApplicableToTrack, IApplicableToSample

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;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;

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.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI;

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.Screens.Play; using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.Objects; using osu.Game.Rulesets.Objects;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Screens.Play; using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
/// <summary> /// <summary>

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.Audio; using osu.Framework.Audio;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring; using osu.Game.Scoring;

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.Audio; using osu.Framework.Audio;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Collections.Generic; using System.Collections.Generic;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;

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.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
@ -45,7 +43,7 @@ namespace osu.Game.Rulesets.Mods
/// </summary> /// </summary>
public readonly ModCreatedUser User; public readonly ModCreatedUser User;
public ModReplayData(Replay replay, ModCreatedUser user = null) public ModReplayData(Replay replay, ModCreatedUser? user = null)
{ {
Replay = replay; Replay = replay;
User = user ?? new ModCreatedUser(); User = user ?? new ModCreatedUser();

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.Bindables; using osu.Framework.Bindables;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;

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.Configuration; using osu.Game.Configuration;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Rulesets.UI; using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
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 System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -117,7 +115,7 @@ namespace osu.Game.Rulesets.Mods
[JsonIgnore] [JsonIgnore]
public virtual Type[] IncompatibleMods => Array.Empty<Type>(); public virtual Type[] IncompatibleMods => Array.Empty<Type>();
private IReadOnlyList<IBindable> settingsBacking; private IReadOnlyList<IBindable>? settingsBacking;
/// <summary> /// <summary>
/// A list of the all <see cref="IBindable"/> settings within this mod. /// A list of the all <see cref="IBindable"/> settings within this mod.
@ -221,8 +219,8 @@ namespace osu.Game.Rulesets.Mods
public bool Equals(IBindable x, IBindable y) public bool Equals(IBindable x, IBindable y)
{ {
object xValue = x?.GetUnderlyingSettingValue(); object xValue = x.GetUnderlyingSettingValue();
object yValue = y?.GetUnderlyingSettingValue(); object yValue = y.GetUnderlyingSettingValue();
return EqualityComparer<object>.Default.Equals(xValue, yValue); return EqualityComparer<object>.Default.Equals(xValue, yValue);
} }

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.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -79,7 +77,7 @@ namespace osu.Game.Rulesets.Mods
// Apply a fixed rate change when missing, allowing the player to catch up when the rate is too fast. // Apply a fixed rate change when missing, allowing the player to catch up when the rate is too fast.
private const double rate_change_on_miss = 0.95d; private const double rate_change_on_miss = 0.95d;
private IAdjustableAudioComponent track; private IAdjustableAudioComponent? track;
private double targetRate = 1d; private double targetRate = 1d;
/// <summary> /// <summary>

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.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;

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.Bindables; using osu.Framework.Bindables;
using osu.Framework.Extensions; using osu.Framework.Extensions;

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.Bindables; using osu.Framework.Bindables;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
@ -11,7 +9,7 @@ namespace osu.Game.Rulesets.Mods
{ {
public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
{ {
private Bindable<bool> showHealthBar; private readonly Bindable<bool> showHealthBar = new Bindable<bool>();
/// <summary> /// <summary>
/// We never fail, 'yo. /// We never fail, 'yo.
@ -22,7 +20,7 @@ namespace osu.Game.Rulesets.Mods
public void ReadFromConfig(OsuConfigManager config) public void ReadFromConfig(OsuConfigManager config)
{ {
showHealthBar = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail); config.BindWith(OsuSetting.ShowHealthDisplayWhenCantFail, showHealthBar);
} }
public void ApplyToHUD(HUDOverlay overlay) public void ApplyToHUD(HUDOverlay overlay)

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Audio; using osu.Framework.Audio;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;

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.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.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Game.Configuration;

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;

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 Humanizer; using Humanizer;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -24,7 +22,7 @@ namespace osu.Game.Rulesets.Mods
private int retries; private int retries;
private BindableNumber<double> health; private readonly BindableNumber<double> health = new BindableDouble();
public override void ApplyToDifficulty(BeatmapDifficulty difficulty) public override void ApplyToDifficulty(BeatmapDifficulty difficulty)
{ {
@ -46,7 +44,7 @@ namespace osu.Game.Rulesets.Mods
public void ApplyToHealthProcessor(HealthProcessor healthProcessor) public void ApplyToHealthProcessor(HealthProcessor healthProcessor)
{ {
health = healthProcessor.Health.GetBoundCopy(); health.BindTo(healthProcessor.Health);
} }
} }
} }

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.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;

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.Bindables; using osu.Framework.Bindables;
using osu.Game.Configuration; using osu.Game.Configuration;

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.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -96,13 +94,13 @@ namespace osu.Game.Rulesets.Mods
{ {
public readonly BindableInt Combo = new BindableInt(); public readonly BindableInt Combo = new BindableInt();
private IShader shader; private IShader shader = null!;
protected override DrawNode CreateDrawNode() => new FlashlightDrawNode(this); protected override DrawNode CreateDrawNode() => new FlashlightDrawNode(this);
public override bool RemoveCompletedTransforms => false; public override bool RemoveCompletedTransforms => false;
public List<BreakPeriod> Breaks; public List<BreakPeriod> Breaks = new List<BreakPeriod>();
private readonly float defaultFlashlightSize; private readonly float defaultFlashlightSize;
private readonly float sizeMultiplier; private readonly float sizeMultiplier;
@ -207,7 +205,7 @@ namespace osu.Game.Rulesets.Mods
{ {
protected new Flashlight Source => (Flashlight)base.Source; protected new Flashlight Source => (Flashlight)base.Source;
private IShader shader; private IShader shader = null!;
private Quad screenSpaceDrawQuad; private Quad screenSpaceDrawQuad;
private Vector2 flashlightPosition; private Vector2 flashlightPosition;
private Vector2 flashlightSize; private Vector2 flashlightSize;
@ -255,7 +253,7 @@ namespace osu.Game.Rulesets.Mods
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
base.Dispose(isDisposing); base.Dispose(isDisposing);
quadBatch?.Dispose(); quadBatch.Dispose();
} }
} }
} }

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.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Game.Configuration;

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;

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.Graphics; using osu.Game.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
public abstract class ModMirror : Mod public abstract class ModMirror : Mod

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.Audio; using osu.Framework.Audio;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -35,7 +33,7 @@ namespace osu.Game.Rulesets.Mods
private readonly BindableNumber<double> mainVolumeAdjust = new BindableDouble(0.5); private readonly BindableNumber<double> mainVolumeAdjust = new BindableDouble(0.5);
private readonly BindableNumber<double> metronomeVolumeAdjust = new BindableDouble(0.5); private readonly BindableNumber<double> metronomeVolumeAdjust = new BindableDouble(0.5);
private BindableNumber<int> currentCombo; private readonly BindableNumber<int> currentCombo = new BindableInt();
[SettingSource("Enable metronome", "Add a metronome beat to help you keep track of the rhythm.")] [SettingSource("Enable metronome", "Add a metronome beat to help you keep track of the rhythm.")]
public BindableBool EnableMetronome { get; } = new BindableBool public BindableBool EnableMetronome { get; } = new BindableBool
@ -94,7 +92,7 @@ namespace osu.Game.Rulesets.Mods
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
{ {
currentCombo = scoreProcessor.Combo.GetBoundCopy(); currentCombo.BindTo(scoreProcessor.Combo);
currentCombo.BindValueChanged(combo => currentCombo.BindValueChanged(combo =>
{ {
double dimFactor = MuteComboCount.Value == 0 ? 1 : (double)combo.NewValue / MuteComboCount.Value; double dimFactor = MuteComboCount.Value == 0 ? 1 : (double)combo.NewValue / MuteComboCount.Value;

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.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
@ -57,10 +55,10 @@ namespace osu.Game.Rulesets.Mods
public class NightcoreBeatContainer : BeatSyncedContainer public class NightcoreBeatContainer : BeatSyncedContainer
{ {
private PausableSkinnableSound hatSample; private PausableSkinnableSound? hatSample;
private PausableSkinnableSound clapSample; private PausableSkinnableSound? clapSample;
private PausableSkinnableSound kickSample; private PausableSkinnableSound? kickSample;
private PausableSkinnableSound finishSample; private PausableSkinnableSound? finishSample;
private int? firstBeat; private int? firstBeat;

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods

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.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -30,9 +28,9 @@ namespace osu.Game.Rulesets.Mods
protected const float TRANSITION_DURATION = 100; protected const float TRANSITION_DURATION = 100;
protected BindableNumber<int> CurrentCombo; protected readonly BindableNumber<int> CurrentCombo = new BindableInt();
protected IBindable<bool> IsBreakTime; protected readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
protected float ComboBasedAlpha; protected float ComboBasedAlpha;
@ -42,14 +40,14 @@ namespace osu.Game.Rulesets.Mods
public void ApplyToPlayer(Player player) public void ApplyToPlayer(Player player)
{ {
IsBreakTime = player.IsBreakTime.GetBoundCopy(); IsBreakTime.BindTo(player.IsBreakTime);
} }
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
{ {
if (HiddenComboCount.Value == 0) return; if (HiddenComboCount.Value == 0) return;
CurrentCombo = scoreProcessor.Combo.GetBoundCopy(); CurrentCombo.BindTo(scoreProcessor.Combo);
CurrentCombo.BindValueChanged(combo => CurrentCombo.BindValueChanged(combo =>
{ {
ComboBasedAlpha = Math.Max(MIN_ALPHA, 1 - (float)combo.NewValue / HiddenComboCount.Value); ComboBasedAlpha = Math.Max(MIN_ALPHA, 1 - (float)combo.NewValue / HiddenComboCount.Value);

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.Graphics.Sprites; using osu.Framework.Graphics.Sprites;

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.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Game.Configuration;

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.Audio; using osu.Framework.Audio;
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 System; using System;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.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 System; using System;
using System.Linq; using System.Linq;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;

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.Audio; using osu.Framework.Audio;
@ -46,7 +44,7 @@ namespace osu.Game.Rulesets.Mods
Precision = 0.01, Precision = 0.01,
}; };
private IAdjustableAudioComponent track; private IAdjustableAudioComponent? track;
protected ModTimeRamp() protected ModTimeRamp()
{ {

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
public enum ModType public enum ModType

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.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 System; using System;
using System.Linq; using System.Linq;
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 System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -21,7 +19,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary> /// <summary>
/// The first adjustable object. /// The first adjustable object.
/// </summary> /// </summary>
protected HitObject FirstObject { get; private set; } protected HitObject? FirstObject { get; private set; }
/// <summary> /// <summary>
/// Whether the visibility of <see cref="FirstObject"/> should be increased. /// Whether the visibility of <see cref="FirstObject"/> should be increased.
@ -59,7 +57,7 @@ namespace osu.Game.Rulesets.Mods
{ {
FirstObject = getFirstAdjustableObjectRecursive(beatmap.HitObjects); FirstObject = getFirstAdjustableObjectRecursive(beatmap.HitObjects);
HitObject getFirstAdjustableObjectRecursive(IReadOnlyList<HitObject> hitObjects) HitObject? getFirstAdjustableObjectRecursive(IReadOnlyList<HitObject> hitObjects)
{ {
foreach (var h in hitObjects) foreach (var h in hitObjects)
{ {
@ -93,7 +91,7 @@ namespace osu.Game.Rulesets.Mods
/// <param name="toCheck">The <see cref="HitObject"/> to check.</param> /// <param name="toCheck">The <see cref="HitObject"/> to check.</param>
/// <param name="target">The <see cref="HitObject"/> which may be equal to or contain <paramref name="toCheck"/> as a nested object.</param> /// <param name="target">The <see cref="HitObject"/> which may be equal to or contain <paramref name="toCheck"/> as a nested object.</param>
/// <returns>Whether <paramref name="toCheck"/> is equal to or nested within <paramref name="target"/>.</returns> /// <returns>Whether <paramref name="toCheck"/> is equal to or nested within <paramref name="target"/>.</returns>
private bool isObjectEqualToOrNestedIn(HitObject toCheck, HitObject target) private bool isObjectEqualToOrNestedIn(HitObject toCheck, HitObject? target)
{ {
if (target == null) if (target == null)
return false; return false;

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;

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.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
public class UnknownMod : Mod public class UnknownMod : Mod

View File

@ -49,6 +49,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
[Resolved] [Resolved]
private MultiplayerClient client { get; set; } private MultiplayerClient client { get; set; }
[Resolved]
private BeatmapManager beatmapManager { get; set; }
private readonly IBindable<bool> isConnected = new Bindable<bool>(); private readonly IBindable<bool> isConnected = new Bindable<bool>();
private AddItemButton addItemButton; private AddItemButton addItemButton;
@ -141,7 +144,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
new MultiplayerPlaylist new MultiplayerPlaylist
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
RequestEdit = item => OpenSongSelection(item.ID) RequestEdit = OpenSongSelection
} }
}, },
new[] new[]
@ -219,12 +222,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
/// Opens the song selection screen to add or edit an item. /// Opens the song selection screen to add or edit an item.
/// </summary> /// </summary>
/// <param name="itemToEdit">An optional playlist item to edit. If null, a new item will be added instead.</param> /// <param name="itemToEdit">An optional playlist item to edit. If null, a new item will be added instead.</param>
internal void OpenSongSelection(long? itemToEdit = null) internal void OpenSongSelection(PlaylistItem itemToEdit = null)
{ {
if (!this.IsCurrentScreen()) if (!this.IsCurrentScreen())
return; return;
this.Push(new MultiplayerMatchSongSelect(Room, itemToEdit)); int id = itemToEdit?.Beatmap.OnlineID ?? Room.Playlist.Last().Beatmap.OnlineID;
var localBeatmap = beatmapManager.QueryBeatmap(b => b.OnlineID == id);
var workingBeatmap = localBeatmap == null ? null : beatmapManager.GetWorkingBeatmap(localBeatmap);
this.Push(new MultiplayerMatchSongSelect(Room, itemToEdit?.ID, workingBeatmap));
} }
protected override Drawable CreateFooter() => new MultiplayerMatchFooter(); protected override Drawable CreateFooter() => new MultiplayerMatchFooter();

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Realm" Version="10.14.0" /> <PackageReference Include="Realm" Version="10.14.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.719.1" /> <PackageReference Include="ppy.osu.Framework" Version="2022.720.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.716.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.716.0" />
<PackageReference Include="Sentry" Version="3.19.0" /> <PackageReference Include="Sentry" Version="3.19.0" />
<PackageReference Include="SharpCompress" Version="0.32.1" /> <PackageReference Include="SharpCompress" Version="0.32.1" />

View File

@ -61,7 +61,7 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Package References"> <ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.719.1" /> <PackageReference Include="ppy.osu.Framework.iOS" Version="2022.720.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.716.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.716.0" />
</ItemGroup> </ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) --> <!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
@ -84,7 +84,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.14" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.14" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.719.1" /> <PackageReference Include="ppy.osu.Framework" Version="2022.720.0" />
<PackageReference Include="SharpCompress" Version="0.32.1" /> <PackageReference Include="SharpCompress" Version="0.32.1" />
<PackageReference Include="NUnit" Version="3.13.3" /> <PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />