From 7de3bb73ba94f6206e1c47d161f48a0259de8c45 Mon Sep 17 00:00:00 2001 From: flustix Date: Sat, 14 Sep 2024 21:29:46 +0200 Subject: [PATCH] show fail reason on results --- fluXis.Game/Screens/Result/ResultsContent.cs | 2 +- .../Result/Sides/Types/ResultsSideRankings.cs | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/fluXis.Game/Screens/Result/ResultsContent.cs b/fluXis.Game/Screens/Result/ResultsContent.cs index 50a27748..5aef19e9 100644 --- a/fluXis.Game/Screens/Result/ResultsContent.cs +++ b/fluXis.Game/Screens/Result/ResultsContent.cs @@ -22,7 +22,7 @@ public partial class ResultsContent : CompositeDrawable [Resolved] private ScoreInfo score { get; set; } - private Drawable[] rightContent; + private Drawable[] rightContent { get; } private bool rankMoveSmoothly; private bool rankUseCenter; diff --git a/fluXis.Game/Screens/Result/Sides/Types/ResultsSideRankings.cs b/fluXis.Game/Screens/Result/Sides/Types/ResultsSideRankings.cs index 2b5967e5..13e0c67e 100644 --- a/fluXis.Game/Screens/Result/Sides/Types/ResultsSideRankings.cs +++ b/fluXis.Game/Screens/Result/Sides/Types/ResultsSideRankings.cs @@ -20,15 +20,32 @@ public ResultsSideRankings(ScoreSubmitRequest request) { this.request = request; - if (request is null || !request.IsSuccessful) + if (request is null) Alpha = 0; } protected override Drawable CreateContent() { - if (request is null || !request.IsSuccessful) + if (request is null) return Empty(); + if (!request.IsSuccessful) + { + return new Container + { + RelativeSizeAxes = Axes.X, + Height = 50, + Child = new TruncatingText() + { + Text = request.FailReason?.Message ?? "Something went wrong...", + WebFontSize = 16, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + MaxWidth = 380 + } + }; + } + return new FillFlowContainer { RelativeSizeAxes = Axes.X,