From 9e1f2d4fbcb3ab924f8b2a73c6314eb936688f48 Mon Sep 17 00:00:00 2001 From: Welsar55 Date: Tue, 21 May 2019 21:48:09 -0500 Subject: [PATCH 01/49] Added ability to reset all mods by pressing 1 as present on stable. --- osu.Game/Overlays/Mods/ModSection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 50400e254f..f584eff0f9 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -57,7 +57,11 @@ namespace osu.Game.Overlays.Mods protected override bool OnKeyDown(KeyDownEvent e) { - if (ToggleKeys != null) + if(e.Key == Key.Number1) + { + DeselectAll(); + } + else if (ToggleKeys != null) { var index = Array.IndexOf(ToggleKeys, e.Key); if (index > -1 && index < buttons.Length) From 31e6a4fa5942a081f730e1ba2db676a045c9ccc5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 May 2019 15:09:31 +0900 Subject: [PATCH 02/49] Add optional skin foreign key to databased settings --- osu.Game/Configuration/DatabasedSetting.cs | 2 + .../20190525060824_SkinSettings.Designer.cs | 498 ++++++++++++++++++ .../Migrations/20190525060824_SkinSettings.cs | 45 ++ .../Migrations/OsuDbContextModelSnapshot.cs | 11 + osu.Game/Skinning/SkinInfo.cs | 3 + osu.Game/Skinning/SkinStore.cs | 6 + 6 files changed, 565 insertions(+) create mode 100644 osu.Game/Migrations/20190525060824_SkinSettings.Designer.cs create mode 100644 osu.Game/Migrations/20190525060824_SkinSettings.cs diff --git a/osu.Game/Configuration/DatabasedSetting.cs b/osu.Game/Configuration/DatabasedSetting.cs index d56ac49358..035fc73f4f 100644 --- a/osu.Game/Configuration/DatabasedSetting.cs +++ b/osu.Game/Configuration/DatabasedSetting.cs @@ -15,6 +15,8 @@ namespace osu.Game.Configuration public int? Variant { get; set; } + public int? SkinInfoID { get; set; } + [Column("Key")] public int IntKey { diff --git a/osu.Game/Migrations/20190525060824_SkinSettings.Designer.cs b/osu.Game/Migrations/20190525060824_SkinSettings.Designer.cs new file mode 100644 index 0000000000..348c42adb9 --- /dev/null +++ b/osu.Game/Migrations/20190525060824_SkinSettings.Designer.cs @@ -0,0 +1,498 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using osu.Game.Database; + +namespace osu.Game.Migrations +{ + [DbContext(typeof(OsuDbContext))] + [Migration("20190525060824_SkinSettings")] + partial class SkinSettings + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062"); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ApproachRate"); + + b.Property("CircleSize"); + + b.Property("DrainRate"); + + b.Property("OverallDifficulty"); + + b.Property("SliderMultiplier"); + + b.Property("SliderTickRate"); + + b.HasKey("ID"); + + b.ToTable("BeatmapDifficulty"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("AudioLeadIn"); + + b.Property("BaseDifficultyID"); + + b.Property("BeatDivisor"); + + b.Property("BeatmapSetInfoID"); + + b.Property("Countdown"); + + b.Property("DistanceSpacing"); + + b.Property("GridSize"); + + b.Property("Hash"); + + b.Property("Hidden"); + + b.Property("LetterboxInBreaks"); + + b.Property("MD5Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapID"); + + b.Property("Path"); + + b.Property("RulesetID"); + + b.Property("SpecialStyle"); + + b.Property("StackLeniency"); + + b.Property("StarDifficulty"); + + b.Property("Status"); + + b.Property("StoredBookmarks"); + + b.Property("TimelineZoom"); + + b.Property("Version"); + + b.Property("WidescreenStoryboard"); + + b.HasKey("ID"); + + b.HasIndex("BaseDifficultyID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("Hash"); + + b.HasIndex("MD5Hash"); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("BeatmapInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Artist"); + + b.Property("ArtistUnicode"); + + b.Property("AudioFile"); + + b.Property("AuthorString") + .HasColumnName("Author"); + + b.Property("BackgroundFile"); + + b.Property("PreviewTime"); + + b.Property("Source"); + + b.Property("Tags"); + + b.Property("Title"); + + b.Property("TitleUnicode"); + + b.HasKey("ID"); + + b.ToTable("BeatmapMetadata"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("BeatmapSetInfoID"); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.HasKey("ID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("FileInfoID"); + + b.ToTable("BeatmapSetFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapSetID"); + + b.Property("Protected"); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapSetID") + .IsUnique(); + + b.ToTable("BeatmapSetInfo"); + }); + + modelBuilder.Entity("osu.Game.Configuration.DatabasedSetting", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Key") + .HasColumnName("Key"); + + b.Property("RulesetID"); + + b.Property("SkinInfoID"); + + b.Property("StringValue") + .HasColumnName("Value"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("SkinInfoID"); + + b.HasIndex("RulesetID", "Variant"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("osu.Game.IO.FileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Hash"); + + b.Property("ReferenceCount"); + + b.HasKey("ID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("ReferenceCount"); + + b.ToTable("FileInfo"); + }); + + modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntAction") + .HasColumnName("Action"); + + b.Property("KeysString") + .HasColumnName("Keys"); + + b.Property("RulesetID"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("IntAction"); + + b.HasIndex("RulesetID", "Variant"); + + b.ToTable("KeyBinding"); + }); + + modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Available"); + + b.Property("InstantiationInfo"); + + b.Property("Name"); + + b.Property("ShortName"); + + b.HasKey("ID"); + + b.HasIndex("Available"); + + b.HasIndex("ShortName") + .IsUnique(); + + b.ToTable("RulesetInfo"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.Property("ScoreInfoID"); + + b.HasKey("ID"); + + b.HasIndex("FileInfoID"); + + b.HasIndex("ScoreInfoID"); + + b.ToTable("ScoreFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Accuracy") + .HasColumnType("DECIMAL(1,4)"); + + b.Property("BeatmapInfoID"); + + b.Property("Combo"); + + b.Property("Date"); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MaxCombo"); + + b.Property("ModsJson") + .HasColumnName("Mods"); + + b.Property("OnlineScoreID"); + + b.Property("PP"); + + b.Property("Rank"); + + b.Property("RulesetID"); + + b.Property("StatisticsJson") + .HasColumnName("Statistics"); + + b.Property("TotalScore"); + + b.Property("UserID") + .HasColumnName("UserID"); + + b.Property("UserString") + .HasColumnName("User"); + + b.HasKey("ID"); + + b.HasIndex("BeatmapInfoID"); + + b.HasIndex("OnlineScoreID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("ScoreInfo"); + }); + + modelBuilder.Entity("osu.Game.Skinning.SkinFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.Property("SkinInfoID"); + + b.HasKey("ID"); + + b.HasIndex("FileInfoID"); + + b.HasIndex("SkinInfoID"); + + b.ToTable("SkinFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Skinning.SkinInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Creator"); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("Name"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.ToTable("SkinInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty") + .WithMany() + .HasForeignKey("BaseDifficultyID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet") + .WithMany("Beatmaps") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("Beatmaps") + .HasForeignKey("MetadataID"); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo") + .WithMany("Files") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("BeatmapSets") + .HasForeignKey("MetadataID"); + }); + + modelBuilder.Entity("osu.Game.Configuration.DatabasedSetting", b => + { + b.HasOne("osu.Game.Skinning.SkinInfo") + .WithMany("Settings") + .HasForeignKey("SkinInfoID"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreFileInfo", b => + { + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Scoring.ScoreInfo") + .WithMany("Files") + .HasForeignKey("ScoreInfoID"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapInfo", "Beatmap") + .WithMany("Scores") + .HasForeignKey("BeatmapInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Skinning.SkinFileInfo", b => + { + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Skinning.SkinInfo") + .WithMany("Files") + .HasForeignKey("SkinInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/osu.Game/Migrations/20190525060824_SkinSettings.cs b/osu.Game/Migrations/20190525060824_SkinSettings.cs new file mode 100644 index 0000000000..8bd429ca5c --- /dev/null +++ b/osu.Game/Migrations/20190525060824_SkinSettings.cs @@ -0,0 +1,45 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace osu.Game.Migrations +{ + public partial class SkinSettings : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "SkinInfoID", + table: "Settings", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_Settings_SkinInfoID", + table: "Settings", + column: "SkinInfoID"); + + // unsupported by sqlite + + // migrationBuilder.AddForeignKey( + // name: "FK_Settings_SkinInfo_SkinInfoID", + // table: "Settings", + // column: "SkinInfoID", + // principalTable: "SkinInfo", + // principalColumn: "ID", + // onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Settings_SkinInfo_SkinInfoID", + table: "Settings"); + + migrationBuilder.DropIndex( + name: "IX_Settings_SkinInfoID", + table: "Settings"); + + migrationBuilder.DropColumn( + name: "SkinInfoID", + table: "Settings"); + } + } +} diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index 8430e00e4f..d03c2358b5 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -203,6 +203,8 @@ namespace osu.Game.Migrations b.Property("RulesetID"); + b.Property("SkinInfoID"); + b.Property("StringValue") .HasColumnName("Value"); @@ -210,6 +212,8 @@ namespace osu.Game.Migrations b.HasKey("ID"); + b.HasIndex("SkinInfoID"); + b.HasIndex("RulesetID", "Variant"); b.ToTable("Settings"); @@ -442,6 +446,13 @@ namespace osu.Game.Migrations .HasForeignKey("MetadataID"); }); + modelBuilder.Entity("osu.Game.Configuration.DatabasedSetting", b => + { + b.HasOne("osu.Game.Skinning.SkinInfo") + .WithMany("Settings") + .HasForeignKey("SkinInfoID"); + }); + modelBuilder.Entity("osu.Game.Scoring.ScoreFileInfo", b => { b.HasOne("osu.Game.IO.FileInfo", "FileInfo") diff --git a/osu.Game/Skinning/SkinInfo.cs b/osu.Game/Skinning/SkinInfo.cs index 07318b473a..187ea910a7 100644 --- a/osu.Game/Skinning/SkinInfo.cs +++ b/osu.Game/Skinning/SkinInfo.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using osu.Game.Configuration; using osu.Game.Database; namespace osu.Game.Skinning @@ -19,6 +20,8 @@ namespace osu.Game.Skinning public List Files { get; set; } + public List Settings { get; set; } + public bool DeletePending { get; set; } public string FullName => $"\"{Name}\" by {Creator}"; diff --git a/osu.Game/Skinning/SkinStore.cs b/osu.Game/Skinning/SkinStore.cs index 31cadb0a24..153eeda130 100644 --- a/osu.Game/Skinning/SkinStore.cs +++ b/osu.Game/Skinning/SkinStore.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Linq; +using Microsoft.EntityFrameworkCore; using osu.Framework.Platform; using osu.Game.Database; @@ -12,5 +14,9 @@ namespace osu.Game.Skinning : base(contextFactory, storage) { } + + protected override IQueryable AddIncludesForDeletion(IQueryable query) => + base.AddIncludesForDeletion(query) + .Include(s => s.Settings); // don't include FileInfo. these are handled by the FileStore itself. } } From 3ef17a54f671b181bdd2bd599f3be9d818abac58 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jun 2019 13:53:24 +0900 Subject: [PATCH 03/49] Fix sizing of OsuAnimatedButton and OsuClickableContainer Was incorrect under some combinations of relative and autosize usage. --- .../TestSceneOsuAnimatedButton.cs | 73 +++++++++++++++++++ .../Containers/OsuClickableContainer.cs | 2 +- .../UserInterface/OsuAnimatedButton.cs | 6 ++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs new file mode 100644 index 0000000000..4bee3907f5 --- /dev/null +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs @@ -0,0 +1,73 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using osu.Framework.Graphics; +using osu.Framework.Testing; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osuTK; + +namespace osu.Game.Tests.Visual.UserInterface +{ + public class TestSceneOsuAnimatedButton : GridTestScene + { + public TestSceneOsuAnimatedButton() + : base(3, 2) + { + Cell(0).Add(new BaseContainer("relative sized") + { + RelativeSizeAxes = Axes.Both, + }); + + Cell(1).Add(new BaseContainer("auto sized") + { + AutoSizeAxes = Axes.Both + }); + + Cell(2).Add(new BaseContainer("relative Y auto X") + { + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X + }); + + Cell(3).Add(new BaseContainer("relative X auto Y") + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + }); + + Cell(4).Add(new BaseContainer("fixed") + { + Size = new Vector2(100), + }); + + Cell(5).Add(new BaseContainer("fixed") + { + Size = new Vector2(100, 50), + }); + + AddToggleStep("toggle enabled", toggle => + { + for (int i = 0; i < 6; i++) + ((BaseContainer)Cell(i).Child).Action = toggle ? () => { } : (Action)null; + }); + } + + public class BaseContainer : OsuAnimatedButton + { + public BaseContainer(string text) + { + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + + Add(new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = text + }); + } + } + } +} diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index 6dbe340efb..1f31e4cdda 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -31,7 +31,7 @@ namespace osu.Game.Graphics.Containers { if (AutoSizeAxes != Axes.None) { - content.RelativeSizeAxes = RelativeSizeAxes; + content.RelativeSizeAxes = (Axes.Both & ~AutoSizeAxes); content.AutoSizeAxes = AutoSizeAxes; } diff --git a/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs b/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs index a8041c79fc..236b72766f 100644 --- a/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs @@ -74,6 +74,12 @@ namespace osu.Game.Graphics.UserInterface [BackgroundDependencyLoader] private void load(OsuColour colours) { + if (AutoSizeAxes != Axes.None) + { + content.RelativeSizeAxes = (Axes.Both & ~AutoSizeAxes); + content.AutoSizeAxes = AutoSizeAxes; + } + Enabled.BindValueChanged(enabled => this.FadeColour(enabled.NewValue ? Color4.White : colours.Gray9, 200, Easing.OutQuint), true); } From 171fc14776f193958722b24e573edefc3b493a3a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jun 2019 16:33:45 +0900 Subject: [PATCH 04/49] Fix editor regressions --- osu.Game/Graphics/UserInterface/IconButton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/IconButton.cs b/osu.Game/Graphics/UserInterface/IconButton.cs index 6414e488e8..052e9194fa 100644 --- a/osu.Game/Graphics/UserInterface/IconButton.cs +++ b/osu.Game/Graphics/UserInterface/IconButton.cs @@ -66,6 +66,7 @@ namespace osu.Game.Graphics.UserInterface set { Content.RelativeSizeAxes = Axes.None; + Content.AutoSizeAxes = Axes.None; Content.Size = value; } } From 17d04545fad1d6977fdd8a67761d46e4fb5bb059 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jun 2019 16:45:18 +0900 Subject: [PATCH 05/49] Localise GridTestScene as an OsuGridTestScene --- .../Visual/UserInterface/TestSceneLoadingAnimation.cs | 3 +-- .../Visual/UserInterface/TestSceneOsuAnimatedButton.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs index b9a6d74f19..b0233d35f9 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs @@ -3,13 +3,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; -using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; using osuTK.Graphics; namespace osu.Game.Tests.Visual.UserInterface { - public class TestSceneLoadingAnimation : GridTestScene //todo: this should be an OsuTestScene + public class TestSceneLoadingAnimation : OsuGridTestScene { public TestSceneLoadingAnimation() : base(2, 2) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs index 4bee3907f5..6a41d08f01 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuAnimatedButton.cs @@ -3,14 +3,13 @@ using System; using osu.Framework.Graphics; -using osu.Framework.Testing; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osuTK; namespace osu.Game.Tests.Visual.UserInterface { - public class TestSceneOsuAnimatedButton : GridTestScene + public class TestSceneOsuAnimatedButton : OsuGridTestScene { public TestSceneOsuAnimatedButton() : base(3, 2) From e32f62db5bdf473579ee062a67d7c765fb95e2ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 Jun 2019 16:48:44 +0900 Subject: [PATCH 06/49] Add missing file --- .../Visual/UserInterface/OsuGridTestScene.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 osu.Game.Tests/Visual/UserInterface/OsuGridTestScene.cs diff --git a/osu.Game.Tests/Visual/UserInterface/OsuGridTestScene.cs b/osu.Game.Tests/Visual/UserInterface/OsuGridTestScene.cs new file mode 100644 index 0000000000..096ac951de --- /dev/null +++ b/osu.Game.Tests/Visual/UserInterface/OsuGridTestScene.cs @@ -0,0 +1,50 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Tests.Visual.UserInterface +{ + /// + /// An abstract test case which exposes small cells arranged in a grid. + /// Useful for displaying multiple configurations of a tested component at a glance. + /// + public abstract class OsuGridTestScene : OsuTestScene + { + private readonly Drawable[,] cells; + + /// + /// The amount of rows in the grid. + /// + protected readonly int Rows; + + /// + /// The amount of columns in the grid. + /// + protected readonly int Cols; + + /// + /// Constructs a grid test case with the given dimensions. + /// + protected OsuGridTestScene(int rows, int cols) + { + Rows = rows; + Cols = cols; + + GridContainer testContainer; + Add(testContainer = new GridContainer { RelativeSizeAxes = Axes.Both }); + + cells = new Drawable[rows, cols]; + for (int r = 0; r < rows; r++) + for (int c = 0; c < cols; c++) + cells[r, c] = new Container { RelativeSizeAxes = Axes.Both }; + + testContainer.Content = cells.ToJagged(); + } + + protected Container Cell(int index) => (Container)cells[index / Cols, index % Cols]; + protected Container Cell(int row, int col) => (Container)cells[row, col]; + } +} From 194bb80354d7f8d49ed64ba26ac493e53c092151 Mon Sep 17 00:00:00 2001 From: Welsar55 Date: Mon, 3 Jun 2019 11:09:21 -0500 Subject: [PATCH 07/49] Added close button and indictors of hotkeys to buttons --- osu.Game/Overlays/Mods/ModSection.cs | 6 +----- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 25 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index f584eff0f9..50400e254f 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -57,11 +57,7 @@ namespace osu.Game.Overlays.Mods protected override bool OnKeyDown(KeyDownEvent e) { - if(e.Key == Key.Number1) - { - DeselectAll(); - } - else if (ToggleKeys != null) + if (ToggleKeys != null) { var index = Array.IndexOf(ToggleKeys, e.Key); if (index > -1 && index < buttons.Length) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 97769fe5aa..c304dc2eb3 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osuTK; +using osuTK.Input; using osuTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; @@ -23,6 +24,7 @@ using osu.Game.Rulesets; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Mods.Sections; using osu.Game.Screens; +using osu.Framework.Input.Events; namespace osu.Game.Overlays.Mods { @@ -33,6 +35,7 @@ namespace osu.Game.Overlays.Mods protected Color4 LowMultiplierColour, HighMultiplierColour; protected readonly TriangleButton DeselectAllButton; + protected readonly TriangleButton CloseButton; protected readonly OsuSpriteText MultiplierLabel, UnrankedLabel; private readonly FillFlowContainer footerContainer; @@ -192,6 +195,16 @@ namespace osu.Game.Overlays.Mods refreshSelectedMods(); } + protected override bool OnKeyDown(KeyDownEvent e) + { + if (e.Key == Key.Number1) + DeselectAll(); + else if (e.Key == Key.Number2) + PopOut(); + + return base.OnKeyDown(e); + } + private void refreshSelectedMods() => SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); public ModSelectOverlay() @@ -357,13 +370,23 @@ namespace osu.Game.Overlays.Mods DeselectAllButton = new TriangleButton { Width = 180, - Text = "Deselect All", + Text = "1. Deselect All", Action = DeselectAll, Margin = new MarginPadding { Right = 20 } }, + CloseButton = new TriangleButton + { + Width = 180, + Text = "2. Close", + Action = PopOut, + Margin = new MarginPadding + { + Right = 20 + } + }, new OsuSpriteText { Text = @"Score Multiplier:", From 9c214c3f0ec9e8a09f46b2a276a043d55dd38c67 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 4 Jun 2019 16:13:16 +0900 Subject: [PATCH 08/49] Add animation on failing --- .../Visual/Gameplay/TestSceneFailAnimation.cs | 50 ++++++++ .../Visual/Gameplay/TestScenePause.cs | 2 +- osu.Game/Rulesets/UI/DrawableRuleset.cs | 7 +- osu.Game/Screens/Play/FailAnimation.cs | 113 ++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 26 +++- 5 files changed, 191 insertions(+), 7 deletions(-) create mode 100644 osu.Game.Tests/Visual/Gameplay/TestSceneFailAnimation.cs create mode 100644 osu.Game/Screens/Play/FailAnimation.cs diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneFailAnimation.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneFailAnimation.cs new file mode 100644 index 0000000000..4878587dcd --- /dev/null +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneFailAnimation.cs @@ -0,0 +1,50 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; +using osu.Game.Screens.Play; + +namespace osu.Game.Tests.Visual.Gameplay +{ + public class TestSceneFailAnimation : AllPlayersTestScene + { + protected override Player CreatePlayer(Ruleset ruleset) + { + Mods.Value = Array.Empty(); + return new FailPlayer(); + } + + public override IReadOnlyList RequiredTypes => new[] + { + typeof(AllPlayersTestScene), + typeof(TestPlayer), + typeof(Player), + }; + + protected override void AddCheckSteps() + { + AddUntilStep("wait for fail", () => Player.HasFailed); + AddUntilStep("wait for fail overlay", () => ((FailPlayer)Player).FailOverlay.State == Visibility.Visible); + } + + private class FailPlayer : TestPlayer + { + public new FailOverlay FailOverlay => base.FailOverlay; + + public FailPlayer() + : base(false, false) + { + } + + protected override void LoadComplete() + { + base.LoadComplete(); + ScoreProcessor.FailConditions += _ => true; + } + } + } +} diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs index b6f8638f4a..12e91df77c 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePause.cs @@ -113,7 +113,7 @@ namespace osu.Game.Tests.Visual.Gameplay public void TestPauseAfterFail() { AddUntilStep("wait for fail", () => Player.HasFailed); - AddAssert("fail overlay shown", () => Player.FailOverlayVisible); + AddUntilStep("fail overlay shown", () => Player.FailOverlayVisible); confirmClockRunning(false); diff --git a/osu.Game/Rulesets/UI/DrawableRuleset.cs b/osu.Game/Rulesets/UI/DrawableRuleset.cs index 7db24d36a5..52fba9cab3 100644 --- a/osu.Game/Rulesets/UI/DrawableRuleset.cs +++ b/osu.Game/Rulesets/UI/DrawableRuleset.cs @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.UI /// /// The playfield. /// - public Playfield Playfield => playfield.Value; + public override Playfield Playfield => playfield.Value; /// /// Place to put drawables above hit objects but below UI. @@ -342,6 +342,11 @@ namespace osu.Game.Rulesets.UI /// public readonly BindableBool IsPaused = new BindableBool(); + /// + /// The playfield. + /// + public abstract Playfield Playfield { get; } + /// /// The frame-stable clock which is being used for playfield display. /// diff --git a/osu.Game/Screens/Play/FailAnimation.cs b/osu.Game/Screens/Play/FailAnimation.cs new file mode 100644 index 0000000000..a3caffb620 --- /dev/null +++ b/osu.Game/Screens/Play/FailAnimation.cs @@ -0,0 +1,113 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Audio; +using osu.Framework.Bindables; +using osu.Game.Rulesets.UI; +using System; +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Audio.Sample; +using osu.Framework.Audio.Track; +using osu.Framework.Graphics; +using osu.Framework.MathUtils; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects.Drawables; +using osuTK; +using osuTK.Graphics; + +namespace osu.Game.Screens.Play +{ + /// + /// Manage the animation to be applied when a player fails. + /// Single file; automatically disposed after use. + /// + public class FailAnimation : Component + { + public Action OnComplete; + + private readonly DrawableRuleset drawableRuleset; + + private readonly BindableDouble trackFreq = new BindableDouble(1); + + private Track track; + + private const float duration = 2500; + + private SampleChannel failSample; + + public FailAnimation(DrawableRuleset drawableRuleset) + { + this.drawableRuleset = drawableRuleset; + } + + [BackgroundDependencyLoader] + private void load(AudioManager audio, IBindable beatmap) + { + track = beatmap.Value.Track; + failSample = audio.Samples.Get(@"Gameplay/failsound"); + } + + private bool started; + + /// + /// Start the fail animation playing. + /// + /// Thrown if started more than once. + public void Start() + { + if (started) throw new InvalidOperationException("Animation cannot be started more than once."); + + started = true; + + failSample.Play(); + + this.TransformBindableTo(trackFreq, 0, duration).OnComplete(_ => + { + OnComplete?.Invoke(); + Expire(); + }); + + track.AddAdjustment(AdjustableProperty.Frequency, trackFreq); + + applyToPlayfield(drawableRuleset.Playfield); + drawableRuleset.Playfield.HitObjectContainer.FlashColour(Color4.Red, 500); + drawableRuleset.Playfield.HitObjectContainer.FadeOut(duration / 2); + } + + protected override void Update() + { + base.Update(); + + if (!started) + return; + + applyToPlayfield(drawableRuleset.Playfield); + } + + private readonly List appliedObjects = new List(); + + private void applyToPlayfield(Playfield playfield) + { + foreach (var nested in playfield.NestedPlayfields) + applyToPlayfield(nested); + + foreach (DrawableHitObject obj in playfield.HitObjectContainer.AliveObjects) + { + if (appliedObjects.Contains(obj)) + continue; + + obj.RotateTo(RNG.NextSingle(-90, 90), duration); + obj.ScaleTo(obj.Scale * 0.5f, duration); + obj.MoveToOffset(new Vector2(0, 400), duration); + appliedObjects.Add(obj); + } + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq); + } + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index cf743ee4f7..d8389fa6d9 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; @@ -173,7 +173,8 @@ namespace osu.Game.Screens.Play fadeOut(true); Restart(); }, - } + }, + failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, } }; DrawableRuleset.HasReplayLoaded.BindValueChanged(e => HUDOverlay.HoldToQuit.PauseOnFocusLost = !e.NewValue && PauseOnFocusLost, true); @@ -345,13 +346,13 @@ namespace osu.Game.Screens.Play protected FailOverlay FailOverlay { get; private set; } + private FailAnimation failAnimation; + private bool onFail() { if (Mods.Value.OfType().Any(m => !m.AllowFail)) return false; - GameplayClockContainer.Stop(); - HasFailed = true; // There is a chance that we could be in a paused state as the ruleset's internal clock (see FrameStabilityContainer) @@ -360,9 +361,17 @@ namespace osu.Game.Screens.Play if (PauseOverlay.State == Visibility.Visible) PauseOverlay.Hide(); + failAnimation.Start(); + return true; + } + + // Called back when the transform finishes + private void onFailComplete() + { + GameplayClockContainer.Stop(); + FailOverlay.Retries = RestartCount; FailOverlay.Show(); - return true; } #endregion @@ -489,6 +498,13 @@ namespace osu.Game.Screens.Play // still want to block if we are within the cooldown period and not already paused. return true; + if (HasFailed && ValidForResume && !FailOverlay.IsPresent) + // ValidForResume is false when restarting + { + failAnimation.FinishTransforms(true); + return true; + } + GameplayClockContainer.ResetLocalAdjustments(); fadeOut(); From 7d2a75b3502702aa035a7200fbd30b5885534199 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 4 Jun 2019 18:37:26 +0900 Subject: [PATCH 09/49] Dim music volume when holding to confirm --- osu.Game/Overlays/HoldToConfirmOverlay.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/HoldToConfirmOverlay.cs b/osu.Game/Overlays/HoldToConfirmOverlay.cs index fb38ddcbd1..fdc6f096bc 100644 --- a/osu.Game/Overlays/HoldToConfirmOverlay.cs +++ b/osu.Game/Overlays/HoldToConfirmOverlay.cs @@ -2,6 +2,8 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; @@ -17,6 +19,11 @@ namespace osu.Game.Overlays { private Box overlay; + private readonly BindableDouble audioVolume = new BindableDouble(1); + + [Resolved] + private AudioManager audio { get; set; } + [BackgroundDependencyLoader] private void load() { @@ -33,7 +40,19 @@ namespace osu.Game.Overlays } }; - Progress.ValueChanged += p => overlay.Alpha = (float)p.NewValue; + Progress.ValueChanged += p => + { + audioVolume.Value = 1 - p.NewValue; + overlay.Alpha = (float)p.NewValue; + }; + + audio.Tracks.AddAdjustment(AdjustableProperty.Volume, audioVolume); + } + + protected override void Dispose(bool isDisposing) + { + audio.Tracks.RemoveAdjustment(AdjustableProperty.Volume, audioVolume); + base.Dispose(isDisposing); } } } From 5f4d7437bcdafc03434d62446683b5d1692940ae Mon Sep 17 00:00:00 2001 From: Arphox Date: Tue, 4 Jun 2019 21:30:49 +0200 Subject: [PATCH 10/49] Fix the issue When Enabled's value has been changed to true, it will now check if it is currently howered, and if yes, it will fade in correctly. --- osu.Game/Graphics/Containers/OsuHoverContainer.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index eb2d926424..d7dcd5b699 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -24,6 +24,9 @@ namespace osu.Game.Graphics.Containers { Enabled.ValueChanged += e => { + if (e.NewValue && isHovered) + fadeIn(); + if (!e.NewValue) unhover(); }; @@ -33,11 +36,12 @@ namespace osu.Game.Graphics.Containers protected override bool OnHover(HoverEvent e) { + isHovered = true; + if (!Enabled.Value) return false; - EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint)); - isHovered = true; + fadeIn(); return base.OnHover(e); } @@ -69,5 +73,10 @@ namespace osu.Game.Graphics.Containers base.LoadComplete(); EffectTargets.ForEach(d => d.FadeColour(IdleColour)); } + + private void fadeIn() + { + EffectTargets.ForEach(d => d.FadeColour(Color4.Black, FADE_DURATION * 10, Easing.OutQuint)); + } } } From 900cd5c4847c91a3bf0b1e20612505db343755d5 Mon Sep 17 00:00:00 2001 From: Arphox Date: Tue, 4 Jun 2019 21:37:10 +0200 Subject: [PATCH 11/49] Restore original values in FadeColour method call --- osu.Game/Graphics/Containers/OsuHoverContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index d7dcd5b699..0e4a5ae5c0 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -76,7 +76,7 @@ namespace osu.Game.Graphics.Containers private void fadeIn() { - EffectTargets.ForEach(d => d.FadeColour(Color4.Black, FADE_DURATION * 10, Easing.OutQuint)); + EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint)); } } } From a6dc5606bc588a52e03b13e9e62916617d95ecc2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 5 Jun 2019 18:17:43 +0900 Subject: [PATCH 12/49] Allow beatmapsets to be sorted by date added --- osu.Game/Beatmaps/BeatmapManager.cs | 1 + osu.Game/Beatmaps/BeatmapSetInfo.cs | 3 + ...AddDateAddedColumnToBeatmapSet.Designer.cs | 489 ++++++++++++++++++ ...05091246_AddDateAddedColumnToBeatmapSet.cs | 24 + .../Migrations/OsuDbContextModelSnapshot.cs | 2 + .../Select/Carousel/CarouselBeatmapSet.cs | 3 + 6 files changed, 522 insertions(+) create mode 100644 osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.Designer.cs create mode 100644 osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.cs diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 0200dd44ac..b6fe7f88fa 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -342,6 +342,7 @@ namespace osu.Game.Beatmaps OnlineBeatmapSetID = beatmap.BeatmapInfo.BeatmapSet?.OnlineBeatmapSetID, Beatmaps = new List(), Metadata = beatmap.Metadata, + DateAdded = DateTimeOffset.UtcNow }; } diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index e111f77ba1..390236e053 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; @@ -20,6 +21,8 @@ namespace osu.Game.Beatmaps set => onlineBeatmapSetID = value > 0 ? value : null; } + public DateTimeOffset DateAdded { get; set; } + public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None; public BeatmapMetadata Metadata { get; set; } diff --git a/osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.Designer.cs b/osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.Designer.cs new file mode 100644 index 0000000000..9477369aa0 --- /dev/null +++ b/osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.Designer.cs @@ -0,0 +1,489 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using osu.Game.Database; + +namespace osu.Game.Migrations +{ + [DbContext(typeof(OsuDbContext))] + [Migration("20190605091246_AddDateAddedColumnToBeatmapSet")] + partial class AddDateAddedColumnToBeatmapSet + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.4-servicing-10062"); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ApproachRate"); + + b.Property("CircleSize"); + + b.Property("DrainRate"); + + b.Property("OverallDifficulty"); + + b.Property("SliderMultiplier"); + + b.Property("SliderTickRate"); + + b.HasKey("ID"); + + b.ToTable("BeatmapDifficulty"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("AudioLeadIn"); + + b.Property("BaseDifficultyID"); + + b.Property("BeatDivisor"); + + b.Property("BeatmapSetInfoID"); + + b.Property("Countdown"); + + b.Property("DistanceSpacing"); + + b.Property("GridSize"); + + b.Property("Hash"); + + b.Property("Hidden"); + + b.Property("LetterboxInBreaks"); + + b.Property("MD5Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapID"); + + b.Property("Path"); + + b.Property("RulesetID"); + + b.Property("SpecialStyle"); + + b.Property("StackLeniency"); + + b.Property("StarDifficulty"); + + b.Property("Status"); + + b.Property("StoredBookmarks"); + + b.Property("TimelineZoom"); + + b.Property("Version"); + + b.Property("WidescreenStoryboard"); + + b.HasKey("ID"); + + b.HasIndex("BaseDifficultyID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("Hash"); + + b.HasIndex("MD5Hash"); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("BeatmapInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Artist"); + + b.Property("ArtistUnicode"); + + b.Property("AudioFile"); + + b.Property("AuthorString") + .HasColumnName("Author"); + + b.Property("BackgroundFile"); + + b.Property("PreviewTime"); + + b.Property("Source"); + + b.Property("Tags"); + + b.Property("Title"); + + b.Property("TitleUnicode"); + + b.HasKey("ID"); + + b.ToTable("BeatmapMetadata"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("BeatmapSetInfoID"); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.HasKey("ID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("FileInfoID"); + + b.ToTable("BeatmapSetFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("DateAdded"); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapSetID"); + + b.Property("Protected"); + + b.Property("Status"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapSetID") + .IsUnique(); + + b.ToTable("BeatmapSetInfo"); + }); + + modelBuilder.Entity("osu.Game.Configuration.DatabasedSetting", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Key") + .HasColumnName("Key"); + + b.Property("RulesetID"); + + b.Property("StringValue") + .HasColumnName("Value"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("RulesetID", "Variant"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("osu.Game.IO.FileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Hash"); + + b.Property("ReferenceCount"); + + b.HasKey("ID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("ReferenceCount"); + + b.ToTable("FileInfo"); + }); + + modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntAction") + .HasColumnName("Action"); + + b.Property("KeysString") + .HasColumnName("Keys"); + + b.Property("RulesetID"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("IntAction"); + + b.HasIndex("RulesetID", "Variant"); + + b.ToTable("KeyBinding"); + }); + + modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Available"); + + b.Property("InstantiationInfo"); + + b.Property("Name"); + + b.Property("ShortName"); + + b.HasKey("ID"); + + b.HasIndex("Available"); + + b.HasIndex("ShortName") + .IsUnique(); + + b.ToTable("RulesetInfo"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.Property("ScoreInfoID"); + + b.HasKey("ID"); + + b.HasIndex("FileInfoID"); + + b.HasIndex("ScoreInfoID"); + + b.ToTable("ScoreFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Accuracy") + .HasColumnType("DECIMAL(1,4)"); + + b.Property("BeatmapInfoID"); + + b.Property("Combo"); + + b.Property("Date"); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MaxCombo"); + + b.Property("ModsJson") + .HasColumnName("Mods"); + + b.Property("OnlineScoreID"); + + b.Property("PP"); + + b.Property("Rank"); + + b.Property("RulesetID"); + + b.Property("StatisticsJson") + .HasColumnName("Statistics"); + + b.Property("TotalScore"); + + b.Property("UserID") + .HasColumnName("UserID"); + + b.Property("UserString") + .HasColumnName("User"); + + b.HasKey("ID"); + + b.HasIndex("BeatmapInfoID"); + + b.HasIndex("OnlineScoreID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("ScoreInfo"); + }); + + modelBuilder.Entity("osu.Game.Skinning.SkinFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.Property("SkinInfoID"); + + b.HasKey("ID"); + + b.HasIndex("FileInfoID"); + + b.HasIndex("SkinInfoID"); + + b.ToTable("SkinFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Skinning.SkinInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Creator"); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("Name"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.ToTable("SkinInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty") + .WithMany() + .HasForeignKey("BaseDifficultyID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet") + .WithMany("Beatmaps") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("Beatmaps") + .HasForeignKey("MetadataID"); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo") + .WithMany("Files") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("BeatmapSets") + .HasForeignKey("MetadataID"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreFileInfo", b => + { + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Scoring.ScoreInfo") + .WithMany("Files") + .HasForeignKey("ScoreInfoID"); + }); + + modelBuilder.Entity("osu.Game.Scoring.ScoreInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapInfo", "Beatmap") + .WithMany("Scores") + .HasForeignKey("BeatmapInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Skinning.SkinFileInfo", b => + { + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Skinning.SkinInfo") + .WithMany("Files") + .HasForeignKey("SkinInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.cs b/osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.cs new file mode 100644 index 0000000000..55dc18b6a3 --- /dev/null +++ b/osu.Game/Migrations/20190605091246_AddDateAddedColumnToBeatmapSet.cs @@ -0,0 +1,24 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace osu.Game.Migrations +{ + public partial class AddDateAddedColumnToBeatmapSet : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "DateAdded", + table: "BeatmapSetInfo", + nullable: false, + defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DateAdded", + table: "BeatmapSetInfo"); + } + } +} diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index f942d357e8..a94b6df33a 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -166,6 +166,8 @@ namespace osu.Game.Migrations b.Property("ID") .ValueGeneratedOnAdd(); + b.Property("DateAdded"); + b.Property("DeletePending"); b.Property("Hash"); diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs index 5c334b126c..f1951e27ab 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs @@ -45,6 +45,9 @@ namespace osu.Game.Screens.Select.Carousel case SortMode.Author: return string.Compare(BeatmapSet.Metadata.Author.Username, otherSet.BeatmapSet.Metadata.Author.Username, StringComparison.InvariantCultureIgnoreCase); + case SortMode.DateAdded: + return otherSet.BeatmapSet.DateAdded.CompareTo(BeatmapSet.DateAdded); + case SortMode.Difficulty: return BeatmapSet.MaxStarDifficulty.CompareTo(otherSet.BeatmapSet.MaxStarDifficulty); } From c04c6693c271020409596b796c5c00e8f8a6c3ed Mon Sep 17 00:00:00 2001 From: Welsar55 Date: Wed, 5 Jun 2019 13:01:21 -0500 Subject: [PATCH 13/49] Change close action from PopOut to Hide and switched to TriangleButton.Click() --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index c304dc2eb3..a7ba87e72a 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -198,9 +198,9 @@ namespace osu.Game.Overlays.Mods protected override bool OnKeyDown(KeyDownEvent e) { if (e.Key == Key.Number1) - DeselectAll(); + DeselectAllButton.Click(); else if (e.Key == Key.Number2) - PopOut(); + CloseButton.Click(); return base.OnKeyDown(e); } @@ -381,7 +381,7 @@ namespace osu.Game.Overlays.Mods { Width = 180, Text = "2. Close", - Action = PopOut, + Action = Hide, Margin = new MarginPadding { Right = 20 From 02283380c4b6ee648a741d695a35fa4cc5d6acf4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 6 Jun 2019 13:33:30 +0900 Subject: [PATCH 14/49] Use manual migration --- .../Migrations/20190525060824_SkinSettings.cs | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/osu.Game/Migrations/20190525060824_SkinSettings.cs b/osu.Game/Migrations/20190525060824_SkinSettings.cs index 8bd429ca5c..99237419b7 100644 --- a/osu.Game/Migrations/20190525060824_SkinSettings.cs +++ b/osu.Game/Migrations/20190525060824_SkinSettings.cs @@ -6,25 +6,34 @@ namespace osu.Game.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AddColumn( - name: "SkinInfoID", - table: "Settings", - nullable: true); + migrationBuilder.Sql(@"create table Settings_dg_tmp + ( + ID INTEGER not null + constraint PK_Settings + primary key autoincrement, + Key TEXT not null, + RulesetID INTEGER, + Value TEXT, + Variant INTEGER, + SkinInfoID int + constraint Settings_SkinInfo_ID_fk + references SkinInfo + on delete restrict + ); - migrationBuilder.CreateIndex( - name: "IX_Settings_SkinInfoID", - table: "Settings", - column: "SkinInfoID"); + insert into Settings_dg_tmp(ID, Key, RulesetID, Value, Variant) select ID, Key, RulesetID, Value, Variant from Settings; - // unsupported by sqlite + drop table Settings; - // migrationBuilder.AddForeignKey( - // name: "FK_Settings_SkinInfo_SkinInfoID", - // table: "Settings", - // column: "SkinInfoID", - // principalTable: "SkinInfo", - // principalColumn: "ID", - // onDelete: ReferentialAction.Restrict); + alter table Settings_dg_tmp rename to Settings; + + create index IX_Settings_RulesetID_Variant + on Settings (RulesetID, Variant); + + create index Settings_SkinInfoID_index + on Settings (SkinInfoID); + + "); } protected override void Down(MigrationBuilder migrationBuilder) From ae438213a52d2a51586e7cd16e131cffa46bd052 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 6 Jun 2019 16:32:43 +0900 Subject: [PATCH 15/49] Remove secondary buffered container from slider body --- .../Objects/Drawables/Pieces/SliderBody.cs | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 25e1aebd18..33b3667c4f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -2,13 +2,10 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; -using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Lines; -using osu.Framework.Graphics.Primitives; using osuTK; using osuTK.Graphics; -using osuTK.Graphics.ES30; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { @@ -19,8 +16,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private readonly SliderPath path; protected Path Path => path; - private readonly BufferedContainer container; - public float PathRadius { get => path.PathRadius; @@ -44,8 +39,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; path.AccentColour = value; - - container.ForceRedraw(); } } @@ -61,8 +54,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; path.BorderColour = value; - - container.ForceRedraw(); } } @@ -78,23 +69,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; path.BorderSize = value; - - container.ForceRedraw(); } } - public Quad PathDrawQuad => container.ScreenSpaceDrawQuad; - protected SliderBody() { - InternalChild = container = new BufferedContainer - { - RelativeSizeAxes = Axes.Both, - CacheDrawnFrameBuffer = true, - Child = path = new SliderPath { Blending = BlendingMode.None } - }; - - container.Attach(RenderbufferInternalFormat.DepthComponent16); + InternalChild = path = new SliderPath(); } public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => path.ReceivePositionalInputAt(screenSpacePos); @@ -103,11 +83,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces /// Sets the vertices of the path which should be drawn by this . /// /// The vertices - protected void SetVertices(IReadOnlyList vertices) - { - path.Vertices = vertices; - container.ForceRedraw(); - } + protected void SetVertices(IReadOnlyList vertices) => path.Vertices = vertices; private class SliderPath : SmoothPath { From c7d0fcd42ad4b171b0f7b5e1c273fb1bcc08607a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 6 Jun 2019 16:33:14 +0900 Subject: [PATCH 16/49] Update drawnodes --- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 3 ++- osu.Game/Graphics/Backgrounds/Triangles.cs | 4 ++-- osu.Game/Rulesets/Mods/ModFlashlight.cs | 2 +- osu.Game/Screens/Menu/LogoVisualisation.cs | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 1b8fa0de01..1bc22da8ac 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -210,7 +210,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor Vector2 pos = parts[i].Position; float localTime = parts[i].Time; - texture.DrawQuad( + DrawQuad( + texture, new Quad(pos.X - size.X / 2, pos.Y - size.Y / 2, size.X, size.Y), DrawColourInfo.Colour, null, diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index e2c7693700..29113e0e2f 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -214,7 +214,6 @@ namespace osu.Game.Graphics.Backgrounds base.Draw(vertexAction); shader.Bind(); - texture.TextureGL.Bind(); Vector2 localInflationAmount = edge_smoothness * DrawInfo.MatrixInverse.ExtractScale().Xy; @@ -231,7 +230,8 @@ namespace osu.Game.Graphics.Backgrounds ColourInfo colourInfo = DrawColourInfo.Colour; colourInfo.ApplyChild(particle.Colour); - texture.DrawTriangle( + DrawTriangle( + texture, triangle, colourInfo, null, diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index e174a25df3..405d21c711 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -179,7 +179,7 @@ namespace osu.Game.Rulesets.Mods shader.GetUniform("flashlightSize").UpdateValue(ref flashlightSize); shader.GetUniform("flashlightDim").UpdateValue(ref flashlightDim); - Texture.WhitePixel.DrawQuad(screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction); + DrawQuad(Texture.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction); shader.Unbind(); } diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 2925689d20..c6de5857c2 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -189,7 +189,6 @@ namespace osu.Game.Screens.Menu base.Draw(vertexAction); shader.Bind(); - texture.TextureGL.Bind(); Vector2 inflation = DrawInfo.MatrixInverse.ExtractScale().Xy; @@ -224,7 +223,8 @@ namespace osu.Game.Screens.Menu Vector2Extensions.Transform(barPosition + bottomOffset + amplitudeOffset, DrawInfo.Matrix) ); - texture.DrawQuad( + DrawQuad( + texture, rectangle, colourInfo, null, From 4d035afcc6f93d808c28f4ebec36b26be2f1aee5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 6 Jun 2019 16:49:42 +0900 Subject: [PATCH 17/49] Add setting to bypass front-to-back --- osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs index b671d0e0fd..f063898a9f 100644 --- a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs @@ -31,6 +31,11 @@ namespace osu.Game.Overlays.Settings.Sections.Debug LabelText = "Bypass caching (slow)", Bindable = config.GetBindable(DebugSetting.BypassCaching) }, + new SettingsCheckbox + { + LabelText = "Bypass front-to-back render pass", + Bindable = config.GetBindable(DebugSetting.BypassFrontToBackPass) + } }; } } From ac9a3e54a60bf1e97977fb9a9fad2f6c4e5be28b Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 6 Jun 2019 18:07:19 +0900 Subject: [PATCH 18/49] Fix cursor issue with stopped gameplay clock --- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 1b8fa0de01..341975c167 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -54,7 +54,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor for (int i = 0; i < max_sprites; i++) { - parts[i].InvalidationID = 0; + // InvalidationID 1 forces an update of each part of the cursor trail the first time ApplyState is ran on the draw node + parts[i].InvalidationID = 1; parts[i].WasUpdated = true; } } From 2a90af1d4e785e2d5cdf37c93243ed027257dbcf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 6 Jun 2019 19:15:51 +0900 Subject: [PATCH 19/49] Update readme with direct download links --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index abddb1faa1..91ea34e999 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ This project is still heavily under development, but is in a state where users a We are accepting bug reports (please report with as much detail as possible). Feature requests are welcome as long as you read and understand the contribution guidelines listed below. +Detailed changelogs are published on the [official osu! site](https://osu.ppy.sh/home/changelog). + ## Requirements - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. @@ -20,17 +22,24 @@ We are accepting bug reports (please report with as much detail as possible). Fe ### Releases -If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. +![](https://puu.sh/DCmvA/f6a74f5fbb.png) -- Windows (x64) users should download and run `install.exe`. -- macOS users (10.12 "Sierra" and higher) should download and run `osu.app.zip`. -- iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). +If you are not interested in developing the game, you can consume our [binary releases](https://github.com/ppy/osu/releases). + +**Latest build:*** + +| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | +| ------------- | ------------- | + +- **Linux** users are recommended to self-compile until we have official deployment in place. +- **iOS** users can join the [TestFlight beta program](https://t.co/xQJmHkfC18) (note that due to high demand this is reulgarly full). +- **Android** users can self-compile, and expect a public beta soon. If your platform is not listed above, there is still a chance you can manually build it by following the instructions below. ### Downloading the source code -Clone the repository **including submodules**: +Clone the repository: ```shell git clone https://github.com/ppy/osu @@ -45,7 +54,7 @@ git pull ### Building -Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this provided below. +Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this provided [below](#contributing). > Visual Studio Code users must run the `Restore` task before any build attempt. From 6bf6e221491f95b1bb0b44e87cb22e0530ff948f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 6 Jun 2019 20:33:03 +0900 Subject: [PATCH 20/49] Update framework --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f84bb64fbf..55fa20188c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -15,7 +15,7 @@ - + From 8c1a62536cb15a559befbff2383259b687b39454 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 6 Jun 2019 21:13:01 +0900 Subject: [PATCH 21/49] Update framework --- osu.iOS.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.iOS.props b/osu.iOS.props index fc047aa5f0..68f21df8ba 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -105,8 +105,8 @@ - - + + From 210437042fa0b7ee8613f52059c3c4c94f353706 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 7 Jun 2019 02:39:36 +0300 Subject: [PATCH 22/49] Remove useless update calls in ToolbarRulesetSelector --- osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs index 84a41b6547..90412ec1d1 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs @@ -31,6 +31,7 @@ namespace osu.Game.Overlays.Toolbar public ToolbarRulesetSelector() { RelativeSizeAxes = Axes.Y; + AutoSizeAxes = Axes.X; Children = new[] { @@ -111,12 +112,6 @@ namespace osu.Game.Overlays.Toolbar private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); - protected override void Update() - { - base.Update(); - Size = new Vector2(modeButtons.DrawSize.X, 1); - } - private void rulesetChanged(ValueChangedEvent e) { foreach (ToolbarRulesetButton m in modeButtons.Children.Cast()) From e2118299e93ac4e657c1994d09a7617ca262bbe5 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Fri, 7 Jun 2019 10:36:36 +0900 Subject: [PATCH 23/49] update comment --- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 341975c167..888c77442f 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -54,7 +54,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor for (int i = 0; i < max_sprites; i++) { - // InvalidationID 1 forces an update of each part of the cursor trail the first time ApplyState is ran on the draw node + // InvalidationID 1 forces an update of each part of the cursor trail the first time ApplyState is run on the draw node + // This is to prevent garbage data from being sent to the vertex shader, resulting in visual issues on some platforms parts[i].InvalidationID = 1; parts[i].WasUpdated = true; } From 9f740f69bb8ab61459dc72bd7c6dce4062e78759 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 11:20:39 +0900 Subject: [PATCH 24/49] Fix preview tracks muting themselves Closes #4937 --- osu.Game/Audio/PreviewTrackManager.cs | 57 ++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/osu.Game/Audio/PreviewTrackManager.cs b/osu.Game/Audio/PreviewTrackManager.cs index d479483508..6e162ca95e 100644 --- a/osu.Game/Audio/PreviewTrackManager.cs +++ b/osu.Game/Audio/PreviewTrackManager.cs @@ -1,6 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Track; @@ -12,22 +16,24 @@ using osu.Game.Beatmaps; namespace osu.Game.Audio { - /// - /// A central store for the retrieval of s. - /// public class PreviewTrackManager : Component { private readonly BindableDouble muteBindable = new BindableDouble(); private AudioManager audio; - private ITrackStore trackStore; + private PreviewTrackStore trackStore; private TrackManagerPreviewTrack current; [BackgroundDependencyLoader] private void load(AudioManager audio, FrameworkConfigManager config) { - trackStore = audio.GetTrackStore(new OnlineStore()); + // this is a temporary solution to get around muting ourselves. + // todo: update this once we have a BackgroundTrackManager or similar. + trackStore = new PreviewTrackStore(new OnlineStore()); + + audio.AddItem(trackStore); + trackStore.AddAdjustment(AdjustableProperty.Volume, audio.VolumeTrack); this.audio = audio; @@ -103,5 +109,46 @@ namespace osu.Game.Audio protected override Track GetTrack() => trackManager.Get($"https://b.ppy.sh/preview/{beatmapSetInfo?.OnlineBeatmapSetID}.mp3"); } + + private class PreviewTrackStore : AudioCollectionManager, ITrackStore + { + private readonly IResourceStore store; + + internal PreviewTrackStore(IResourceStore store) + { + this.store = store; + } + + public Track GetVirtual(double length = double.PositiveInfinity) + { + if (IsDisposed) throw new ObjectDisposedException($"Cannot retrieve items for an already disposed {nameof(PreviewTrackStore)}"); + + var track = new TrackVirtual(length); + AddItem(track); + return track; + } + + public Track Get(string name) + { + if (IsDisposed) throw new ObjectDisposedException($"Cannot retrieve items for an already disposed {nameof(PreviewTrackStore)}"); + + if (string.IsNullOrEmpty(name)) return null; + + var dataStream = store.GetStream(name); + + if (dataStream == null) + return null; + + Track track = new TrackBass(dataStream); + AddItem(track); + return track; + } + + public Task GetAsync(string name) => Task.Run(() => Get(name)); + + public Stream GetStream(string name) => store.GetStream(name); + + public IEnumerable GetAvailableResources() => store.GetAvailableResources(); + } } } From 64d5aa318fd7baa6c5610e849cd9f7568ab7ae09 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 11:45:58 +0900 Subject: [PATCH 25/49] Apply rebased changes --- .../TestSceneOsuHoverContainer.cs | 216 ++++++++++++++++++ .../Graphics/Containers/OsuHoverContainer.cs | 30 ++- 2 files changed, 234 insertions(+), 12 deletions(-) create mode 100644 osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs new file mode 100644 index 0000000000..9fe1a4cd89 --- /dev/null +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs @@ -0,0 +1,216 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osuTK; +using osuTK.Graphics; + +namespace osu.Game.Tests.Visual.UserInterface +{ + [TestFixture] + public class TestSceneOsuHoverContainer : ManualInputManagerTestScene + { + private OsuHoverTestContainer hoverContainer; + private OsuSpriteText textContainer; + private ColourInfo currentColour => textContainer.DrawColourInfo.Colour; + private ColourInfo idleColour => hoverContainer.IdleColourPublic; + private ColourInfo hoverColour => hoverContainer.HoverColourPublic; + + public TestSceneOsuHoverContainer() + { + setupUI(); + } + + [SetUp] + public void TestSceneOsuHoverContainer_SetUp() => Schedule(() => setupUI()); + + private void setupUI() + { + Child = hoverContainer = new OsuHoverTestContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Child = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Children = new[] + { + textContainer = new OsuSpriteText + { + Text = "Test", + Font = OsuFont.GetFont(weight: FontWeight.Medium, size: 20), + }, + } + } + }; + } + + [Description("Checks IsHovered property value on a container when it is hovered/unhovered.")] + [TestCase(true, TestName = "Enabled_Check_IsHovered")] + [TestCase(false, TestName = "Disabled_Check_IsHovered")] + public void Check_IsHovered_HasProperValue(bool isEnabled) + { + moveOut(); + setContainerEnabledTo(isEnabled); + + checkNotHovered(); + + moveToText(); + checkHovered(); + + moveOut(); + checkNotHovered(); + + moveToText(); + checkHovered(); + + moveOut(); + checkNotHovered(); + + ReturnUserInput(); + } + + [Test] + [Description("Checks colour fading on an enabled container when it is hovered/unhovered.")] + public void WhenEnabled_Fades() + { + moveOut(); + enableContainer(); + + checkColour(idleColour); + + moveToText(); + waitUntilColourIs(hoverColour); + + moveOut(); + waitUntilColourIs(idleColour); + + moveToText(); + waitUntilColourIs(hoverColour); + + moveOut(); + waitUntilColourIs(idleColour); + + ReturnUserInput(); + } + + [Test] + [Description("Checks colour fading on a disabled container when it is hovered/unhovered.")] + public void WhenDisabled_DoesNotFade() + { + moveOut(); + disableContainer(); + + checkColour(idleColour); + + moveToText(); + checkColour(idleColour); + + moveOut(); + checkColour(idleColour); + + moveToText(); + checkColour(idleColour); + + moveOut(); + checkColour(idleColour); + + ReturnUserInput(); + } + + [Test] + [Description("Checks that when a disabled & hovered container gets enabled, colour fading happens")] + public void WhileHovering_WhenGetsEnabled_Fades() + { + moveOut(); + disableContainer(); + checkColour(idleColour); + + moveToText(); + checkColour(idleColour); + + enableContainer(); + waitUntilColourIs(hoverColour); + } + + [Test] + [Description("Checks that when an enabled & hovered container gets disabled, colour fading happens")] + public void WhileHovering_WhenGetsDisabled_Fades() + { + moveOut(); + enableContainer(); + checkColour(idleColour); + + moveToText(); + waitUntilColourIs(hoverColour); + + disableContainer(); + waitUntilColourIs(idleColour); + } + + [Test] + [Description("Checks that when a hovered container gets enabled and disabled multiple times, colour fading happens")] + public void WhileHovering_WhenEnabledChangesMultipleTimes_Fades() + { + moveOut(); + enableContainer(); + checkColour(idleColour); + + moveToText(); + waitUntilColourIs(hoverColour); + + disableContainer(); + waitUntilColourIs(idleColour); + + enableContainer(); + waitUntilColourIs(hoverColour); + + disableContainer(); + waitUntilColourIs(idleColour); + } + + private void enableContainer() => setContainerEnabledTo(true); + + private void disableContainer() => setContainerEnabledTo(false); + + private void setContainerEnabledTo(bool newValue) + { + string word = newValue ? "Enable" : "Disable"; + AddStep($"{word} container", () => hoverContainer.Enabled.Value = newValue); + } + + private void moveToText() => AddStep("Move mouse to text", () => InputManager.MoveMouseTo(hoverContainer)); + + private void moveOut() => AddStep("Move out", doMoveOut); + + private void checkHovered() => AddAssert("Check hovered", () => hoverContainer.IsHovered); + + private void checkNotHovered() => AddAssert("Check not hovered", () => !hoverContainer.IsHovered); + + private void checkColour(ColourInfo expectedColour) + => AddAssert($"Check colour to be '{expectedColour}'", () => currentColour.Equals(expectedColour)); + + private void waitUntilColourIs(ColourInfo expectedColour) + => AddUntilStep($"Wait until hover colour is {expectedColour}", () => currentColour.Equals(expectedColour)); + + /// + /// Moves the cursor to top left corner of the screen + /// + private void doMoveOut() + => InputManager.MoveMouseTo(new Vector2(InputManager.ScreenSpaceDrawQuad.TopLeft.X, InputManager.ScreenSpaceDrawQuad.TopLeft.Y)); + + private sealed class OsuHoverTestContainer : OsuHoverContainer + { + public Color4 HoverColourPublic => HoverColour; + public Color4 IdleColourPublic => IdleColour; + } + } +} diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index 0e4a5ae5c0..4ea28f74b9 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -24,11 +24,13 @@ namespace osu.Game.Graphics.Containers { Enabled.ValueChanged += e => { - if (e.NewValue && isHovered) - fadeIn(); - - if (!e.NewValue) - unhover(); + if (isHovered) + { + if (e.NewValue) + fadeIn(); + else + fadeOut(); + } }; } @@ -36,6 +38,9 @@ namespace osu.Game.Graphics.Containers protected override bool OnHover(HoverEvent e) { + if (isHovered) + return false; + isHovered = true; if (!Enabled.Value) @@ -47,18 +52,14 @@ namespace osu.Game.Graphics.Containers } protected override void OnHoverLost(HoverLostEvent e) - { - unhover(); - base.OnHoverLost(e); - } - - private void unhover() { if (!isHovered) return; isHovered = false; - EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint)); + fadeOut(); + + base.OnHoverLost(e); } [BackgroundDependencyLoader] @@ -78,5 +79,10 @@ namespace osu.Game.Graphics.Containers { EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint)); } + + private void fadeOut() + { + EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint)); + } } } From 694f2e3a4f9e5902d685b9d7cac0de42d5546384 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 11:59:07 +0900 Subject: [PATCH 26/49] Tidy up test scene's setup usage --- .../TestSceneOsuHoverContainer.cs | 77 +++++++++---------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs index 9fe1a4cd89..79aa6189af 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs @@ -20,18 +20,9 @@ namespace osu.Game.Tests.Visual.UserInterface private OsuHoverTestContainer hoverContainer; private OsuSpriteText textContainer; private ColourInfo currentColour => textContainer.DrawColourInfo.Colour; - private ColourInfo idleColour => hoverContainer.IdleColourPublic; - private ColourInfo hoverColour => hoverContainer.HoverColourPublic; - - public TestSceneOsuHoverContainer() - { - setupUI(); - } [SetUp] - public void TestSceneOsuHoverContainer_SetUp() => Schedule(() => setupUI()); - - private void setupUI() + public void SetUp() => Schedule(() => { Child = hoverContainer = new OsuHoverTestContainer { @@ -51,12 +42,12 @@ namespace osu.Game.Tests.Visual.UserInterface } } }; - } + }); [Description("Checks IsHovered property value on a container when it is hovered/unhovered.")] [TestCase(true, TestName = "Enabled_Check_IsHovered")] [TestCase(false, TestName = "Disabled_Check_IsHovered")] - public void Check_IsHovered_HasProperValue(bool isEnabled) + public void TestIsHoveredHasProperValue(bool isEnabled) { moveOut(); setContainerEnabledTo(isEnabled); @@ -80,101 +71,101 @@ namespace osu.Game.Tests.Visual.UserInterface [Test] [Description("Checks colour fading on an enabled container when it is hovered/unhovered.")] - public void WhenEnabled_Fades() + public void TestTransitionWhileEnabled() { moveOut(); enableContainer(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - waitUntilColourIs(hoverColour); + waitUntilColourIs(OsuHoverTestContainer.HOVER_COLOUR); moveOut(); - waitUntilColourIs(idleColour); + waitUntilColourIs(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - waitUntilColourIs(hoverColour); + waitUntilColourIs(OsuHoverTestContainer.HOVER_COLOUR); moveOut(); - waitUntilColourIs(idleColour); + waitUntilColourIs(OsuHoverTestContainer.IDLE_COLOUR); ReturnUserInput(); } [Test] [Description("Checks colour fading on a disabled container when it is hovered/unhovered.")] - public void WhenDisabled_DoesNotFade() + public void TestNoTransitionWhileDisabled() { moveOut(); disableContainer(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveOut(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveOut(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); ReturnUserInput(); } [Test] [Description("Checks that when a disabled & hovered container gets enabled, colour fading happens")] - public void WhileHovering_WhenGetsEnabled_Fades() + public void TestBecomesEnabledTransition() { moveOut(); disableContainer(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); enableContainer(); - waitUntilColourIs(hoverColour); + waitUntilColourIs(OsuHoverTestContainer.HOVER_COLOUR); } [Test] [Description("Checks that when an enabled & hovered container gets disabled, colour fading happens")] - public void WhileHovering_WhenGetsDisabled_Fades() + public void TestBecomesDisabledTransition() { moveOut(); enableContainer(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - waitUntilColourIs(hoverColour); + waitUntilColourIs(OsuHoverTestContainer.HOVER_COLOUR); disableContainer(); - waitUntilColourIs(idleColour); + waitUntilColourIs(OsuHoverTestContainer.IDLE_COLOUR); } [Test] [Description("Checks that when a hovered container gets enabled and disabled multiple times, colour fading happens")] - public void WhileHovering_WhenEnabledChangesMultipleTimes_Fades() + public void TestDisabledChangesMultipleTimes() { moveOut(); enableContainer(); - checkColour(idleColour); + checkColour(OsuHoverTestContainer.IDLE_COLOUR); moveToText(); - waitUntilColourIs(hoverColour); + waitUntilColourIs(OsuHoverTestContainer.HOVER_COLOUR); disableContainer(); - waitUntilColourIs(idleColour); + waitUntilColourIs(OsuHoverTestContainer.IDLE_COLOUR); enableContainer(); - waitUntilColourIs(hoverColour); + waitUntilColourIs(OsuHoverTestContainer.HOVER_COLOUR); disableContainer(); - waitUntilColourIs(idleColour); + waitUntilColourIs(OsuHoverTestContainer.IDLE_COLOUR); } private void enableContainer() => setContainerEnabledTo(true); @@ -209,8 +200,14 @@ namespace osu.Game.Tests.Visual.UserInterface private sealed class OsuHoverTestContainer : OsuHoverContainer { - public Color4 HoverColourPublic => HoverColour; - public Color4 IdleColourPublic => IdleColour; + public static readonly Color4 HOVER_COLOUR = Color4.Red; + public static readonly Color4 IDLE_COLOUR = Color4.Green; + + public OsuHoverTestContainer() + { + HoverColour = HOVER_COLOUR; + IdleColour = IDLE_COLOUR; + } } } } From 58174425eda10e15e64f39f5ce4f6165ea8d4045 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 12:37:10 +0900 Subject: [PATCH 27/49] Make visual test more visible --- .../TestSceneOsuHoverContainer.cs | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs index 79aa6189af..6b2bca9b83 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs @@ -4,11 +4,8 @@ using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; +using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; -using osu.Game.Graphics.Sprites; using osuTK; using osuTK.Graphics; @@ -18,8 +15,7 @@ namespace osu.Game.Tests.Visual.UserInterface public class TestSceneOsuHoverContainer : ManualInputManagerTestScene { private OsuHoverTestContainer hoverContainer; - private OsuSpriteText textContainer; - private ColourInfo currentColour => textContainer.DrawColourInfo.Colour; + private Box colourContainer; [SetUp] public void SetUp() => Schedule(() => @@ -28,19 +24,11 @@ namespace osu.Game.Tests.Visual.UserInterface { Anchor = Anchor.Centre, Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Child = new FillFlowContainer + Size = new Vector2(100), + Child = colourContainer = new Box { - AutoSizeAxes = Axes.Both, - Children = new[] - { - textContainer = new OsuSpriteText - { - Text = "Test", - Font = OsuFont.GetFont(weight: FontWeight.Medium, size: 20), - }, - } - } + RelativeSizeAxes = Axes.Both, + }, }; }); @@ -192,6 +180,8 @@ namespace osu.Game.Tests.Visual.UserInterface private void waitUntilColourIs(ColourInfo expectedColour) => AddUntilStep($"Wait until hover colour is {expectedColour}", () => currentColour.Equals(expectedColour)); + private ColourInfo currentColour => colourContainer.DrawColourInfo.Colour; + /// /// Moves the cursor to top left corner of the screen /// From 748c0e5c012e266dd4ca15f1c786de6654c3aefd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 12:42:01 +0900 Subject: [PATCH 28/49] Set default state of test to enabled --- .../Visual/UserInterface/TestSceneOsuHoverContainer.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs index 6b2bca9b83..3613122165 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs @@ -22,6 +22,7 @@ namespace osu.Game.Tests.Visual.UserInterface { Child = hoverContainer = new OsuHoverTestContainer { + Enabled = { Value = true }, Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(100), @@ -30,6 +31,8 @@ namespace osu.Game.Tests.Visual.UserInterface RelativeSizeAxes = Axes.Both, }, }; + + doMoveOut(); }); [Description("Checks IsHovered property value on a container when it is hovered/unhovered.")] @@ -37,7 +40,6 @@ namespace osu.Game.Tests.Visual.UserInterface [TestCase(false, TestName = "Disabled_Check_IsHovered")] public void TestIsHoveredHasProperValue(bool isEnabled) { - moveOut(); setContainerEnabledTo(isEnabled); checkNotHovered(); @@ -61,7 +63,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Description("Checks colour fading on an enabled container when it is hovered/unhovered.")] public void TestTransitionWhileEnabled() { - moveOut(); enableContainer(); checkColour(OsuHoverTestContainer.IDLE_COLOUR); @@ -85,7 +86,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Description("Checks colour fading on a disabled container when it is hovered/unhovered.")] public void TestNoTransitionWhileDisabled() { - moveOut(); disableContainer(); checkColour(OsuHoverTestContainer.IDLE_COLOUR); @@ -109,7 +109,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Description("Checks that when a disabled & hovered container gets enabled, colour fading happens")] public void TestBecomesEnabledTransition() { - moveOut(); disableContainer(); checkColour(OsuHoverTestContainer.IDLE_COLOUR); @@ -124,7 +123,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Description("Checks that when an enabled & hovered container gets disabled, colour fading happens")] public void TestBecomesDisabledTransition() { - moveOut(); enableContainer(); checkColour(OsuHoverTestContainer.IDLE_COLOUR); @@ -139,7 +137,6 @@ namespace osu.Game.Tests.Visual.UserInterface [Description("Checks that when a hovered container gets enabled and disabled multiple times, colour fading happens")] public void TestDisabledChangesMultipleTimes() { - moveOut(); enableContainer(); checkColour(OsuHoverTestContainer.IDLE_COLOUR); From 6f6b134ec8266c2d7ea5931052261d29ea7ad9c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 12:52:49 +0900 Subject: [PATCH 29/49] Remove return user input calls --- .../Visual/UserInterface/TestSceneOsuHoverContainer.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs index 3613122165..dbef7d1686 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneOsuHoverContainer.cs @@ -55,8 +55,6 @@ namespace osu.Game.Tests.Visual.UserInterface moveOut(); checkNotHovered(); - - ReturnUserInput(); } [Test] @@ -78,8 +76,6 @@ namespace osu.Game.Tests.Visual.UserInterface moveOut(); waitUntilColourIs(OsuHoverTestContainer.IDLE_COLOUR); - - ReturnUserInput(); } [Test] @@ -101,8 +97,6 @@ namespace osu.Game.Tests.Visual.UserInterface moveOut(); checkColour(OsuHoverTestContainer.IDLE_COLOUR); - - ReturnUserInput(); } [Test] From 0fc2c596b650bedc892695e46926c47691810f4c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 12:53:51 +0900 Subject: [PATCH 30/49] Add toggle for input priority in manual input tests --- .../Visual/ManualInputManagerTestScene.cs | 92 ++++++++++++++++++- 1 file changed, 88 insertions(+), 4 deletions(-) diff --git a/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs b/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs index a7a7f88ff7..460df8b84c 100644 --- a/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs +++ b/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs @@ -3,8 +3,13 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Testing.Input; using osu.Game.Graphics.Cursor; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osuTK; +using osuTK.Graphics; namespace osu.Game.Tests.Visual { @@ -15,12 +20,77 @@ namespace osu.Game.Tests.Visual protected readonly ManualInputManager InputManager; + private readonly TriangleButton buttonTest; + private readonly TriangleButton buttonLocal; + protected ManualInputManagerTestScene() { - base.Content.Add(InputManager = new ManualInputManager + base.Content.AddRange(new Drawable[] { - UseParentInput = true, - Child = content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both }, + InputManager = new ManualInputManager + { + UseParentInput = true, + Child = content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both }, + }, + new Container + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Margin = new MarginPadding(5), + CornerRadius = 5, + Masking = true, + Children = new Drawable[] + { + new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + Alpha = 0.5f, + }, + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Margin = new MarginPadding(5), + Spacing = new Vector2(5), + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Text = "Input Priority" + }, + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Margin = new MarginPadding(5), + Spacing = new Vector2(5), + Direction = FillDirection.Horizontal, + + Children = new Drawable[] + { + buttonLocal = new TriangleButton + { + Text = "local", + Size = new Vector2(50, 30), + Action = returnUserInput + }, + buttonTest = new TriangleButton + { + Text = "test", + Size = new Vector2(50, 30), + Action = returnTestInput + }, + } + }, + } + }, + } + }, }); } @@ -29,7 +99,21 @@ namespace osu.Game.Tests.Visual /// protected void ReturnUserInput() { - AddStep("Return user input", () => InputManager.UseParentInput = true); + AddStep("Return user input", returnUserInput); } + + protected override void Update() + { + base.Update(); + + buttonTest.Enabled.Value = InputManager.UseParentInput; + buttonLocal.Enabled.Value = !InputManager.UseParentInput; + } + + private void returnUserInput() => + InputManager.UseParentInput = true; + + private void returnTestInput() => + InputManager.UseParentInput = false; } } From 1374da7c41b1f364b4012d047d6df7e2ed18de07 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 12:54:57 +0900 Subject: [PATCH 31/49] Remove all calls to return user input --- osu.Game.Tests/Visual/UserInterface/TestSceneCursors.cs | 1 - osu.Game/Tests/Visual/ManualInputManagerTestScene.cs | 8 -------- 2 files changed, 9 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneCursors.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneCursors.cs index 590ee4e720..8fe31b7ad6 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneCursors.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneCursors.cs @@ -84,7 +84,6 @@ namespace osu.Game.Tests.Visual.UserInterface testLocalCursor(); testUserCursorOverride(); testMultipleLocalCursors(); - ReturnUserInput(); } /// diff --git a/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs b/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs index 460df8b84c..86191609a4 100644 --- a/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs +++ b/osu.Game/Tests/Visual/ManualInputManagerTestScene.cs @@ -94,14 +94,6 @@ namespace osu.Game.Tests.Visual }); } - /// - /// Returns input back to the user. - /// - protected void ReturnUserInput() - { - AddStep("Return user input", returnUserInput); - } - protected override void Update() { base.Update(); From 60b70c0f45e11d7114d1769b62f8ef4f1e06c40a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 14:11:21 +0900 Subject: [PATCH 32/49] Use lambda for simple functions --- osu.Game/Graphics/Containers/OsuHoverContainer.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index 4ea28f74b9..67af79c763 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -75,14 +75,8 @@ namespace osu.Game.Graphics.Containers EffectTargets.ForEach(d => d.FadeColour(IdleColour)); } - private void fadeIn() - { - EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint)); - } + private void fadeIn() => EffectTargets.ForEach(d => d.FadeColour(HoverColour, FADE_DURATION, Easing.OutQuint)); - private void fadeOut() - { - EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint)); - } + private void fadeOut() => EffectTargets.ForEach(d => d.FadeColour(IdleColour, FADE_DURATION, Easing.OutQuint)); } } From 2531250f890245d4df9b8f70b666304027b3faea Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 14:58:04 +0900 Subject: [PATCH 33/49] Fix paginated layouts only showing one column even if enough space is available for more --- osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs index 8639acfc94..b459afcb49 100644 --- a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs @@ -49,7 +49,6 @@ namespace osu.Game.Overlays.Profile.Sections { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FillDirection.Vertical, Spacing = new Vector2(0, 2), }, MoreButton = new ShowMoreButton From 0ce5c7468fcf155dea67469182fae578abecdaf7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 15:31:23 +0900 Subject: [PATCH 34/49] Use switch and consume/block input --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index a7ba87e72a..501679af03 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -197,10 +197,16 @@ namespace osu.Game.Overlays.Mods protected override bool OnKeyDown(KeyDownEvent e) { - if (e.Key == Key.Number1) - DeselectAllButton.Click(); - else if (e.Key == Key.Number2) - CloseButton.Click(); + switch (e.Key) + { + case Key.Number1: + DeselectAllButton.Click(); + return true; + + case Key.Number2: + CloseButton.Click(); + return true; + } return base.OnKeyDown(e); } From b914bb1e2eb9aa0c451addd8d60d076d15e64f9d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 15:32:48 +0900 Subject: [PATCH 35/49] Remove key hints for now A proper design for this will come in the future. --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 501679af03..0e37e800ca 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -376,7 +376,7 @@ namespace osu.Game.Overlays.Mods DeselectAllButton = new TriangleButton { Width = 180, - Text = "1. Deselect All", + Text = "Deselect All", Action = DeselectAll, Margin = new MarginPadding { @@ -386,7 +386,7 @@ namespace osu.Game.Overlays.Mods CloseButton = new TriangleButton { Width = 180, - Text = "2. Close", + Text = "Close", Action = Hide, Margin = new MarginPadding { From 8f30c9b0a3ec210f6af2cd4e3f8353adda90a740 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 15:58:24 +0900 Subject: [PATCH 36/49] Fix file layout of ModSelectOverlay --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 365 +++++++++++---------- 1 file changed, 186 insertions(+), 179 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index b57e98d09e..dec58f4c9e 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -1,43 +1,40 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osuTK; -using osuTK.Input; -using osuTK.Graphics; -using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Game.Graphics; -using osu.Game.Graphics.Backgrounds; -using osu.Game.Graphics.Sprites; -using osu.Game.Rulesets.Mods; using System; using System.Collections.Generic; using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Bindables; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.Events; +using osu.Game.Graphics; +using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Containers; -using osu.Game.Rulesets; +using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Mods.Sections; +using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; using osu.Game.Screens; -using osu.Framework.Input.Events; +using osuTK; +using osuTK.Graphics; +using osuTK.Input; namespace osu.Game.Overlays.Mods { public class ModSelectOverlay : WaveOverlayContainer { - private const float content_width = 0.8f; - - protected Color4 LowMultiplierColour, HighMultiplierColour; - protected readonly TriangleButton DeselectAllButton; protected readonly TriangleButton CloseButton; - protected readonly OsuSpriteText MultiplierLabel, UnrankedLabel; - private readonly FillFlowContainer footerContainer; + + protected readonly OsuSpriteText MultiplierLabel; + protected readonly OsuSpriteText UnrankedLabel; protected override bool BlockNonPositionalInput => false; @@ -49,170 +46,14 @@ namespace osu.Game.Overlays.Mods protected readonly IBindable Ruleset = new Bindable(); - [BackgroundDependencyLoader(true)] - private void load(OsuColour colours, IBindable ruleset, AudioManager audio, Bindable> mods) - { - LowMultiplierColour = colours.Red; - HighMultiplierColour = colours.Green; - UnrankedLabel.Colour = colours.Blue; + protected Color4 LowMultiplierColour; + protected Color4 HighMultiplierColour; - Ruleset.BindTo(ruleset); - if (mods != null) SelectedMods.BindTo(mods); - - sampleOn = audio.Samples.Get(@"UI/check-on"); - sampleOff = audio.Samples.Get(@"UI/check-off"); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - Ruleset.BindValueChanged(rulesetChanged, true); - SelectedMods.BindValueChanged(selectedModsChanged, true); - } - - protected override void Dispose(bool isDisposing) - { - base.Dispose(isDisposing); - - Ruleset.UnbindAll(); - SelectedMods.UnbindAll(); - } - - private void rulesetChanged(ValueChangedEvent e) - { - if (e.NewValue == null) return; - - var instance = e.NewValue.CreateInstance(); - - foreach (ModSection section in ModSectionsContainer.Children) - section.Mods = instance.GetModsFor(section.ModType); - - // attempt to re-select any already selected mods. - // this may be the first time we are receiving the ruleset, in which case they will still match. - selectedModsChanged(new ValueChangedEvent>(SelectedMods.Value, SelectedMods.Value)); - - // write the mods back to the SelectedMods bindable in the case a change was not applicable. - // this generally isn't required as the previous line will perform deselection; just here for safety. - refreshSelectedMods(); - } - - private void selectedModsChanged(ValueChangedEvent> e) - { - foreach (ModSection section in ModSectionsContainer.Children) - section.SelectTypes(e.NewValue.Select(m => m.GetType()).ToList()); - - updateMods(); - } - - private void updateMods() - { - double multiplier = 1.0; - bool ranked = true; - - foreach (Mod mod in SelectedMods.Value) - { - multiplier *= mod.ScoreMultiplier; - ranked &= mod.Ranked; - } - - MultiplierLabel.Text = $"{multiplier:N2}x"; - if (multiplier > 1.0) - MultiplierLabel.FadeColour(HighMultiplierColour, 200); - else if (multiplier < 1.0) - MultiplierLabel.FadeColour(LowMultiplierColour, 200); - else - MultiplierLabel.FadeColour(Color4.White, 200); - - UnrankedLabel.FadeTo(ranked ? 0 : 1, 200); - } - - protected override void PopOut() - { - base.PopOut(); - - footerContainer.MoveToX(footerContainer.DrawSize.X, WaveContainer.DISAPPEAR_DURATION, Easing.InSine); - footerContainer.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InSine); - - foreach (ModSection section in ModSectionsContainer.Children) - { - section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), WaveContainer.DISAPPEAR_DURATION, Easing.InSine); - section.ButtonsContainer.MoveToX(100f, WaveContainer.DISAPPEAR_DURATION, Easing.InSine); - section.ButtonsContainer.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InSine); - } - } - - protected override void PopIn() - { - base.PopIn(); - - footerContainer.MoveToX(0, WaveContainer.APPEAR_DURATION, Easing.OutQuint); - footerContainer.FadeIn(WaveContainer.APPEAR_DURATION, Easing.OutQuint); - - foreach (ModSection section in ModSectionsContainer.Children) - { - section.ButtonsContainer.TransformSpacingTo(new Vector2(50f, 0f), WaveContainer.APPEAR_DURATION, Easing.OutQuint); - section.ButtonsContainer.MoveToX(0, WaveContainer.APPEAR_DURATION, Easing.OutQuint); - section.ButtonsContainer.FadeIn(WaveContainer.APPEAR_DURATION, Easing.OutQuint); - } - } - - public void DeselectAll() - { - foreach (ModSection section in ModSectionsContainer.Children) - section.DeselectAll(); - - refreshSelectedMods(); - } - - /// - /// Deselect one or more mods. - /// - /// The types of s which should be deselected. - /// Set to true to bypass animations and update selections immediately. - public void DeselectTypes(Type[] modTypes, bool immediate = false) - { - if (modTypes.Length == 0) return; - - foreach (ModSection section in ModSectionsContainer.Children) - section.DeselectTypes(modTypes, immediate); - } + private const float content_width = 0.8f; + private readonly FillFlowContainer footerContainer; private SampleChannel sampleOn, sampleOff; - private void modButtonPressed(Mod selectedMod) - { - if (selectedMod != null) - { - if (State == Visibility.Visible) sampleOn?.Play(); - DeselectTypes(selectedMod.IncompatibleMods, true); - } - else - { - if (State == Visibility.Visible) sampleOff?.Play(); - } - - refreshSelectedMods(); - } - - protected override bool OnKeyDown(KeyDownEvent e) - { - switch (e.Key) - { - case Key.Number1: - DeselectAllButton.Click(); - return true; - - case Key.Number2: - CloseButton.Click(); - return true; - } - - return base.OnKeyDown(e); - } - - private void refreshSelectedMods() => SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); - public ModSelectOverlay() { Waves.FirstWaveColour = OsuColour.FromHex(@"19b0e2"); @@ -430,5 +271,171 @@ namespace osu.Game.Overlays.Mods }, }; } + + [BackgroundDependencyLoader(true)] + private void load(OsuColour colours, IBindable ruleset, AudioManager audio, Bindable> mods) + { + LowMultiplierColour = colours.Red; + HighMultiplierColour = colours.Green; + UnrankedLabel.Colour = colours.Blue; + + Ruleset.BindTo(ruleset); + if (mods != null) SelectedMods.BindTo(mods); + + sampleOn = audio.Samples.Get(@"UI/check-on"); + sampleOff = audio.Samples.Get(@"UI/check-off"); + } + + public void DeselectAll() + { + foreach (var section in ModSectionsContainer.Children) + section.DeselectAll(); + + refreshSelectedMods(); + } + + /// + /// Deselect one or more mods. + /// + /// The types of s which should be deselected. + /// Set to true to bypass animations and update selections immediately. + public void DeselectTypes(Type[] modTypes, bool immediate = false) + { + if (modTypes.Length == 0) return; + + foreach (var section in ModSectionsContainer.Children) + section.DeselectTypes(modTypes, immediate); + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Ruleset.BindValueChanged(rulesetChanged, true); + SelectedMods.BindValueChanged(selectedModsChanged, true); + } + + protected override void PopOut() + { + base.PopOut(); + + footerContainer.MoveToX(footerContainer.DrawSize.X, WaveContainer.DISAPPEAR_DURATION, Easing.InSine); + footerContainer.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InSine); + + foreach (var section in ModSectionsContainer.Children) + { + section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), WaveContainer.DISAPPEAR_DURATION, Easing.InSine); + section.ButtonsContainer.MoveToX(100f, WaveContainer.DISAPPEAR_DURATION, Easing.InSine); + section.ButtonsContainer.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InSine); + } + } + + protected override void PopIn() + { + base.PopIn(); + + footerContainer.MoveToX(0, WaveContainer.APPEAR_DURATION, Easing.OutQuint); + footerContainer.FadeIn(WaveContainer.APPEAR_DURATION, Easing.OutQuint); + + foreach (var section in ModSectionsContainer.Children) + { + section.ButtonsContainer.TransformSpacingTo(new Vector2(50f, 0f), WaveContainer.APPEAR_DURATION, Easing.OutQuint); + section.ButtonsContainer.MoveToX(0, WaveContainer.APPEAR_DURATION, Easing.OutQuint); + section.ButtonsContainer.FadeIn(WaveContainer.APPEAR_DURATION, Easing.OutQuint); + } + } + + protected override bool OnKeyDown(KeyDownEvent e) + { + switch (e.Key) + { + case Key.Number1: + DeselectAllButton.Click(); + return true; + + case Key.Number2: + CloseButton.Click(); + return true; + } + + return base.OnKeyDown(e); + } + + private void rulesetChanged(ValueChangedEvent e) + { + if (e.NewValue == null) return; + + var instance = e.NewValue.CreateInstance(); + + foreach (var section in ModSectionsContainer.Children) + section.Mods = instance.GetModsFor(section.ModType); + + // attempt to re-select any already selected mods. + // this may be the first time we are receiving the ruleset, in which case they will still match. + selectedModsChanged(new ValueChangedEvent>(SelectedMods.Value, SelectedMods.Value)); + + // write the mods back to the SelectedMods bindable in the case a change was not applicable. + // this generally isn't required as the previous line will perform deselection; just here for safety. + refreshSelectedMods(); + } + + private void selectedModsChanged(ValueChangedEvent> e) + { + foreach (var section in ModSectionsContainer.Children) + section.SelectTypes(e.NewValue.Select(m => m.GetType()).ToList()); + + updateMods(); + } + + private void updateMods() + { + var multiplier = 1.0; + var ranked = true; + + foreach (var mod in SelectedMods.Value) + { + multiplier *= mod.ScoreMultiplier; + ranked &= mod.Ranked; + } + + MultiplierLabel.Text = $"{multiplier:N2}x"; + if (multiplier > 1.0) + MultiplierLabel.FadeColour(HighMultiplierColour, 200); + else if (multiplier < 1.0) + MultiplierLabel.FadeColour(LowMultiplierColour, 200); + else + MultiplierLabel.FadeColour(Color4.White, 200); + + UnrankedLabel.FadeTo(ranked ? 0 : 1, 200); + } + + private void modButtonPressed(Mod selectedMod) + { + if (selectedMod != null) + { + if (State == Visibility.Visible) sampleOn?.Play(); + DeselectTypes(selectedMod.IncompatibleMods, true); + } + else + { + if (State == Visibility.Visible) sampleOff?.Play(); + } + + refreshSelectedMods(); + } + + private void refreshSelectedMods() => SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); + + #region Disposal + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + Ruleset.UnbindAll(); + SelectedMods.UnbindAll(); + } + + #endregion } } From cd4648a64729383356dcf0a26538126c902241ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 21:09:59 +0900 Subject: [PATCH 37/49] Update framework --- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 55fa20188c..654c62e1d8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -15,7 +15,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 68f21df8ba..8886184a2e 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -105,8 +105,8 @@ - - + + From e5b64bfa39df31f0db308655c943272e6c7b9348 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Fri, 7 Jun 2019 18:51:43 +0200 Subject: [PATCH 38/49] Highlight major changes in changelog overlay --- osu.Game/Overlays/Changelog/ChangelogBuild.cs | 51 ++++++++++++++++--- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Changelog/ChangelogBuild.cs b/osu.Game/Overlays/Changelog/ChangelogBuild.cs index 57615332da..627eb10426 100644 --- a/osu.Game/Overlays/Changelog/ChangelogBuild.cs +++ b/osu.Game/Overlays/Changelog/ChangelogBuild.cs @@ -69,34 +69,69 @@ namespace osu.Game.Overlays.Changelog Margin = new MarginPadding { Vertical = 5 }, }; + var entryColor = entry.Major != null && (bool)entry.Major ? OsuColour.FromHex("#fd5") : Color4.White; + title.AddIcon(FontAwesome.Solid.Check, t => { t.Font = fontSmall; + t.Colour = entryColor; t.Padding = new MarginPadding { Left = -17, Right = 5 }; }); - title.AddText(entry.Title, t => { t.Font = fontLarge; }); + title.AddText(entry.Title, t => + { + t.Font = fontLarge; + t.Colour = entryColor; + }); if (!string.IsNullOrEmpty(entry.Repository)) { - title.AddText(" (", t => t.Font = fontLarge); + title.AddText(" (", t => + { + t.Font = fontLarge; + t.Colour = entryColor; + }); title.AddLink($"{entry.Repository.Replace("ppy/", "")}#{entry.GithubPullRequestId}", entry.GithubUrl, Online.Chat.LinkAction.External, - creationParameters: t => { t.Font = fontLarge; }); - title.AddText(")", t => t.Font = fontLarge); + creationParameters: t => + { + t.Font = fontLarge; + t.Colour = entryColor; + }); + title.AddText(")", t => + { + t.Font = fontLarge; + t.Colour = entryColor; + }); } - title.AddText(" by ", t => t.Font = fontMedium); + title.AddText(" by ", t => + { + t.Font = fontMedium; + t.Colour = entryColor; + }); if (entry.GithubUser.UserId != null) title.AddUserLink(new User { Username = entry.GithubUser.OsuUsername, Id = entry.GithubUser.UserId.Value - }, t => t.Font = fontMedium); + }, t => + { + t.Font = fontMedium; + t.Colour = entryColor; + }); else if (entry.GithubUser.GithubUrl != null) - title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, Online.Chat.LinkAction.External, null, null, t => t.Font = fontMedium); + title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, Online.Chat.LinkAction.External, null, null, t => + { + t.Font = fontMedium; + t.Colour = entryColor; + }); else - title.AddText(entry.GithubUser.DisplayName, t => t.Font = fontSmall); + title.AddText(entry.GithubUser.DisplayName, t => + { + t.Font = fontSmall; + t.Colour = entryColor; + }); ChangelogEntries.Add(title); From 342e39776aaa5559401e86d2b6d656f01476acab Mon Sep 17 00:00:00 2001 From: Lucas A Date: Fri, 7 Jun 2019 20:59:56 +0200 Subject: [PATCH 39/49] Move ChangelogEntries populating logic from constructor to BDL load() to use OsuColour palette +apply review suggestions. --- osu.Game/Overlays/Changelog/ChangelogBuild.cs | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Changelog/ChangelogBuild.cs b/osu.Game/Overlays/Changelog/ChangelogBuild.cs index 627eb10426..ae5ba3fa4e 100644 --- a/osu.Game/Overlays/Changelog/ChangelogBuild.cs +++ b/osu.Game/Overlays/Changelog/ChangelogBuild.cs @@ -13,6 +13,7 @@ using System.Text.RegularExpressions; using osu.Game.Graphics.Sprites; using osu.Game.Users; using osuTK.Graphics; +using osu.Framework.Allocation; namespace osu.Game.Overlays.Changelog { @@ -45,8 +46,12 @@ namespace osu.Game.Overlays.Changelog Direction = FillDirection.Vertical, }, }; + } - foreach (var categoryEntries in build.ChangelogEntries.GroupBy(b => b.Category).OrderBy(c => c.Key)) + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + foreach (var categoryEntries in Build.ChangelogEntries.GroupBy(b => b.Category).OrderBy(c => c.Key)) { ChangelogEntries.Add(new OsuSpriteText { @@ -69,19 +74,19 @@ namespace osu.Game.Overlays.Changelog Margin = new MarginPadding { Vertical = 5 }, }; - var entryColor = entry.Major != null && (bool)entry.Major ? OsuColour.FromHex("#fd5") : Color4.White; + var entryColour = entry.Major != null && (bool)entry.Major ? colours.YellowLight : Color4.White; title.AddIcon(FontAwesome.Solid.Check, t => { t.Font = fontSmall; - t.Colour = entryColor; + t.Colour = entryColour; t.Padding = new MarginPadding { Left = -17, Right = 5 }; }); title.AddText(entry.Title, t => { t.Font = fontLarge; - t.Colour = entryColor; + t.Colour = entryColour; }); if (!string.IsNullOrEmpty(entry.Repository)) @@ -89,25 +94,25 @@ namespace osu.Game.Overlays.Changelog title.AddText(" (", t => { t.Font = fontLarge; - t.Colour = entryColor; + t.Colour = entryColour; }); title.AddLink($"{entry.Repository.Replace("ppy/", "")}#{entry.GithubPullRequestId}", entry.GithubUrl, Online.Chat.LinkAction.External, creationParameters: t => { t.Font = fontLarge; - t.Colour = entryColor; + t.Colour = entryColour; }); title.AddText(")", t => { t.Font = fontLarge; - t.Colour = entryColor; + t.Colour = entryColour; }); } title.AddText(" by ", t => { t.Font = fontMedium; - t.Colour = entryColor; + t.Colour = entryColour; }); if (entry.GithubUser.UserId != null) @@ -118,19 +123,19 @@ namespace osu.Game.Overlays.Changelog }, t => { t.Font = fontMedium; - t.Colour = entryColor; + t.Colour = entryColour; }); else if (entry.GithubUser.GithubUrl != null) title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, Online.Chat.LinkAction.External, null, null, t => { t.Font = fontMedium; - t.Colour = entryColor; + t.Colour = entryColour; }); else title.AddText(entry.GithubUser.DisplayName, t => { t.Font = fontSmall; - t.Colour = entryColor; + t.Colour = entryColour; }); ChangelogEntries.Add(title); From d058f7779308c20c667b796fd490c01317a3aad2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 8 Jun 2019 16:36:48 +0900 Subject: [PATCH 40/49] Update resources for iOS --- osu.iOS.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.iOS.props b/osu.iOS.props index 8886184a2e..3a5090d968 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -104,7 +104,7 @@ - + From e8c73f3127d953a0ca188f0e53b79066e847eb07 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sat, 8 Jun 2019 09:45:34 +0200 Subject: [PATCH 41/49] Make APIChangelogEntry.Major a non-nullable property --- osu.Game/Online/API/Requests/Responses/APIChangelogEntry.cs | 2 +- osu.Game/Overlays/Changelog/ChangelogBuild.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Online/API/Requests/Responses/APIChangelogEntry.cs b/osu.Game/Online/API/Requests/Responses/APIChangelogEntry.cs index abaff9b7ae..140e228acd 100644 --- a/osu.Game/Online/API/Requests/Responses/APIChangelogEntry.cs +++ b/osu.Game/Online/API/Requests/Responses/APIChangelogEntry.cs @@ -36,7 +36,7 @@ namespace osu.Game.Online.API.Requests.Responses public string MessageHtml { get; set; } [JsonProperty("major")] - public bool? Major { get; set; } + public bool Major { get; set; } [JsonProperty("created_at")] public DateTimeOffset? CreatedAt { get; set; } diff --git a/osu.Game/Overlays/Changelog/ChangelogBuild.cs b/osu.Game/Overlays/Changelog/ChangelogBuild.cs index ae5ba3fa4e..3d145af562 100644 --- a/osu.Game/Overlays/Changelog/ChangelogBuild.cs +++ b/osu.Game/Overlays/Changelog/ChangelogBuild.cs @@ -74,7 +74,7 @@ namespace osu.Game.Overlays.Changelog Margin = new MarginPadding { Vertical = 5 }, }; - var entryColour = entry.Major != null && (bool)entry.Major ? colours.YellowLight : Color4.White; + var entryColour = entry.Major ? colours.YellowLight : Color4.White; title.AddIcon(FontAwesome.Solid.Check, t => { From 383b937a7e44b2eac1f20ba7b1b1a6cfce0bfae2 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sat, 8 Jun 2019 19:10:00 +0300 Subject: [PATCH 42/49] Rename F grade to D --- osu.Game/Scoring/ScoreRank.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Scoring/ScoreRank.cs b/osu.Game/Scoring/ScoreRank.cs index a93d015f1b..d3479e21aa 100644 --- a/osu.Game/Scoring/ScoreRank.cs +++ b/osu.Game/Scoring/ScoreRank.cs @@ -7,10 +7,10 @@ namespace osu.Game.Scoring { public enum ScoreRank { - [Description(@"F")] + [Description(@"D")] F, - [Description(@"F")] + [Description(@"D")] D, [Description(@"C")] From 17362a368e2ab792c43e05cc992d6b729247b62e Mon Sep 17 00:00:00 2001 From: Ludde <48018938+yousef157@users.noreply.github.com> Date: Sat, 8 Jun 2019 20:10:52 +0400 Subject: [PATCH 43/49] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 91ea34e999..04f133fd56 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ If you are not interested in developing the game, you can consume our [binary re | ------------- | ------------- | - **Linux** users are recommended to self-compile until we have official deployment in place. -- **iOS** users can join the [TestFlight beta program](https://t.co/xQJmHkfC18) (note that due to high demand this is reulgarly full). +- **iOS** users can join the [TestFlight beta program](https://t.co/xQJmHkfC18) (note that due to high demand this is regularly full). - **Android** users can self-compile, and expect a public beta soon. If your platform is not listed above, there is still a chance you can manually build it by following the instructions below. From dfbc6528031fc340a9a718699db236172aeac207 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sat, 8 Jun 2019 19:32:26 +0300 Subject: [PATCH 44/49] Use ScoreRank.D instead of F --- osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 89da0fc254..cbcf3e6160 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -46,7 +46,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Text = "#1", Font = OsuFont.GetFont(size: 30, weight: FontWeight.Bold, italics: true) }, - rank = new DrawableRank(ScoreRank.F) + rank = new DrawableRank(ScoreRank.D) { Anchor = Anchor.Centre, Origin = Anchor.Centre, From d3ff2c6dd5bbc9a14653e9fa6a72bb0093f6d519 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sat, 8 Jun 2019 19:34:03 +0300 Subject: [PATCH 45/49] Use ScoreRank.D instead of F --- osu.Game.Tests/Visual/SongSelect/TestSceneLeaderboard.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneLeaderboard.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneLeaderboard.cs index 3d75470328..9365e2c5b1 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneLeaderboard.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneLeaderboard.cs @@ -188,7 +188,7 @@ namespace osu.Game.Tests.Visual.SongSelect }, new ScoreInfo { - Rank = ScoreRank.F, + Rank = ScoreRank.D, Accuracy = 0.6025, MaxCombo = 244, TotalScore = 1707827, @@ -206,7 +206,7 @@ namespace osu.Game.Tests.Visual.SongSelect }, new ScoreInfo { - Rank = ScoreRank.F, + Rank = ScoreRank.D, Accuracy = 0.5140, MaxCombo = 244, TotalScore = 1707827, @@ -224,7 +224,7 @@ namespace osu.Game.Tests.Visual.SongSelect }, new ScoreInfo { - Rank = ScoreRank.F, + Rank = ScoreRank.D, Accuracy = 0.4222, MaxCombo = 244, TotalScore = 1707827, From fc8644a73e0a8cf37e90ec199f2c4b5ac2b785c5 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sat, 8 Jun 2019 19:34:52 +0300 Subject: [PATCH 46/49] Use ScoreRank.D instead of F --- osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs b/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs index 6815018be6..2f88a4b01d 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs @@ -157,7 +157,7 @@ namespace osu.Game.Tests.Visual.Online FlagName = @"TH", }, }, - Rank = ScoreRank.F, + Rank = ScoreRank.D, PP = 160, MaxCombo = 1234, TotalScore = 123456, From a2b9dba92cce57e04a956efd1f4baa7906488373 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sat, 8 Jun 2019 19:35:29 +0300 Subject: [PATCH 47/49] Remove ScoreRank.F --- osu.Game/Scoring/ScoreRank.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Scoring/ScoreRank.cs b/osu.Game/Scoring/ScoreRank.cs index d3479e21aa..696d493830 100644 --- a/osu.Game/Scoring/ScoreRank.cs +++ b/osu.Game/Scoring/ScoreRank.cs @@ -7,9 +7,6 @@ namespace osu.Game.Scoring { public enum ScoreRank { - [Description(@"D")] - F, - [Description(@"D")] D, From 807d434be03898334671c6fd382cda252633d6c8 Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Sun, 9 Jun 2019 17:52:02 +0930 Subject: [PATCH 48/49] Access WindowModes via IBindableList --- osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 58d2eb1f1e..36c4fb5252 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics private Bindable scalingMode; private Bindable sizeFullscreen; - private readonly BindableList windowModes = new BindableList(); + private readonly IBindableList windowModes = new BindableList(); private OsuGameBase game; private SettingsDropdown resolutionDropdown; From a5007b94dbd1b66d97d461c830fb11ef6f784764 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 9 Jun 2019 22:29:00 +0900 Subject: [PATCH 49/49] Update resources --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 654c62e1d8..eeb1f2bee3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -14,7 +14,7 @@ - +