mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into multiplayer-team-vs-leaderboard
This commit is contained in:
@ -14,7 +14,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.BeatmapListing.Panels;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
@ -215,7 +215,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
assertDownloadButtonVisible(false);
|
||||
|
||||
void assertDownloadButtonVisible(bool visible) => AddUntilStep($"download button {(visible ? "shown" : "hidden")}",
|
||||
() => playlist.ChildrenOfType<BeatmapDownloadTrackingComposite>().Single().Alpha == (visible ? 1 : 0));
|
||||
() => playlist.ChildrenOfType<BeatmapPanelDownloadButton>().Single().Alpha == (visible ? 1 : 0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -229,7 +229,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
createPlaylist(byOnlineId, byChecksum);
|
||||
|
||||
AddAssert("download buttons shown", () => playlist.ChildrenOfType<BeatmapDownloadTrackingComposite>().All(d => d.IsPresent));
|
||||
AddAssert("download buttons shown", () => playlist.ChildrenOfType<BeatmapPanelDownloadButton>().All(d => d.IsPresent));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
@ -30,10 +29,9 @@ using osu.Game.Skinning;
|
||||
using osu.Game.Utils;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
namespace osu.Game.Tests.Visual.Navigation
|
||||
{
|
||||
[TestFixture]
|
||||
[HeadlessTest]
|
||||
public class TestSceneOsuGame : OsuTestScene
|
||||
{
|
||||
private IReadOnlyList<Type> requiredGameDependencies => new[]
|
@ -1,6 +1,8 @@
|
||||
// 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 System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -68,13 +70,40 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
);
|
||||
}
|
||||
|
||||
private class MyContextMenuContainer : Container, IHasContextMenu
|
||||
private static MenuItem[] makeMenu()
|
||||
{
|
||||
public MenuItem[] ContextMenuItems => new MenuItem[]
|
||||
return new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem(@"Some option"),
|
||||
new OsuMenuItem(@"Highlighted option", MenuItemType.Highlighted),
|
||||
new OsuMenuItem(@"Another option"),
|
||||
new OsuMenuItem(@"Nested option >")
|
||||
{
|
||||
Items = new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem(@"Sub-One"),
|
||||
new OsuMenuItem(@"Sub-Two"),
|
||||
new OsuMenuItem(@"Sub-Three"),
|
||||
new OsuMenuItem(@"Sub-Nested option >")
|
||||
{
|
||||
Items = new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem(@"Double Sub-One"),
|
||||
new OsuMenuItem(@"Double Sub-Two"),
|
||||
new OsuMenuItem(@"Double Sub-Three"),
|
||||
new OsuMenuItem(@"Sub-Sub-Nested option >")
|
||||
{
|
||||
Items = new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem(@"Too Deep One"),
|
||||
new OsuMenuItem(@"Too Deep Two"),
|
||||
new OsuMenuItem(@"Too Deep Three"),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new OsuMenuItem(@"Choose me please"),
|
||||
new OsuMenuItem(@"And me too"),
|
||||
new OsuMenuItem(@"Trying to fill"),
|
||||
@ -82,17 +111,29 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
};
|
||||
}
|
||||
|
||||
private class MyContextMenuContainer : Container, IHasContextMenu
|
||||
{
|
||||
public MenuItem[] ContextMenuItems => makeMenu();
|
||||
}
|
||||
|
||||
private class AnotherContextMenuContainer : Container, IHasContextMenu
|
||||
{
|
||||
public MenuItem[] ContextMenuItems => new MenuItem[]
|
||||
public MenuItem[] ContextMenuItems
|
||||
{
|
||||
new OsuMenuItem(@"Simple option"),
|
||||
new OsuMenuItem(@"Simple very very long option"),
|
||||
new OsuMenuItem(@"Change width", MenuItemType.Highlighted, () => this.ResizeWidthTo(Width * 2, 100, Easing.OutQuint)),
|
||||
new OsuMenuItem(@"Change height", MenuItemType.Highlighted, () => this.ResizeHeightTo(Height * 2, 100, Easing.OutQuint)),
|
||||
new OsuMenuItem(@"Change width back", MenuItemType.Destructive, () => this.ResizeWidthTo(Width / 2, 100, Easing.OutQuint)),
|
||||
new OsuMenuItem(@"Change height back", MenuItemType.Destructive, () => this.ResizeHeightTo(Height / 2, 100, Easing.OutQuint)),
|
||||
};
|
||||
get
|
||||
{
|
||||
List<MenuItem> items = makeMenu().ToList();
|
||||
items.AddRange(new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem(@"Change width", MenuItemType.Highlighted, () => this.ResizeWidthTo(Width * 2, 100, Easing.OutQuint)),
|
||||
new OsuMenuItem(@"Change height", MenuItemType.Highlighted, () => this.ResizeHeightTo(Height * 2, 100, Easing.OutQuint)),
|
||||
new OsuMenuItem(@"Change width back", MenuItemType.Destructive, () => this.ResizeWidthTo(Width / 2, 100, Easing.OutQuint)),
|
||||
new OsuMenuItem(@"Change height back", MenuItemType.Destructive, () => this.ResizeHeightTo(Height / 2, 100, Easing.OutQuint)),
|
||||
});
|
||||
|
||||
return items.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user