Merge branch 'master' into date-submitted-ranked

This commit is contained in:
Dan Balasescu 2022-07-20 18:36:57 +09:00 committed by GitHub
commit 2b399ec7ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 235 additions and 330 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.0" /> <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

@ -17,18 +17,18 @@ namespace osu.Game.Rulesets.Osu.Tests
{ {
protected override string ResourceAssembly => "osu.Game.Rulesets.Osu"; protected override string ResourceAssembly => "osu.Game.Rulesets.Osu";
[TestCase(6.6972307565739273d, 206, "diffcalc-test")] [TestCase(6.6369583000323935d, 206, "diffcalc-test")]
[TestCase(1.4484754139145539d, 45, "zero-length-sliders")] [TestCase(1.4476531024675374d, 45, "zero-length-sliders")]
public void Test(double expectedStarRating, int expectedMaxCombo, string name) public void Test(double expectedStarRating, int expectedMaxCombo, string name)
=> base.Test(expectedStarRating, expectedMaxCombo, name); => base.Test(expectedStarRating, expectedMaxCombo, name);
[TestCase(8.9382559208689809d, 206, "diffcalc-test")] [TestCase(8.8816128335486386d, 206, "diffcalc-test")]
[TestCase(1.7548875851757628d, 45, "zero-length-sliders")] [TestCase(1.7540389962596916d, 45, "zero-length-sliders")]
public void TestClockRateAdjusted(double expectedStarRating, int expectedMaxCombo, string name) public void TestClockRateAdjusted(double expectedStarRating, int expectedMaxCombo, string name)
=> Test(expectedStarRating, expectedMaxCombo, name, new OsuModDoubleTime()); => Test(expectedStarRating, expectedMaxCombo, name, new OsuModDoubleTime());
[TestCase(6.6972307218715166d, 239, "diffcalc-test")] [TestCase(6.6369583000323935d, 239, "diffcalc-test")]
[TestCase(1.4484754139145537d, 54, "zero-length-sliders")] [TestCase(1.4476531024675374d, 54, "zero-length-sliders")]
public void TestClassicMod(double expectedStarRating, int expectedMaxCombo, string name) public void TestClassicMod(double expectedStarRating, int expectedMaxCombo, string name)
=> Test(expectedStarRating, expectedMaxCombo, name, new OsuModClassic()); => Test(expectedStarRating, expectedMaxCombo, name, new OsuModClassic());

View File

@ -108,13 +108,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
// Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing. // Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
double overlapVelocityBuff = Math.Min(125 / Math.Min(osuCurrObj.StrainTime, osuLastObj.StrainTime), Math.Abs(prevVelocity - currVelocity)); double overlapVelocityBuff = Math.Min(125 / Math.Min(osuCurrObj.StrainTime, osuLastObj.StrainTime), Math.Abs(prevVelocity - currVelocity));
// Reward for % distance slowed down compared to previous, paying attention to not award overlap velocityChangeBonus = overlapVelocityBuff * distRatio;
double nonOverlapVelocityBuff = Math.Abs(prevVelocity - currVelocity)
// do not award overlap
* Math.Pow(Math.Sin(Math.PI / 2 * Math.Min(1, Math.Min(osuCurrObj.LazyJumpDistance, osuLastObj.LazyJumpDistance) / 100)), 2);
// Choose the largest bonus, multiplied by ratio.
velocityChangeBonus = Math.Max(overlapVelocityBuff, nonOverlapVelocityBuff) * distRatio;
// Penalize for rhythm changes. // Penalize for rhythm changes.
velocityChangeBonus *= Math.Pow(Math.Min(osuCurrObj.StrainTime, osuLastObj.StrainTime) / Math.Max(osuCurrObj.StrainTime, osuLastObj.StrainTime), 2); velocityChangeBonus *= Math.Pow(Math.Min(osuCurrObj.StrainTime, osuLastObj.StrainTime) / Math.Max(osuCurrObj.StrainTime, osuLastObj.StrainTime), 2);

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

@ -35,13 +35,13 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
countMeh = score.Statistics.GetValueOrDefault(HitResult.Meh); countMeh = score.Statistics.GetValueOrDefault(HitResult.Meh);
countMiss = score.Statistics.GetValueOrDefault(HitResult.Miss); countMiss = score.Statistics.GetValueOrDefault(HitResult.Miss);
double multiplier = 1.1; // This is being adjusted to keep the final pp value scaled around what it used to be when changing things double multiplier = 1.12; // This is being adjusted to keep the final pp value scaled around what it used to be when changing things
if (score.Mods.Any(m => m is ModNoFail))
multiplier *= 0.90;
if (score.Mods.Any(m => m is ModHidden)) if (score.Mods.Any(m => m is ModHidden))
multiplier *= 1.10; multiplier *= 1.075;
if (score.Mods.Any(m => m is ModEasy))
multiplier *= 0.975;
double difficultyValue = computeDifficultyValue(score, taikoAttributes); double difficultyValue = computeDifficultyValue(score, taikoAttributes);
double accuracyValue = computeAccuracyValue(score, taikoAttributes); double accuracyValue = computeAccuracyValue(score, taikoAttributes);
@ -61,12 +61,15 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
private double computeDifficultyValue(ScoreInfo score, TaikoDifficultyAttributes attributes) private double computeDifficultyValue(ScoreInfo score, TaikoDifficultyAttributes attributes)
{ {
double difficultyValue = Math.Pow(5 * Math.Max(1.0, attributes.StarRating / 0.175) - 4.0, 2.25) / 450.0; double difficultyValue = Math.Pow(5 * Math.Max(1.0, attributes.StarRating / 0.115) - 4.0, 2.25) / 1150.0;
double lengthBonus = 1 + 0.1 * Math.Min(1.0, totalHits / 1500.0); double lengthBonus = 1 + 0.1 * Math.Min(1.0, totalHits / 1500.0);
difficultyValue *= lengthBonus; difficultyValue *= lengthBonus;
difficultyValue *= Math.Pow(0.985, countMiss); difficultyValue *= Math.Pow(0.986, countMiss);
if (score.Mods.Any(m => m is ModEasy))
difficultyValue *= 0.980;
if (score.Mods.Any(m => m is ModHidden)) if (score.Mods.Any(m => m is ModHidden))
difficultyValue *= 1.025; difficultyValue *= 1.025;
@ -74,7 +77,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
if (score.Mods.Any(m => m is ModFlashlight<TaikoHitObject>)) if (score.Mods.Any(m => m is ModFlashlight<TaikoHitObject>))
difficultyValue *= 1.05 * lengthBonus; difficultyValue *= 1.05 * lengthBonus;
return difficultyValue * score.Accuracy; return difficultyValue * Math.Pow(score.Accuracy, 1.5);
} }
private double computeAccuracyValue(ScoreInfo score, TaikoDifficultyAttributes attributes) private double computeAccuracyValue(ScoreInfo score, TaikoDifficultyAttributes attributes)
@ -82,10 +85,16 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
if (attributes.GreatHitWindow <= 0) if (attributes.GreatHitWindow <= 0)
return 0; return 0;
double accValue = Math.Pow(150.0 / attributes.GreatHitWindow, 1.1) * Math.Pow(score.Accuracy, 15) * 22.0; double accuracyValue = Math.Pow(140.0 / attributes.GreatHitWindow, 1.1) * Math.Pow(score.Accuracy, 12.0) * 27;
// Bonus for many objects - it's harder to keep good accuracy up for longer double lengthBonus = Math.Min(1.15, Math.Pow(totalHits / 1500.0, 0.3));
return accValue * Math.Min(1.15, Math.Pow(totalHits / 1500.0, 0.3)); accuracyValue *= lengthBonus;
// Slight HDFL Bonus for accuracy.
if (score.Mods.Any(m => m is ModFlashlight<TaikoHitObject>) && score.Mods.Any(m => m is ModHidden))
accuracyValue *= 1.10 * lengthBonus;
return accuracyValue;
} }
private int totalHits => countGreat + countOk + countMeh + countMiss; private int totalHits => countGreat + countOk + countMeh + countMiss;

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

