From ed7bb329de51fcfc5a3bf51590d6cb4a8736e109 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Jul 2017 18:11:25 +0900 Subject: [PATCH 1/2] Add word wrap support to chat --- osu.Game/Overlays/Chat/ChatLine.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 809e771840..fcebca6fe3 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.Effects; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Allocation; using osu.Game.Users; +using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Chat { @@ -164,10 +165,12 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - new OsuSpriteText + new OsuTextFlowContainer(t => + { + t.TextSize = text_size; + }) { Text = Message.Content, - TextSize = text_size, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, } From 31bfa00d60de7692dfba293cc372d06bf8599088 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Jul 2017 12:55:14 +0900 Subject: [PATCH 2/2] Schedule API callback to own scheduler Fixes race condition when API returns a failure after exiting song select. Note that the API does also schedule to the correct thread, but this schedule ensures the callback is never run, which is what we want in this case. --- osu.Game/Screens/Select/BeatmapDetails.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 972d563ca5..dd5ba7b8ae 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.Select requestedBeatmap.Metrics = res; Schedule(() => updateMetrics(res)); }; - lookup.Failure += e => updateMetrics(null); + lookup.Failure += e => Schedule(() => updateMetrics(null)); api.Queue(lookup); loading.Show();