1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Merge branch 'master' into update-framework

This commit is contained in:
Dean Herbert 2020-09-02 15:49:19 +09:00
commit c964e4036e
23 changed files with 76 additions and 59 deletions

View File

@ -5,6 +5,6 @@
"version": "3.1.100"
},
"msbuild-sdks": {
"Microsoft.Build.Traversal": "2.0.52"
"Microsoft.Build.Traversal": "2.1.1"
}
}

View File

@ -2,7 +2,7 @@
<Import Project="..\osu.TestProject.props" />
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />

View File

@ -2,7 +2,7 @@
<Import Project="..\osu.TestProject.props" />
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />

View File

@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.Osu.Tests
this.hasColours = hasColours;
}
protected override IBeatmapSkin GetSkin() => new TestBeatmapSkin(BeatmapInfo, hasColours);
protected override ISkin GetSkin() => new TestBeatmapSkin(BeatmapInfo, hasColours);
}
private class TestBeatmapSkin : LegacyBeatmapSkin

View File

@ -29,12 +29,12 @@ namespace osu.Game.Rulesets.Osu.Tests
public class TestSceneSkinFallbacks : TestSceneOsuPlayer
{
private readonly TestSource testUserSkin;
private readonly BeatmapTestSource testBeatmapSkin;
private readonly TestSource testBeatmapSkin;
public TestSceneSkinFallbacks()
{
testUserSkin = new TestSource("user");
testBeatmapSkin = new BeatmapTestSource();
testBeatmapSkin = new TestSource("beatmap");
}
[Test]
@ -80,15 +80,15 @@ namespace osu.Game.Rulesets.Osu.Tests
public class CustomSkinWorkingBeatmap : ClockBackedTestWorkingBeatmap
{
private readonly IBeatmapSkin skin;
private readonly ISkinSource skin;
public CustomSkinWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock frameBasedClock, AudioManager audio, IBeatmapSkin skin)
public CustomSkinWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock frameBasedClock, AudioManager audio, ISkinSource skin)
: base(beatmap, storyboard, frameBasedClock, audio)
{
this.skin = skin;
}
protected override IBeatmapSkin GetSkin() => skin;
protected override ISkin GetSkin() => skin;
}
public class SkinProvidingPlayer : TestPlayer
@ -112,14 +112,6 @@ namespace osu.Game.Rulesets.Osu.Tests
}
}
private class BeatmapTestSource : TestSource, IBeatmapSkin
{
public BeatmapTestSource()
: base("beatmap")
{
}
}
public class TestSource : ISkinSource
{
private readonly string identifier;

View File

@ -2,7 +2,7 @@
<Import Project="..\osu.TestProject.props" />
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />

View File

@ -154,8 +154,12 @@ namespace osu.Game.Rulesets.Osu.Replays
// The startPosition for the slider should not be its .Position, but the point on the circle whose tangent crosses the current cursor position
// We also modify spinnerDirection so it spins in the direction it enters the spin circle, to make a smooth transition.
// TODO: Shouldn't the spinner always spin in the same direction?
if (h is Spinner)
if (h is Spinner spinner)
{
// spinners with 0 spins required will auto-complete - don't bother
if (spinner.SpinsRequired == 0)
return;
calcSpinnerStartPosAndDirection(((OsuReplayFrame)Frames[^1]).Position, out startPosition, out spinnerDirection);
Vector2 spinCentreOffset = SPINNER_CENTRE - ((OsuReplayFrame)Frames[^1]).Position;

View File

@ -2,7 +2,7 @@
<Import Project="..\osu.TestProject.props" />
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />

View File

@ -116,7 +116,7 @@ namespace osu.Game.Tests.Gameplay
AddAssert("sample playback rate matches mod rates", () => sample.Channel.AggregateFrequency.Value == expectedRate);
}
private class TestSkin : LegacySkin, IBeatmapSkin
private class TestSkin : LegacySkin
{
public TestSkin(string resourceName, AudioManager audioManager)
: base(DefaultLegacySkin.Info, new TestResourceStore(resourceName), audioManager, "skin.ini")
@ -156,7 +156,7 @@ namespace osu.Game.Tests.Gameplay
this.audio = audio;
}
protected override IBeatmapSkin GetSkin() => new TestSkin("test-sample", audio);
protected override ISkin GetSkin() => new TestSkin("test-sample", audio);
}
private class TestDrawableStoryboardSample : DrawableStoryboardSample

View File

@ -3,7 +3,7 @@
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="DeepEqual" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />

View File

@ -0,0 +1,41 @@
// 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 NUnit.Framework;
using osu.Game.Tests.Visual;
using osu.Game.Tournament.Components;
using osuTK;
using osuTK.Input;
namespace osu.Game.Tournament.Tests.Components
{
public class TestSceneDateTextBox : OsuManualInputManagerTestScene
{
private DateTextBox textBox;
[SetUp]
public void Setup() => Schedule(() =>
{
Child = textBox = new DateTextBox
{
Width = 0.3f
};
});
[Test]
public void TestCommitWithoutSettingBindable()
{
AddStep("click textbox", () =>
{
InputManager.MoveMouseTo(textBox);
InputManager.Click(MouseButton.Left);
});
AddStep("unfocus", () =>
{
InputManager.MoveMouseTo(Vector2.Zero);
InputManager.Click(MouseButton.Left);
});
}
}
}

