1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 14:52:57 +08:00

Merge branch 'master' into skin-configuration-refactor

This commit is contained in:
Dan Balasescu 2019-09-05 16:56:05 +09:00 committed by GitHub
commit f729282c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 71 additions and 31 deletions

View File

@ -61,6 +61,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.904.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.830.1" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.905.0" />
</ItemGroup>
</Project>

View File

@ -10,14 +10,9 @@ namespace osu.Game.Tests.Visual.Menus
{
public class TestSceneDisclaimer : ScreenTestScene
{
[Cached(typeof(IAPIProvider))]
private readonly DummyAPIAccess api = new DummyAPIAccess();
[BackgroundDependencyLoader]
private void load()
private void load(IAPIProvider api)
{
Add(api);
AddStep("load disclaimer", () => LoadScreen(new Disclaimer()));
AddStep("toggle support", () =>

View File

@ -14,6 +14,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
public class TestSceneMatchLeaderboard : MultiplayerTestScene
{
protected override bool RequiresAPIAccess => true;
public TestSceneMatchLeaderboard()
{
Room.RoomID.Value = 3;
@ -27,11 +29,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
});
}
[Resolved]
private IAPIProvider api { get; set; }
[BackgroundDependencyLoader]
private void load()
private void load(IAPIProvider api)
{
var req = new GetRoomScoresRequest();
req.Success += v => { };

View File

@ -12,6 +12,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
[TestFixture]
public class TestSceneMultiScreen : ScreenTestScene
{
protected override bool RequiresAPIAccess => true;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(Screens.Multi.Multiplayer),

View File

@ -25,17 +25,14 @@ namespace osu.Game.Tests.Visual.Online
typeof(AccountCreationScreen),
};
[Cached(typeof(IAPIProvider))]
private DummyAPIAccess api = new DummyAPIAccess();
private readonly Container userPanelArea;
public TestSceneAccountCreationOverlay()
{
Container userPanelArea;
AccountCreationOverlay accountCreation;
Children = new Drawable[]
{
api,
accountCreation = new AccountCreationOverlay(),
userPanelArea = new Container
{
@ -46,11 +43,16 @@ namespace osu.Game.Tests.Visual.Online
},
};
AddStep("show", () => accountCreation.Show());
}
[BackgroundDependencyLoader]
private void load(IAPIProvider api)
{
api.Logout();
api.LocalUser.BindValueChanged(user => { userPanelArea.Child = new UserPanel(user.NewValue) { Width = 200 }; }, true);
AddStep("show", () => accountCreation.Show());
AddStep("logout", () => api.Logout());
AddStep("logout", api.Logout);
}
}
}

View File

@ -42,6 +42,8 @@ namespace osu.Game.Tests.Visual.Online
typeof(BeatmapAvailability),
};
protected override bool RequiresAPIAccess => true;
private RulesetInfo taikoRuleset;
private RulesetInfo maniaRuleset;

View File

@ -27,6 +27,8 @@ namespace osu.Game.Tests.Visual.Online
typeof(Comments),
};
protected override bool RequiresAPIAccess => true;
protected override void LoadComplete()
{
base.LoadComplete();

View File

@ -13,6 +13,8 @@ namespace osu.Game.Tests.Visual.Online
{
private DirectOverlay direct;
protected override bool RequiresAPIAccess => true;
protected override void LoadComplete()
{
base.LoadComplete();

View File

@ -17,14 +17,15 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public class TestSceneHistoricalSection : OsuTestScene
{
public override IReadOnlyList<Type> RequiredTypes =>
new[]
{
typeof(HistoricalSection),
typeof(PaginatedMostPlayedBeatmapContainer),
typeof(DrawableMostPlayedBeatmap),
typeof(DrawableProfileRow)
};
protected override bool RequiresAPIAccess => true;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(HistoricalSection),
typeof(PaginatedMostPlayedBeatmapContainer),
typeof(DrawableMostPlayedBeatmap),
typeof(DrawableProfileRow)
};
public TestSceneHistoricalSection()
{

View File

@ -13,6 +13,8 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public class TestSceneSocialOverlay : OsuTestScene
{
protected override bool RequiresAPIAccess => true;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(UserPanel),

View File

@ -17,6 +17,8 @@ namespace osu.Game.Tests.Visual.Online
{
public class TestSceneUserProfileHeader : OsuTestScene
{
protected override bool RequiresAPIAccess => true;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(ProfileHeader),

View File

@ -19,6 +19,8 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public class TestSceneUserProfileOverlay : OsuTestScene
{
protected override bool RequiresAPIAccess => true;
private readonly TestUserProfileOverlay profile;
[Resolved]

View File

@ -18,6 +18,8 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public class TestSceneUserRanks : OsuTestScene
{
protected override bool RequiresAPIAccess => true;
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(DrawableProfileScore), typeof(RanksSection) };
public TestSceneUserRanks()

View File

@ -20,6 +20,8 @@ namespace osu.Game.Tests.Visual.UserInterface
{
public class TestSceneUpdateableBeatmapBackgroundSprite : OsuTestScene
{
protected override bool RequiresAPIAccess => true;
private BeatmapSetInfo testBeatmap;
private IAPIProvider api;
private RulesetStore rulesets;

View File

@ -57,8 +57,9 @@ namespace osu.Game.Graphics.Backgrounds
AddInternal(bufferedContainer = new BufferedContainer
{
CacheDrawnFrameBuffer = true,
RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
RedrawOnScale = false,
Child = Sprite
});
}

View File

@ -55,6 +55,7 @@ namespace osu.Game.Graphics.Sprites
Origin = Anchor.Centre,
BlurSigma = new Vector2(4),
CacheDrawnFrameBuffer = true,
RedrawOnScale = false,
RelativeSizeAxes = Axes.Both,
Blending = BlendingParameters.Additive,
Size = new Vector2(3f),

View File

@ -346,10 +346,12 @@ namespace osu.Game.Overlays
public Background(WorkingBeatmap beatmap = null)
{
this.beatmap = beatmap;
CacheDrawnFrameBuffer = true;
Depth = float.MaxValue;
RelativeSizeAxes = Axes.Both;
CacheDrawnFrameBuffer = true;
Children = new Drawable[]
{
sprite = new Sprite

View File

@ -103,6 +103,7 @@ namespace osu.Game.Screens.Play
var newColumns = new BufferedContainer<Column>
{
CacheDrawnFrameBuffer = true,
RedrawOnScale = false,
RelativeSizeAxes = Axes.Both,
};

View File

@ -154,6 +154,8 @@ namespace osu.Game.Screens.Select
var metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
CacheDrawnFrameBuffer = true;
RedrawOnScale = false;
RelativeSizeAxes = Axes.Both;
titleBinding = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title)));

View File

@ -146,6 +146,7 @@ namespace osu.Game.Screens.Select.Carousel
public PanelBackground(WorkingBeatmap working)
{
CacheDrawnFrameBuffer = true;
RedrawOnScale = false;
Children = new Drawable[]
{

View File

@ -16,6 +16,7 @@ using osu.Framework.Testing;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Online.API;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Tests.Beatmaps;
@ -47,6 +48,12 @@ namespace osu.Game.Tests.Visual
private readonly Lazy<DatabaseContextFactory> contextFactory;
protected DatabaseContextFactory ContextFactory => contextFactory.Value;
/// <summary>
/// Whether this test scene requires API access
/// Setting this will cache an actual <see cref="APIAccess"/>.
/// </summary>
protected virtual bool RequiresAPIAccess => false;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
// This is the earliest we can get OsuGameBase, which is used by the dummy working beatmap to find textures
@ -57,7 +64,17 @@ namespace osu.Game.Tests.Visual
Default = working
};
return Dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
Dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
if (!RequiresAPIAccess)
{
var dummyAPI = new DummyAPIAccess();
Dependencies.CacheAs<IAPIProvider>(dummyAPI);
Add(dummyAPI);
}
return Dependencies;
}
protected OsuTestScene()

View File

@ -26,7 +26,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.904.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.830.1" />
<PackageReference Include="ppy.osu.Framework" Version="2019.905.0" />
<PackageReference Include="SharpCompress" Version="0.24.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -118,8 +118,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.904.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.830.1" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.830.1" />
<PackageReference Include="ppy.osu.Framework" Version="2019.905.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.905.0" />
<PackageReference Include="SharpCompress" Version="0.24.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />