Merge remote-tracking branch 'upstream/master' into storyboard-clock-di

This commit is contained in:
Dean Herbert 2019-07-12 11:20:43 +09:00
commit c9599b65eb
16 changed files with 52 additions and 57 deletions

View File

@ -63,6 +63,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.704.0" /> <PackageReference Include="ppy.osu.Framework.Android" Version="2019.711.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,7 @@
// 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;
using System.Collections.Generic; using System.Collections.Generic;
using NUnit.Framework; using NUnit.Framework;
using osu.Game.Replays; using osu.Game.Replays;
@ -9,7 +10,7 @@ using osu.Game.Rulesets.Replays;
namespace osu.Game.Tests.NonVisual namespace osu.Game.Tests.NonVisual
{ {
[TestFixture] [TestFixture]
public class FramedReplayinputHandlerTest public class FramedReplayInputHandlerTest
{ {
private Replay replay; private Replay replay;
private TestInputHandler handler; private TestInputHandler handler;
@ -160,10 +161,7 @@ namespace osu.Game.Tests.NonVisual
[Test] [Test]
public void TestRewindInsideImportantSection() public void TestRewindInsideImportantSection()
{ {
// fast forward to important section fastForwardToPoint(3000);
while (handler.SetFrameFromTime(3000) != null)
{
}
setTime(4000, 4000); setTime(4000, 4000);
confirmCurrentFrame(4); confirmCurrentFrame(4);
@ -205,10 +203,7 @@ namespace osu.Game.Tests.NonVisual
[Test] [Test]
public void TestRewindOutOfImportantSection() public void TestRewindOutOfImportantSection()
{ {
// fast forward to important section fastForwardToPoint(3500);
while (handler.SetFrameFromTime(3500) != null)
{
}
confirmCurrentFrame(3); confirmCurrentFrame(3);
confirmNextFrame(4); confirmNextFrame(4);
@ -227,6 +222,15 @@ namespace osu.Game.Tests.NonVisual
confirmNextFrame(2); confirmNextFrame(2);
} }
private void fastForwardToPoint(double destination)
{
for (int i = 0; i < 1000; i++)
if (handler.SetFrameFromTime(destination) == null)
return;
throw new TimeoutException("Seek was never fulfilled");
}
private void setTime(double set, double? expect) private void setTime(double set, double? expect)
{ {
Assert.AreEqual(expect, handler.SetFrameFromTime(set)); Assert.AreEqual(expect, handler.SetFrameFromTime(set));
@ -274,6 +278,7 @@ namespace osu.Game.Tests.NonVisual
public TestInputHandler(Replay replay) public TestInputHandler(Replay replay)
: base(replay) : base(replay)
{ {
FrameAccuratePlayback = true;
} }
protected override double AllowedImportantTimeSpan => 1000; protected override double AllowedImportantTimeSpan => 1000;

View File

@ -181,19 +181,18 @@ namespace osu.Game.Beatmaps
lock (workingCache) lock (workingCache)
{ {
var cached = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID); var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
if (cached != null) if (working == null)
return cached; {
if (beatmapInfo.Metadata == null)
beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata;
if (beatmapInfo.Metadata == null) workingCache.Add(working = new BeatmapManagerWorkingBeatmap(Files.Store,
beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata; new LargeTextureStore(host?.CreateTextureLoaderStore(Files.Store)), beatmapInfo, audioManager));
}
WorkingBeatmap working = new BeatmapManagerWorkingBeatmap(Files.Store, new LargeTextureStore(host?.CreateTextureLoaderStore(Files.Store)), beatmapInfo, audioManager);
previous?.TransferTo(working); previous?.TransferTo(working);
workingCache.Add(working);
return working; return working;
} }
} }

View File

@ -41,6 +41,9 @@ namespace osu.Game.Database
{ {
// required to initialise native SQLite libraries on some platforms. // required to initialise native SQLite libraries on some platforms.
SQLitePCL.Batteries_V2.Init(); SQLitePCL.Batteries_V2.Init();
// https://github.com/aspnet/EntityFrameworkCore/issues/9994#issuecomment-508588678
SQLitePCL.raw.sqlite3_config(2 /*SQLITE_CONFIG_MULTITHREAD*/);
} }
/// <summary> /// <summary>

View File

@ -39,7 +39,7 @@ namespace osu.Game.Input.Bindings
new KeyBinding(InputKey.F4, GlobalAction.ToggleMute), new KeyBinding(InputKey.F4, GlobalAction.ToggleMute),
new KeyBinding(InputKey.Escape, GlobalAction.Back), new KeyBinding(InputKey.Escape, GlobalAction.Back),
new KeyBinding(InputKey.MouseButton1, GlobalAction.Back), new KeyBinding(InputKey.ExtraMouseButton1, GlobalAction.Back),
new KeyBinding(InputKey.Space, GlobalAction.Select), new KeyBinding(InputKey.Space, GlobalAction.Select),
new KeyBinding(InputKey.Enter, GlobalAction.Select), new KeyBinding(InputKey.Enter, GlobalAction.Select),

View File

@ -203,8 +203,13 @@ namespace osu.Game.Online.Leaderboards
public void APIStateChanged(IAPIProvider api, APIState state) public void APIStateChanged(IAPIProvider api, APIState state)
{ {
if (state == APIState.Online) switch (state)
UpdateScores(); {
case APIState.Online:
case APIState.Offline:
UpdateScores();
break;
}
} }
protected void UpdateScores() protected void UpdateScores()

View File

@ -92,24 +92,16 @@ namespace osu.Game.Overlays.Changelog
}); });
} }
NavigationIconButton left, right; fill.Insert(-1, new NavigationIconButton(Build.Versions?.Previous)
fill.AddRange(new[]
{ {
left = new NavigationIconButton(Build.Versions?.Previous) Icon = FontAwesome.Solid.ChevronLeft,
{ SelectBuild = b => SelectBuild(b)
Icon = FontAwesome.Solid.ChevronLeft, });
SelectBuild = b => SelectBuild(b) fill.Insert(1, new NavigationIconButton(Build.Versions?.Next)
}, {
right = new NavigationIconButton(Build.Versions?.Next) Icon = FontAwesome.Solid.ChevronRight,
{ SelectBuild = b => SelectBuild(b)
Icon = FontAwesome.Solid.ChevronRight,
SelectBuild = b => SelectBuild(b)
},
}); });
fill.SetLayoutPosition(left, -1);
fill.SetLayoutPosition(right, 1);
return fill; return fill;
} }

