Skip to content

Commit

Permalink
show fail reason on results
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Sep 14, 2024
1 parent 2489f1f commit 7de3bb7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fluXis.Game/Screens/Result/ResultsContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 19 additions & 2 deletions fluXis.Game/Screens/Result/Sides/Types/ResultsSideRankings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7de3bb7

Please sign in to comment.