mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 11:02:57 +08:00
Merge branch 'master' into localise-beatmap-set-overlay
This commit is contained in:
commit
ead1b47e0e
@ -51,7 +51,7 @@
|
|||||||
<Reference Include="Java.Interop" />
|
<Reference Include="Java.Interop" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.820.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.822.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.819.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.819.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// 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.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
@ -11,6 +12,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Catch;
|
using osu.Game.Rulesets.Catch;
|
||||||
@ -19,6 +21,7 @@ using osu.Game.Rulesets.Objects;
|
|||||||
using osu.Game.Rulesets.Objects.Legacy;
|
using osu.Game.Rulesets.Objects.Legacy;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
using osu.Game.Rulesets.Taiko;
|
using osu.Game.Rulesets.Taiko;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -141,6 +144,29 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
selectBeatmap(createLongMetadata());
|
selectBeatmap(createLongMetadata());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestBPMUpdates()
|
||||||
|
{
|
||||||
|
const float bpm = 120;
|
||||||
|
IBeatmap beatmap = createTestBeatmap(new OsuRuleset().RulesetInfo);
|
||||||
|
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 60 * 1000 / bpm });
|
||||||
|
|
||||||
|
OsuModDoubleTime doubleTime = null;
|
||||||
|
|
||||||
|
selectBeatmap(beatmap);
|
||||||
|
checkDisplayedBPM(bpm);
|
||||||
|
|
||||||
|
AddStep("select DT", () => SelectedMods.Value = new[] { doubleTime = new OsuModDoubleTime() });
|
||||||
|
checkDisplayedBPM(bpm * 1.5f);
|
||||||
|
|
||||||
|
AddStep("change DT rate", () => doubleTime.SpeedChange.Value = 2);
|
||||||
|
checkDisplayedBPM(bpm * 2);
|
||||||
|
|
||||||
|
void checkDisplayedBPM(float target) =>
|
||||||
|
AddUntilStep($"displayed bpm is {target}", () => this.ChildrenOfType<BeatmapInfoWedge.WedgeInfoText.InfoLabel>().Any(
|
||||||
|
label => label.Statistic.Name == "BPM" && label.Statistic.Content == target.ToString(CultureInfo.InvariantCulture)));
|
||||||
|
}
|
||||||
|
|
||||||
private void selectBeatmap([CanBeNull] IBeatmap b)
|
private void selectBeatmap([CanBeNull] IBeatmap b)
|
||||||
{
|
{
|
||||||
Container containerBefore = null;
|
Container containerBefore = null;
|
||||||
|
@ -30,7 +30,12 @@ namespace osu.Game.Rulesets
|
|||||||
// On android in release configuration assemblies are loaded from the apk directly into memory.
|
// On android in release configuration assemblies are loaded from the apk directly into memory.
|
||||||
// We cannot read assemblies from cwd, so should check loaded assemblies instead.
|
// We cannot read assemblies from cwd, so should check loaded assemblies instead.
|
||||||
loadFromAppDomain();
|
loadFromAppDomain();
|
||||||
loadFromDisk();
|
|
||||||
|
// This null check prevents Android from attempting to load the rulesets from disk,
|
||||||
|
// as the underlying path "AppContext.BaseDirectory", despite being non-nullable, it returns null on android.
|
||||||
|
// See https://github.com/xamarin/xamarin-android/issues/3489.
|
||||||
|
if (RuntimeInfo.StartupDirectory != null)
|
||||||
|
loadFromDisk();
|
||||||
|
|
||||||
// the event handler contains code for resolving dependency on the game assembly for rulesets located outside the base game directory.
|
// the event handler contains code for resolving dependency on the game assembly for rulesets located outside the base game directory.
|
||||||
// It needs to be attached to the assembly lookup event before the actual call to loadUserRulesets() else rulesets located out of the base game directory will fail
|
// It needs to be attached to the assembly lookup event before the actual call to loadUserRulesets() else rulesets located out of the base game directory will fail
|
||||||
|
@ -71,6 +71,7 @@ namespace osu.Game.Screens.Select
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
ruleset.BindValueChanged(_ => updateDisplay());
|
ruleset.BindValueChanged(_ => updateDisplay());
|
||||||
|
mods.BindValueChanged(_ => updateDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double animation_duration = 800;
|
private const double animation_duration = 800;
|
||||||
@ -449,8 +450,11 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
public LocalisableString TooltipText { get; }
|
public LocalisableString TooltipText { get; }
|
||||||
|
|
||||||
|
internal BeatmapStatistic Statistic { get; }
|
||||||
|
|
||||||
public InfoLabel(BeatmapStatistic statistic)
|
public InfoLabel(BeatmapStatistic statistic)
|
||||||
{
|
{
|
||||||
|
Statistic = statistic;
|
||||||
TooltipText = statistic.Name;
|
TooltipText = statistic.Name;
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Realm" Version="10.3.0" />
|
<PackageReference Include="Realm" Version="10.3.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2021.819.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2021.819.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.820.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.822.0" />
|
||||||
<PackageReference Include="Sentry" Version="3.8.3" />
|
<PackageReference Include="Sentry" Version="3.8.3" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.28.3" />
|
<PackageReference Include="SharpCompress" Version="0.28.3" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.2" />
|
<PackageReference Include="NUnit" Version="3.13.2" />
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.819.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.819.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.820.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.822.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
|
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user