View File

@ -85,10 +85,7 @@ namespace osu.Game.Overlays.Music
private void addBeatmapSet(BeatmapSetInfo obj) => Schedule(() => private void addBeatmapSet(BeatmapSetInfo obj) => Schedule(() =>
{ {
var newItem = new PlaylistItem(obj) { OnSelect = set => Selected?.Invoke(set) }; items.Insert(items.Count - 1, new PlaylistItem(obj) { OnSelect = set => Selected?.Invoke(set) });
items.Add(newItem);
items.SetLayoutPosition(newItem, items.Count - 1);
}); });
private void removeBeatmapSet(BeatmapSetInfo obj) => Schedule(() => private void removeBeatmapSet(BeatmapSetInfo obj) => Schedule(() =>

View File

@ -26,8 +26,7 @@ namespace osu.Game.Overlays.Notifications
public void Add(Notification notification, float position) public void Add(Notification notification, float position)
{ {
notifications.Add(notification); notifications.Insert((int)position, notification);
notifications.SetLayoutPosition(notification, position);
} }
public IEnumerable<Type> AcceptTypes; public IEnumerable<Type> AcceptTypes;

View File

@ -78,10 +78,8 @@ namespace osu.Game.Overlays.Profile.Header
int displayIndex = index; int displayIndex = index;
LoadComponentAsync(new DrawableBadge(badges[index]), asyncBadge => LoadComponentAsync(new DrawableBadge(badges[index]), asyncBadge =>
{ {
badgeFlowContainer.Add(asyncBadge);
// load in stable order regardless of async load order. // load in stable order regardless of async load order.
badgeFlowContainer.SetLayoutPosition(asyncBadge, displayIndex); badgeFlowContainer.Insert(displayIndex, asyncBadge);
}); });
} }
} }

View File

@ -49,8 +49,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
Font = OsuFont.GetFont(size: 11, weight: FontWeight.Regular, italics: true) Font = OsuFont.GetFont(size: 11, weight: FontWeight.Regular, italics: true)
}; };
RightFlowContainer.Add(text); RightFlowContainer.Insert(1, text);
RightFlowContainer.SetLayoutPosition(text, 1);
LeftFlowContainer.Add(new BeatmapMetadataContainer(Score.Beatmap)); LeftFlowContainer.Add(new BeatmapMetadataContainer(Score.Beatmap));
LeftFlowContainer.Add(new DrawableDate(Score.Date)); LeftFlowContainer.Add(new DrawableDate(Score.Date));

View File

@ -46,8 +46,7 @@ namespace osu.Game.Overlays.Settings
if (text == null) if (text == null)
{ {
// construct lazily for cases where the label is not needed (may be provided by the Control). // construct lazily for cases where the label is not needed (may be provided by the Control).
Add(text = new OsuSpriteText()); FlowContent.Insert(-1, text = new OsuSpriteText());
FlowContent.SetLayoutPosition(text, -1);
} }
text.Text = value; text.Text = value;

View File

@ -84,7 +84,7 @@ namespace osu.Game.Rulesets.Replays
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data. /// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
/// Disabling this can make replay playback smoother (useful for autoplay, currently). /// Disabling this can make replay playback smoother (useful for autoplay, currently).
/// </summary> /// </summary>
public bool FrameAccuratePlayback = true; public bool FrameAccuratePlayback = false;
protected bool HasFrames => Frames.Count > 0; protected bool HasFrames => Frames.Count > 0;

View File

@ -110,8 +110,7 @@ namespace osu.Game.Screens.Select.Options
HotKey = hotkey HotKey = hotkey
}; };
buttonsContainer.Add(button); buttonsContainer.Insert((int)depth, button);
buttonsContainer.SetLayoutPosition(button, depth);
} }
} }
} }

View File

@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.704.0" /> <PackageReference Include="ppy.osu.Framework" Version="2019.711.0" />
<PackageReference Include="SharpCompress" Version="0.23.0" /> <PackageReference Include="SharpCompress" Version="0.23.0" />
<PackageReference Include="NUnit" Version="3.12.0" /> <PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -105,8 +105,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.702.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.704.0" /> <PackageReference Include="ppy.osu.Framework" Version="2019.711.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.704.0" /> <PackageReference Include="ppy.osu.Framework.iOS" Version="2019.711.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" /> <PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />