Skip to content

Commit

Permalink
Merge branch 'master' into tourney-dangerous-action-confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jul 25, 2023
2 parents 92c40c9 + ec1b088 commit 2c5a329
Show file tree
Hide file tree
Showing 64 changed files with 902 additions and 233 deletions.
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.720.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.724.0" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Catch.Tests.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleName</key>
<string>osu.Game.Rulesets.Catch.Tests.iOS</string>
<key>CFBundleIdentifier</key>
<string>ppy.osu-Game-Rulesets-Catch-Tests-iOS</string>
<string>sh.ppy.catch-ruleset-tests</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
Expand Down Expand Up @@ -42,4 +42,4 @@
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
</plist>
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Mania.Tests.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleName</key>
<string>osu.Game.Rulesets.Mania.Tests.iOS</string>
<key>CFBundleIdentifier</key>
<string>ppy.osu-Game-Rulesets-Mania-Tests-iOS</string>
<string>sh.ppy.mania-ruleset-tests</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
Expand Down Expand Up @@ -42,4 +42,4 @@
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
</plist>
22 changes: 22 additions & 0 deletions osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Screens.Edit.Setup;

namespace osu.Game.Rulesets.Mania.Edit.Setup
{
public partial class ManiaDifficultySection : DifficultySection
{
[BackgroundDependencyLoader]
private void load()
{
CircleSizeSlider.Label = BeatmapsetsStrings.ShowStatsCsMania;
CircleSizeSlider.Description = "The number of columns in the beatmap";
if (CircleSizeSlider.Current is BindableNumber<float> circleSizeFloat)
circleSizeFloat.Precision = 1;
}
}
}
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Mania/ManiaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ public override IRulesetFilterCriteria CreateRulesetFilterCriteria()
}

public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection();

public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection();
}

public enum PlayfieldType
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Osu.Tests.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleName</key>
<string>osu.Game.Rulesets.Osu.Tests.iOS</string>
<key>CFBundleIdentifier</key>
<string>ppy.osu-Game-Rulesets-Osu-Tests-iOS</string>
<string>sh.ppy.osu-ruleset-tests</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
Expand Down Expand Up @@ -42,4 +42,4 @@
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
</plist>
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Taiko.Tests.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleName</key>
<string>osu.Game.Rulesets.Taiko.Tests.iOS</string>
<key>CFBundleIdentifier</key>
<string>ppy.osu-Game-Rulesets-Taiko-Tests-iOS</string>
<string>sh.ppy.taiko-ruleset-tests</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
Expand Down Expand Up @@ -42,4 +42,4 @@
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
</plist>
4 changes: 2 additions & 2 deletions osu.Game.Tests.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleName</key>
<string>osu.Game.Tests.iOS</string>
<key>CFBundleIdentifier</key>
<string>ppy.osu-Game-Tests-iOS</string>
<string>sh.ppy.osu-tests</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
Expand Down Expand Up @@ -42,4 +42,4 @@
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
</plist>
183 changes: 183 additions & 0 deletions osu.Game.Tests/Editing/Checks/CheckBreaksTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Timing;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Edit.Checks;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Tests.Beatmaps;

namespace osu.Game.Tests.Editing.Checks
{
public class CheckBreaksTest
{
private CheckBreaks check = null!;

[SetUp]
public void Setup()
{
check = new CheckBreaks();
}

[Test]
public void TestBreakTooShort()
{
var beatmap = new Beatmap<HitObject>
{
Breaks = new List<BreakPeriod>
{
new BreakPeriod(0, 649)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateTooShort);
}

[Test]
public void TestBreakStartsEarly()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 0 },
new HitCircle { StartTime = 1_200 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(100, 751)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateEarlyStart);
}

[Test]
public void TestBreakEndsLate()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 0 },
new HitCircle { StartTime = 1_298 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(200, 850)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateLateEnd);
}

[Test]
public void TestBreakAfterLastObjectStartsEarly()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 0 },
new HitCircle { StartTime = 1200 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(1398, 2300)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateEarlyStart);
}

[Test]
public void TestBreakBeforeFirstObjectEndsLate()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 1100 },
new HitCircle { StartTime = 1500 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(0, 652)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateLateEnd);
}

[Test]
public void TestBreakMultipleObjectsEarly()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 0 },
new HitCircle { StartTime = 1_297 },
new HitCircle { StartTime = 1_298 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(200, 850)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckBreaks.IssueTemplateLateEnd);
}

[Test]
public void TestBreaksCorrect()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitCircle { StartTime = 0 },
new HitCircle { StartTime = 1_300 }
},
Breaks = new List<BreakPeriod>
{
new BreakPeriod(200, 850)
}
};
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));

var issues = check.Run(context).ToList();

Assert.That(issues, Is.Empty);
}
}
}
Loading

0 comments on commit 2c5a329

Please sign in to comment.