View File

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
</ItemGroup>

View File

@ -22,11 +22,12 @@ namespace osu.Game.Tournament.Components
}
// hold a reference to the provided bindable so we don't have to in every settings section.
private Bindable<DateTimeOffset> bindable;
private Bindable<DateTimeOffset> bindable = new Bindable<DateTimeOffset>();
public DateTextBox()
{
base.Bindable = new Bindable<string>();
((OsuTextBox)Control).OnCommit = (sender, newText) =>
{
try

View File

@ -140,7 +140,7 @@ namespace osu.Game.Beatmaps
return storyboard;
}
protected override IBeatmapSkin GetSkin()
protected override ISkin GetSkin()
{
try
{

View File

@ -42,9 +42,9 @@ namespace osu.Game.Beatmaps
Storyboard Storyboard { get; }
/// <summary>
/// Retrieves the <see cref="IBeatmapSkin"/> which this <see cref="WorkingBeatmap"/> provides.
/// Retrieves the <see cref="Skin"/> which this <see cref="WorkingBeatmap"/> provides.
/// </summary>
IBeatmapSkin Skin { get; }
ISkin Skin { get; }
/// <summary>
/// Constructs a playable <see cref="IBeatmap"/> from <see cref="Beatmap"/> using the applicable converters for a specific <see cref="RulesetInfo"/>.

View File

@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps
background = new RecyclableLazy<Texture>(GetBackground, BackgroundStillValid);
waveform = new RecyclableLazy<Waveform>(GetWaveform);
storyboard = new RecyclableLazy<Storyboard>(GetStoryboard);
skin = new RecyclableLazy<IBeatmapSkin>(GetSkin);
skin = new RecyclableLazy<ISkin>(GetSkin);
total_count.Value++;
}
@ -275,10 +275,10 @@ namespace osu.Game.Beatmaps
private readonly RecyclableLazy<Storyboard> storyboard;
public bool SkinLoaded => skin.IsResultAvailable;
public IBeatmapSkin Skin => skin.Value;
public ISkin Skin => skin.Value;
protected virtual IBeatmapSkin GetSkin() => new DefaultBeatmapSkin();
private readonly RecyclableLazy<IBeatmapSkin> skin;
protected virtual ISkin GetSkin() => new DefaultSkin();
private readonly RecyclableLazy<ISkin> skin;
/// <summary>
/// Transfer pieces of a beatmap to a new one, where possible, to save on loading.

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}, true);
}
private float getZoomLevelForVisibleMilliseconds(double milliseconds) => (float)(track.Length / milliseconds);
private float getZoomLevelForVisibleMilliseconds(double milliseconds) => Math.Max(1, (float)(track.Length / milliseconds));
/// <summary>
/// The timeline's scroll position in the last frame.

View File

@ -11,7 +11,7 @@ namespace osu.Game.Skinning
/// <summary>
/// A container which overrides existing skin options with beatmap-local values.
/// </summary>
public class BeatmapSkinProvidingContainer : SkinProvidingContainer, IBeatmapSkin
public class BeatmapSkinProvidingContainer : SkinProvidingContainer
{
private readonly Bindable<bool> beatmapSkins = new Bindable<bool>();
private readonly Bindable<bool> beatmapHitsounds = new Bindable<bool>();
@ -21,7 +21,7 @@ namespace osu.Game.Skinning
protected override bool AllowTextureLookup(string componentName) => beatmapSkins.Value;
protected override bool AllowSampleLookup(ISampleInfo componentName) => beatmapHitsounds.Value;
public BeatmapSkinProvidingContainer(IBeatmapSkin skin)
public BeatmapSkinProvidingContainer(ISkin skin)
: base(skin)
{
}

View File

@ -1,9 +0,0 @@
// 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.
namespace osu.Game.Skinning
{
public class DefaultBeatmapSkin : DefaultSkin, IBeatmapSkin
{
}
}

View File

@ -1,12 +0,0 @@
// 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.
namespace osu.Game.Skinning
{
/// <summary>
/// Marker interface for skins that originate from beatmaps.
/// </summary>
public interface IBeatmapSkin : ISkin
{
}
}

View File

@ -11,7 +11,7 @@ using osu.Game.Rulesets.Objects.Legacy;
namespace osu.Game.Skinning
{
public class LegacyBeatmapSkin : LegacySkin, IBeatmapSkin
public class LegacyBeatmapSkin : LegacySkin
{
protected override bool AllowManiaSkin => false;
protected override bool UseCustomSampleBanks => true;

View File

@ -188,7 +188,7 @@ namespace osu.Game.Tests.Beatmaps
this.resourceStore = resourceStore;
}
protected override IBeatmapSkin GetSkin() => new LegacyBeatmapSkin(skinBeatmapInfo, resourceStore, AudioManager);
protected override ISkin GetSkin() => new LegacyBeatmapSkin(skinBeatmapInfo, resourceStore, AudioManager);
}
}
}

View File

@ -26,7 +26,7 @@
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="ppy.osu.Framework" Version="2020.831.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.812.0" />
<PackageReference Include="Sentry" Version="2.1.5" />
<PackageReference Include="Sentry" Version="2.1.6" />
<PackageReference Include="SharpCompress" Version="0.26.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />