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:
commit
c964e4036e
@ -5,6 +5,6 @@
|
||||
"version": "3.1.100"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.Build.Traversal": "2.0.52"
|
||||
"Microsoft.Build.Traversal": "2.1.1"
|
||||
}
|
||||
}
|
@ -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" />
|
||||
|
@ -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" />
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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" />
|
||||
|
@ -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;
|
||||
|
@ -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" />
|
||||
|
@ -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
|
||||
|
@ -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" />
|
||||
|
41
osu.Game.Tournament.Tests/Components/TestSceneDateTextBox.cs
Normal file
41
osu.Game.Tournament.Tests/Components/TestSceneDateTextBox.cs
Normal 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -140,7 +140,7 @@ namespace osu.Game.Beatmaps
|
||||
return storyboard;
|
||||
}
|
||||
|
||||
protected override IBeatmapSkin GetSkin()
|
||||
protected override ISkin GetSkin()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -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"/>.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
@ -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
|
||||
{
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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" />
|
||||
|
Loading…
Reference in New Issue
Block a user