From 53bd3a1c30da076d254fc2570c1b5dd46591037a Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 18 Jun 2018 19:49:12 -0400 Subject: [PATCH 1/5] Add some default LengthLimit to OsuTextBox --- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 6021af2028..17a1be8879 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -32,6 +32,7 @@ namespace osu.Game.Graphics.UserInterface Height = 40; TextContainer.Height = 0.5f; CornerRadius = 5; + LengthLimit = 1000; Current.DisabledChanged += disabled => { From 77263bd56e9cc89cdd4fc53e6b2f6f1419584672 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 May 2019 18:11:32 +0900 Subject: [PATCH 2/5] Linkify more user links --- osu.Game/Overlays/Direct/DirectGridPanel.cs | 31 ++++++---------- .../Historical/DrawableMostPlayedRow.cs | 36 +++++-------------- 2 files changed, 18 insertions(+), 49 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index eb73a50f99..5756a4593d 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -15,6 +15,7 @@ using osu.Framework.Input.Events; using osu.Framework.Localisation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; +using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Direct { @@ -119,28 +120,16 @@ namespace osu.Game.Overlays.Direct }, Children = new Drawable[] { - new FillFlowContainer + new LinkFlowContainer(s => { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Children = new[] - { - new OsuSpriteText - { - Text = "mapped by ", - Font = OsuFont.GetFont(size: 14), - Shadow = false, - Colour = colours.Gray5, - }, - new OsuSpriteText - { - Text = SetInfo.Metadata.Author.Username, - Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true), - Shadow = false, - Colour = colours.BlueDark, - }, - }, - }, + s.Shadow = false; + s.Font = OsuFont.GetFont(size: 14); + }).With(d => + { + d.AutoSizeAxes = Axes.Both; + d.AddText("mapped by ", t => t.Colour = colours.Gray5); + d.AddUserLink(SetInfo.Metadata.Author); + }), new Container { AutoSizeAxes = Axes.X, diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs index b0609e685e..1b286f92d3 100644 --- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs @@ -17,7 +17,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical { private readonly BeatmapInfo beatmap; private readonly int playCount; - private OsuHoverContainer mapperContainer; public DrawableMostPlayedRow(BeatmapInfo beatmap, int playCount) { @@ -34,36 +33,20 @@ namespace osu.Game.Overlays.Profile.Sections.Historical CoverType = BeatmapSetCoverType.List, }; - [BackgroundDependencyLoader(true)] - private void load(UserProfileOverlay profileOverlay) + [BackgroundDependencyLoader] + private void load() { LeftFlowContainer.Add(new BeatmapMetadataContainer(beatmap)); - LeftFlowContainer.Add(new FillFlowContainer + LeftFlowContainer.Add(new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 12)) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, - Children = new Drawable[] - { - new OsuSpriteText - { - Text = @"mapped by ", - Font = OsuFont.GetFont(size: 12) - }, - mapperContainer = new OsuHoverContainer - { - AutoSizeAxes = Axes.Both, - Children = new Drawable[] - { - new OsuSpriteText - { - Text = beatmap.Metadata.AuthorString, - Font = OsuFont.GetFont(size: 12, weight: FontWeight.Medium, italics: true) - } - } - }, - } - }); + }.With(d => + { + d.AddText("mapped by "); + d.AddUserLink(beatmap.Metadata.Author); + })); RightFlowContainer.Add(new FillFlowContainer { @@ -89,9 +72,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical }, } }); - - if (profileOverlay != null) - mapperContainer.Action = () => profileOverlay.ShowUser(beatmap.BeatmapSet.Metadata.Author); } } } From 1ccef61f7ba21bb02ce1e7b557d28058964bc326 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 May 2019 18:32:29 +0900 Subject: [PATCH 3/5] Fix some missed instances of TestCase --- osu.Game.Tests/Chat/MessageFormatterTests.cs | 2 +- ...stCaseLoadingAnimation.cs => TestSceneLoadingAnimation.cs} | 4 ++-- osu.Game.Tests/WaveformTestBeatmap.cs | 2 +- osu.Game/Tests/Visual/OsuTestScene.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename osu.Game.Tests/Visual/UserInterface/{TestCaseLoadingAnimation.cs => TestSceneLoadingAnimation.cs} (91%) diff --git a/osu.Game.Tests/Chat/MessageFormatterTests.cs b/osu.Game.Tests/Chat/MessageFormatterTests.cs index 720d93cb10..0d6ed67767 100644 --- a/osu.Game.Tests/Chat/MessageFormatterTests.cs +++ b/osu.Game.Tests/Chat/MessageFormatterTests.cs @@ -65,7 +65,7 @@ namespace osu.Game.Tests.Chat } [Test] - public void TestCaseInsensitiveLinks() + public void TestInsensitiveLinks() { Message result = MessageFormatter.FormatMessage(new Message { Content = "look: http://puu.sh/7Ggh8xcC6/asf0asd9876.NEF" }); diff --git a/osu.Game.Tests/Visual/UserInterface/TestCaseLoadingAnimation.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs similarity index 91% rename from osu.Game.Tests/Visual/UserInterface/TestCaseLoadingAnimation.cs rename to osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs index 9befac94f2..b9a6d74f19 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestCaseLoadingAnimation.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneLoadingAnimation.cs @@ -9,9 +9,9 @@ using osuTK.Graphics; namespace osu.Game.Tests.Visual.UserInterface { - public class TestCaseLoadingAnimation : GridTestScene //todo: this should be an OsuTestScene + public class TestSceneLoadingAnimation : GridTestScene //todo: this should be an OsuTestScene { - public TestCaseLoadingAnimation() + public TestSceneLoadingAnimation() : base(2, 2) { LoadingAnimation loading; diff --git a/osu.Game.Tests/WaveformTestBeatmap.cs b/osu.Game.Tests/WaveformTestBeatmap.cs index 2028671b0e..f66b374cd7 100644 --- a/osu.Game.Tests/WaveformTestBeatmap.cs +++ b/osu.Game.Tests/WaveformTestBeatmap.cs @@ -13,7 +13,7 @@ using osu.Game.Tests.Resources; namespace osu.Game.Tests { /// - /// A that is used for testcases that include waveforms. + /// A that is used for test scenes that include waveforms. /// public class WaveformTestBeatmap : WorkingBeatmap { diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs index f628f3c29a..9b775fd498 100644 --- a/osu.Game/Tests/Visual/OsuTestScene.cs +++ b/osu.Game/Tests/Visual/OsuTestScene.cs @@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual protected override void LoadAsyncComplete() { // this has to be run here rather than LoadComplete because - // TestCase.cs is checking the IsLoaded state (on another thread) and expects + // TestScene.cs is checking the IsLoaded state (on another thread) and expects // the runner to be loaded at that point. Add(runner = new TestSceneTestRunner.TestRunner()); } From 7f30f61d1b28f2f5249b0e9e87a0fbf66a33aa53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 16 May 2019 15:02:13 +0900 Subject: [PATCH 4/5] Update DirectListPanel to use same styling --- osu.Game/Overlays/Direct/DirectListPanel.cs | 28 +++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index d645fd3bda..4c5e4ceae7 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -15,6 +15,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; +using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Direct { @@ -163,26 +164,21 @@ namespace osu.Game.Overlays.Direct { new Statistic(FontAwesome.Solid.PlayCircle, SetInfo.OnlineInfo?.PlayCount ?? 0), new Statistic(FontAwesome.Solid.Heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0), - new FillFlowContainer + new LinkFlowContainer(s => + { + s.Shadow = false; + s.Font = OsuFont.GetFont(size: 14); + }) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Children = new[] - { - new OsuSpriteText - { - Text = "mapped by ", - Font = OsuFont.GetFont(size: 14) - }, - new OsuSpriteText - { - Text = SetInfo.Metadata.Author.Username, - Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true) - }, - }, - }, + }.With(d => + { + d.AutoSizeAxes = Axes.Both; + d.AddText("mapped by "); + d.AddUserLink(SetInfo.Metadata.Author); + }), new OsuSpriteText { Text = SetInfo.Metadata.Source, From 8ee3958b4a8e78e5d6f5259a0e9575f55f336b79 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 16 May 2019 15:17:44 +0900 Subject: [PATCH 5/5] Fix some padding issues with DirectListPanel --- osu.Game/Overlays/Direct/DirectListPanel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index 4c5e4ceae7..b731e95d54 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -87,8 +87,9 @@ namespace osu.Game.Overlays.Direct { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Size = new Vector2(height / 2), + Size = new Vector2(height / 3), FillMode = FillMode.Fit, + Margin = new MarginPadding { Right = 10 }, }, new FillFlowContainer { @@ -151,7 +152,7 @@ namespace osu.Game.Overlays.Direct Child = new DownloadButton(SetInfo) { Size = new Vector2(height - vertical_padding * 3), - Margin = new MarginPadding { Left = vertical_padding, Right = vertical_padding }, + Margin = new MarginPadding { Left = vertical_padding * 2, Right = vertical_padding }, }, }, new FillFlowContainer