diff --git a/osu-framework b/osu-framework index 46a56e0e11..991177da4f 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 46a56e0e11d56c788ff8db089582718a606ed158 +Subproject commit 991177da4fbed2dd8260c215f2d341ebc858b03e diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 01d7d4ff01..909ee9b134 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -198,7 +198,7 @@ namespace osu.Desktop.VisualTests.Tests AutoSizeAxes = Axes.Both; Direction = FillDirection.Horizontal; Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size }); - Add(valueText = new OsuSpriteText() { TextSize = text_size }); + Add(valueText = new OsuSpriteText { TextSize = text_size }); Margin = new MarginPadding(margin); } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDirect.cs b/osu.Desktop.VisualTests/Tests/TestCaseDirect.cs index 6b68ffa260..2a20bca836 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDirect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseDirect.cs @@ -48,6 +48,17 @@ namespace osu.Desktop.VisualTests.Tests Author = @"RLC", Source = @"", }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Card = @"https://assets.ppy.sh/beatmaps/578332/covers/card.jpg?1494591390", + Cover = @"https://assets.ppy.sh/beatmaps/578332/covers/cover.jpg?1494591390", + }, + Preview = @"https://b.ppy.sh/preview/578332.mp3", + PlayCount = 97, + FavouriteCount = 72, + }, Beatmaps = new List { new BeatmapInfo @@ -55,13 +66,6 @@ namespace osu.Desktop.VisualTests.Tests Ruleset = ruleset, StarDifficulty = 5.35f, Metadata = new BeatmapMetadata(), - OnlineInfo = new BeatmapOnlineInfo - { - Covers = new[] { @"https://assets.ppy.sh//beatmaps/578332/covers/cover.jpg?1494591390" }, - Preview = @"https://b.ppy.sh/preview/578332.mp3", - PlayCount = 97, - FavouriteCount = 72, - }, }, }, }, @@ -74,6 +78,17 @@ namespace osu.Desktop.VisualTests.Tests Author = @"Sotarks", Source = @"ぎんぎつね", }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Card = @"https://assets.ppy.sh/beatmaps/599627/covers/card.jpg?1494539318", + Cover = @"https://assets.ppy.sh/beatmaps/599627/covers/cover.jpg?1494539318", + }, + Preview = @"https//b.ppy.sh/preview/599627.mp3", + PlayCount = 3082, + FavouriteCount = 14, + }, Beatmaps = new List { new BeatmapInfo @@ -81,13 +96,6 @@ namespace osu.Desktop.VisualTests.Tests Ruleset = ruleset, StarDifficulty = 5.81f, Metadata = new BeatmapMetadata(), - OnlineInfo = new BeatmapOnlineInfo - { - Covers = new[] { @"https://assets.ppy.sh//beatmaps/599627/covers/cover.jpg?1494539318" }, - Preview = @"https//b.ppy.sh/preview/599627.mp3", - PlayCount = 3082, - FavouriteCount = 14, - }, }, }, }, @@ -100,6 +108,17 @@ namespace osu.Desktop.VisualTests.Tests Author = @"Cerulean Veyron", Source = @"", }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Card = @"https://assets.ppy.sh/beatmaps/513268/covers/card.jpg?1494502863", + Cover = @"https://assets.ppy.sh/beatmaps/513268/covers/cover.jpg?1494502863", + }, + Preview = @"https//b.ppy.sh/preview/513268.mp3", + PlayCount = 2762, + FavouriteCount = 15, + }, Beatmaps = new List { new BeatmapInfo @@ -107,13 +126,6 @@ namespace osu.Desktop.VisualTests.Tests Ruleset = ruleset, StarDifficulty = 0.9f, Metadata = new BeatmapMetadata(), - OnlineInfo = new BeatmapOnlineInfo - { - Covers = new[] { @"https://assets.ppy.sh//beatmaps/513268/covers/cover.jpg?1494502863" }, - Preview = @"https//b.ppy.sh/preview/513268.mp3", - PlayCount = 2762, - FavouriteCount = 15, - }, }, new BeatmapInfo { @@ -141,6 +153,17 @@ namespace osu.Desktop.VisualTests.Tests Author = @"[Kamiya]", Source = @"小林さんちのメイドラゴン", }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Card = @"https://assets.ppy.sh/beatmaps/586841/covers/card.jpg?1494052741", + Cover = @"https://assets.ppy.sh/beatmaps/586841/covers/cover.jpg?1494052741", + }, + Preview = @"https//b.ppy.sh/preview/586841.mp3", + PlayCount = 62317, + FavouriteCount = 161, + }, Beatmaps = new List { new BeatmapInfo @@ -148,13 +171,6 @@ namespace osu.Desktop.VisualTests.Tests Ruleset = ruleset, StarDifficulty = 1.26f, Metadata = new BeatmapMetadata(), - OnlineInfo = new BeatmapOnlineInfo - { - Covers = new[] { @"https://assets.ppy.sh//beatmaps/586841/covers/cover.jpg?1494052741" }, - Preview = @"https//b.ppy.sh/preview/586841.mp3", - PlayCount = 62317, - FavouriteCount = 161, - }, }, new BeatmapInfo { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs b/osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs index ddda4119bf..4f4ef9bbb5 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseDrawableRoom.cs @@ -8,6 +8,7 @@ using osu.Game.Screens.Multiplayer; using osu.Game.Online.Multiplayer; using osu.Game.Users; using osu.Game.Database; +using osu.Framework.Allocation; namespace osu.Desktop.VisualTests.Tests { @@ -15,74 +16,117 @@ namespace osu.Desktop.VisualTests.Tests { public override string Description => @"Select your favourite room"; + private RulesetDatabase rulesets; + protected override void LoadComplete() { base.LoadComplete(); DrawableRoom first; - DrawableRoom second; Add(new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Y, - Width = 500f, + Width = 580f, Direction = FillDirection.Vertical, Children = new Drawable[] { - first = new DrawableRoom(new Room()), - second = new DrawableRoom(new Room()), + first = new DrawableRoom(new Room + { + Name = { Value = @"Great Room Right Here" }, + Host = { Value = new User { Username = @"Naeferith", Id = 9492835, Country = new Country { FlagName = @"FR" } } }, + Status = { Value = new RoomStatusOpen() }, + Type = { Value = new GameTypeTeamVersus() }, + Beatmap = + { + Value = new BeatmapInfo + { + StarDifficulty = 4.65, + Ruleset = rulesets.GetRuleset(3), + Metadata = new BeatmapMetadata + { + Title = @"Critical Crystal", + Artist = @"Seiryu", + }, + BeatmapSet = new BeatmapSetInfo + { + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Cover = @"https://assets.ppy.sh//beatmaps/376340/covers/cover.jpg?1456478455", + }, + }, + }, + }, + }, + Participants = + { + Value = new[] + { + new User { GlobalRank = 1355 }, + new User { GlobalRank = 8756 }, + }, + }, + }), + new DrawableRoom(new Room + { + Name = { Value = @"Relax It's The Weekend" }, + Host = { Value = new User { Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" } } }, + Status = { Value = new RoomStatusPlaying() }, + Type = { Value = new GameTypeTagTeam() }, + Beatmap = + { + Value = new BeatmapInfo + { + StarDifficulty = 1.96, + Ruleset = rulesets.GetRuleset(0), + Metadata = new BeatmapMetadata + { + Title = @"Serendipity", + Artist = @"ZAQ", + }, + BeatmapSet = new BeatmapSetInfo + { + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Cover = @"https://assets.ppy.sh//beatmaps/526839/covers/cover.jpg?1493815706", + }, + }, + }, + }, + }, + Participants = + { + Value = new[] + { + new User { GlobalRank = 578975 }, + new User { GlobalRank = 24554 }, + }, + }, + }), } }); - first.Room.Name.Value = @"Great Room Right Here"; - first.Room.Host.Value = new User { Username = @"Naeferith", Id = 9492835, Country = new Country { FlagName = @"FR" } }; - first.Room.Status.Value = new RoomStatusOpen(); - first.Room.Beatmap.Value = new BeatmapInfo + AddStep(@"change title", () => first.Room.Name.Value = @"I Changed Name"); + AddStep(@"change host", () => first.Room.Host.Value = new User { Username = @"DrabWeb", Id = 6946022, Country = new Country { FlagName = @"CA" } }); + AddStep(@"change status", () => first.Room.Status.Value = new RoomStatusPlaying()); + AddStep(@"change type", () => first.Room.Type.Value = new GameTypeVersus()); + AddStep(@"change beatmap", () => first.Room.Beatmap.Value = null); + AddStep(@"change participants", () => first.Room.Participants.Value = new[] { - Metadata = new BeatmapMetadata - { - Title = @"Seiryu", - Artist = @"Critical Crystal", - }, - }; - - second.Room.Name.Value = @"Relax It's The Weekend"; - second.Room.Host.Value = new User { Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" } }; - second.Room.Status.Value = new RoomStatusPlaying(); - second.Room.Beatmap.Value = new BeatmapInfo - { - Metadata = new BeatmapMetadata - { - Title = @"Serendipity", - Artist = @"ZAQ", - }, - }; - - AddStep(@"change state", () => - { - first.Room.Status.Value = new RoomStatusPlaying(); + new User { GlobalRank = 1254 }, + new User { GlobalRank = 123189 }, }); + } - AddStep(@"change name", () => - { - first.Room.Name.Value = @"I Changed Name"; - }); - - AddStep(@"change host", () => - { - first.Room.Host.Value = new User { Username = @"DrabWeb", Id = 6946022, Country = new Country { FlagName = @"CA" } }; - }); - - AddStep(@"change beatmap", () => - { - first.Room.Beatmap.Value = null; - }); - - AddStep(@"change state", () => - { - first.Room.Status.Value = new RoomStatusOpen(); - }); + [BackgroundDependencyLoader] + private void load(RulesetDatabase rulesets) + { + this.rulesets = rulesets; } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMedalOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseMedalOverlay.cs new file mode 100644 index 0000000000..1533f2141e --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseMedalOverlay.cs @@ -0,0 +1,27 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Testing; +using osu.Game.Overlays; +using osu.Game.Users; + +namespace osu.Desktop.VisualTests.Tests +{ + internal class TestCaseMedalOverlay : TestCase + { + public override string Description => @"medal get!"; + + public TestCaseMedalOverlay() + { + AddStep(@"display", () => + { + LoadComponentAsync(new MedalOverlay(new Medal + { + Name = @"Animations", + InternalName = @"all-intro-doubletime", + Description = @"More complex than you think.", + }), Add); + }); + } + } +} diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index 1cfc2fc664..775bfe0f03 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -46,7 +46,7 @@ namespace osu.Desktop.VisualTests.Tests MaxCombo = 123, Rank = ScoreRank.A, Date = DateTimeOffset.Now, - Statistics = new Dictionary() + Statistics = new Dictionary { { "300", 50 }, { "100", 20 }, diff --git a/osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs b/osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs index 00702f7ad0..4d650afed5 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseRoomInspector.cs @@ -39,9 +39,15 @@ namespace osu.Desktop.VisualTests.Tests Artist = @"Maaya Sakamoto", Author = @"uwutm8", }, - OnlineInfo = new BeatmapOnlineInfo + BeatmapSet = new BeatmapSetInfo { - Covers = new[] { @"https://assets.ppy.sh//beatmaps/560573/covers/cover.jpg?1492722343" }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Cover = @"https://assets.ppy.sh/beatmaps/560573/covers/cover.jpg?1492722343", + }, + }, }, } }, @@ -96,15 +102,21 @@ namespace osu.Desktop.VisualTests.Tests Ruleset = rulesets.GetRuleset(0), Metadata = new BeatmapMetadata { - Title = @"xi", - Artist = @"FREEDOM DIVE", + Title = @"FREEDOM DIVE", + Artist = @"xi", Author = @"Nakagawa-Kanon", }, - OnlineInfo = new BeatmapOnlineInfo + BeatmapSet = new BeatmapSetInfo { - Covers = new[] { @"https://assets.ppy.sh//beatmaps/39804/covers/cover.jpg?1456506845" }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Covers = new BeatmapSetOnlineCovers + { + Cover = @"https://assets.ppy.sh/beatmaps/39804/covers/cover.jpg?1456506845", + }, + }, }, - } + }, }, MaxParticipants = { Value = 10 }, Participants = diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index c11d79192e..b65bab0d17 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -231,6 +231,7 @@ + diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 51145b42c8..a2bfe6bf2e 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -50,7 +50,7 @@ namespace osu.Desktop { desktopWindow.CursorState |= CursorState.Hidden; - desktopWindow.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location); + desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico")); desktopWindow.Title = Name; desktopWindow.DragEnter += dragEnter; diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 0a10a60dca..a8ab97ce37 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -186,7 +186,7 @@ namespace osu.Desktop.Overlays { private OsuGame game; - protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification() + protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification { Text = @"Update ready to install. Click to restart!", Activated = () => diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 5ac888b515..e69603602c 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -232,7 +232,7 @@ - +