@ -80,7 +80,7 @@ namespace osu.Game.Tests.Online
{ {
AddStep("download beatmap", () => beatmaps.Download(test_db_model)); AddStep("download beatmap", () => beatmaps.Download(test_db_model));
AddStep("cancel download from request", () => beatmaps.GetExistingDownload(test_db_model).Cancel()); AddStep("cancel download from request", () => beatmaps.GetExistingDownload(test_db_model)!.Cancel());
AddUntilStep("is removed from download list", () => beatmaps.GetExistingDownload(test_db_model) == null); AddUntilStep("is removed from download list", () => beatmaps.GetExistingDownload(test_db_model) == null);
AddAssert("is notification cancelled", () => recentNotification.State == ProgressNotificationState.Cancelled); AddAssert("is notification cancelled", () => recentNotification.State == ProgressNotificationState.Cancelled);

View File

@ -126,10 +126,10 @@ namespace osu.Game.Tests.Online
AddStep("start downloading", () => beatmapDownloader.Download(testBeatmapSet)); AddStep("start downloading", () => beatmapDownloader.Download(testBeatmapSet));
addAvailabilityCheckStep("state downloading 0%", () => BeatmapAvailability.Downloading(0.0f)); addAvailabilityCheckStep("state downloading 0%", () => BeatmapAvailability.Downloading(0.0f));
AddStep("set progress 40%", () => ((TestDownloadRequest)beatmapDownloader.GetExistingDownload(testBeatmapSet)).SetProgress(0.4f)); AddStep("set progress 40%", () => ((TestDownloadRequest)beatmapDownloader.GetExistingDownload(testBeatmapSet))!.SetProgress(0.4f));
addAvailabilityCheckStep("state downloading 40%", () => BeatmapAvailability.Downloading(0.4f)); addAvailabilityCheckStep("state downloading 40%", () => BeatmapAvailability.Downloading(0.4f));
AddStep("finish download", () => ((TestDownloadRequest)beatmapDownloader.GetExistingDownload(testBeatmapSet)).TriggerSuccess(testBeatmapFile)); AddStep("finish download", () => ((TestDownloadRequest)beatmapDownloader.GetExistingDownload(testBeatmapSet))!.TriggerSuccess(testBeatmapFile));
addAvailabilityCheckStep("state importing", BeatmapAvailability.Importing); addAvailabilityCheckStep("state importing", BeatmapAvailability.Importing);
AddStep("allow importing", () => beatmaps.AllowImport.SetResult(true)); AddStep("allow importing", () => beatmaps.AllowImport.SetResult(true));

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

@ -30,7 +30,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
var importer = parent.Get<BeatmapImporter>(); var importer = parent.Get<BeatmapManager>();
dependencies.CacheAs<BeatmapModelDownloader>(beatmapDownloader = new TestSceneOnlinePlayBeatmapAvailabilityTracker.TestBeatmapModelDownloader(importer, API)); dependencies.CacheAs<BeatmapModelDownloader>(beatmapDownloader = new TestSceneOnlinePlayBeatmapAvailabilityTracker.TestBeatmapModelDownloader(importer, API));
return dependencies; return dependencies;

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

@ -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.Database; using osu.Game.Database;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
@ -14,7 +12,7 @@ namespace osu.Game.Beatmaps
protected override ArchiveDownloadRequest<IBeatmapSetInfo> CreateDownloadRequest(IBeatmapSetInfo set, bool minimiseDownloadSize) => protected override ArchiveDownloadRequest<IBeatmapSetInfo> CreateDownloadRequest(IBeatmapSetInfo set, bool minimiseDownloadSize) =>
new DownloadBeatmapSetRequest(set, minimiseDownloadSize); new DownloadBeatmapSetRequest(set, minimiseDownloadSize);
public override ArchiveDownloadRequest<IBeatmapSetInfo> GetExistingDownload(IBeatmapSetInfo model) public override ArchiveDownloadRequest<IBeatmapSetInfo>? GetExistingDownload(IBeatmapSetInfo model)
=> CurrentDownloads.Find(r => r.Model.OnlineID == model.OnlineID); => CurrentDownloads.Find(r => r.Model.OnlineID == model.OnlineID);
public BeatmapModelDownloader(IModelImporter<BeatmapSetInfo> beatmapImporter, IAPIProvider api) public BeatmapModelDownloader(IModelImporter<BeatmapSetInfo> beatmapImporter, IAPIProvider api)

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

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;
@ -19,18 +17,18 @@ namespace osu.Game.Database
where TModel : class, IHasGuidPrimaryKey, ISoftDelete, IEquatable<TModel>, T where TModel : class, IHasGuidPrimaryKey, ISoftDelete, IEquatable<TModel>, T
where T : class where T : class
{ {
public Action<Notification> PostNotification { protected get; set; } public Action<Notification>? PostNotification { protected get; set; }
public event Action<ArchiveDownloadRequest<T>> DownloadBegan; public event Action<ArchiveDownloadRequest<T>>? DownloadBegan;
public event Action<ArchiveDownloadRequest<T>> DownloadFailed; public event Action<ArchiveDownloadRequest<T>>? DownloadFailed;
private readonly IModelImporter<TModel> importer; private readonly IModelImporter<TModel> importer;
private readonly IAPIProvider api; private readonly IAPIProvider? api;
protected readonly List<ArchiveDownloadRequest<T>> CurrentDownloads = new List<ArchiveDownloadRequest<T>>(); protected readonly List<ArchiveDownloadRequest<T>> CurrentDownloads = new List<ArchiveDownloadRequest<T>>();
protected ModelDownloader(IModelImporter<TModel> importer, IAPIProvider api) protected ModelDownloader(IModelImporter<TModel> importer, IAPIProvider? api)
{ {
this.importer = importer; this.importer = importer;
this.api = api; this.api = api;
@ -87,7 +85,7 @@ namespace osu.Game.Database
CurrentDownloads.Add(request); CurrentDownloads.Add(request);
PostNotification?.Invoke(notification); PostNotification?.Invoke(notification);
api.PerformAsync(request); api?.PerformAsync(request);
DownloadBegan?.Invoke(request); DownloadBegan?.Invoke(request);
return true; return true;
@ -101,11 +99,11 @@ namespace osu.Game.Database
notification.State = ProgressNotificationState.Cancelled; notification.State = ProgressNotificationState.Cancelled;
if (!(error is OperationCanceledException)) if (!(error is OperationCanceledException))
Logger.Error(error, $"{importer?.HumanisedModelName.Titleize()} download failed!"); Logger.Error(error, $"{importer.HumanisedModelName.Titleize()} download failed!");
} }
} }
public abstract ArchiveDownloadRequest<T> GetExistingDownload(T model); public abstract ArchiveDownloadRequest<T>? GetExistingDownload(T model);
private bool canDownload(T model) => GetExistingDownload(model) == null && api != null; private bool canDownload(T model) => GetExistingDownload(model) == null && api != null;

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

@ -66,10 +66,10 @@ namespace osu.Game.Online.Spectator
await connector.Reconnect(); await connector.Reconnect();
await BeginPlayingInternal(state); await BeginPlayingInternal(state);
return;
} }
throw; // Exceptions can occur if, for instance, the locally played beatmap doesn't have a server-side counterpart.
// For now, let's ignore these so they don't cause unobserved exceptions to appear to the user (and sentry).
} }
} }

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.
@ -216,8 +214,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

@ -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.Database; using osu.Game.Database;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Online.API; using osu.Game.Online.API;

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

@ -1,7 +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;
@ -20,9 +19,8 @@ namespace osu.Game.Screens.Select.Carousel
public class UpdateBeatmapSetButton : OsuAnimatedButton public class UpdateBeatmapSetButton : OsuAnimatedButton
{ {
private readonly BeatmapSetInfo beatmapSetInfo; private readonly BeatmapSetInfo beatmapSetInfo;
private SpriteIcon icon; private SpriteIcon icon = null!;
private Box progressFill = null!;
private Box progressFill;
public UpdateBeatmapSetButton(BeatmapSetInfo beatmapSetInfo) public UpdateBeatmapSetButton(BeatmapSetInfo beatmapSetInfo)
{ {

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.0" /> <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.0" /> <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.0" /> <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" />