mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 18:52:55 +08:00
Merge pull request #4335 from peppy/fix-osugame-test-case
Fix OsuGame test case not working
This commit is contained in:
commit
94a389319d
@ -4,10 +4,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Screens;
|
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -21,8 +21,12 @@ namespace osu.Game.Tests.Visual
|
|||||||
typeof(OsuLogo),
|
typeof(OsuLogo),
|
||||||
};
|
};
|
||||||
|
|
||||||
public TestCaseOsuGame()
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(GameHost host)
|
||||||
{
|
{
|
||||||
|
OsuGame game = new OsuGame();
|
||||||
|
game.SetHost(host);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
@ -30,10 +34,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
},
|
},
|
||||||
new ScreenStack(new Loader())
|
game
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -626,6 +626,10 @@ namespace osu.Game
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logger.Log($"Loading {d}...", level: LogLevel.Debug);
|
Logger.Log($"Loading {d}...", level: LogLevel.Debug);
|
||||||
|
|
||||||
|
if (IsDisposed)
|
||||||
|
return;
|
||||||
|
|
||||||
await LoadComponentAsync(d, add);
|
await LoadComponentAsync(d, add);
|
||||||
Logger.Log($"Loaded {d}!", level: LogLevel.Debug);
|
Logger.Log($"Loaded {d}!", level: LogLevel.Debug);
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,11 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
if (beatmaps != null)
|
||||||
|
{
|
||||||
beatmaps.BeatmapDownloadBegan -= attachDownload;
|
beatmaps.BeatmapDownloadBegan -= attachDownload;
|
||||||
beatmaps.ItemAdded -= setAdded;
|
beatmaps.ItemAdded -= setAdded;
|
||||||
|
}
|
||||||
|
|
||||||
State.UnbindAll();
|
State.UnbindAll();
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<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.128.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.223.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.227.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" />
|
||||||
|
@ -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.128.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.223.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.227.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.223.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.227.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" />
|
||||||
|
Loading…
Reference in New Issue
Block a user