Only play results panel animation once (and only for the local user)

This commit is contained in:
Dean Herbert 2020-10-29 17:04:33 +09:00
parent 11f85779d5
commit 0a0239a7c7
2 changed files with 10 additions and 4 deletions

View File

@ -270,6 +270,9 @@ protected override void LoadComplete()
delay += 200;
}
}
if (!withFlair)
FinishTransforms(true);
});
}
}

View File

@ -85,7 +85,7 @@ public class ScorePanel : CompositeDrawable, IStateful<PanelState>
public readonly ScoreInfo Score;
private readonly bool isNewLocalScore;
private bool displayWithFlair;
private Container content;
@ -102,7 +102,7 @@ public class ScorePanel : CompositeDrawable, IStateful<PanelState>
public ScorePanel(ScoreInfo score, bool isNewLocalScore = false)
{
Score = score;
this.isNewLocalScore = isNewLocalScore;
displayWithFlair = isNewLocalScore;
}
[BackgroundDependencyLoader]
@ -191,7 +191,7 @@ public PanelState State
state = value;
if (LoadState >= LoadState.Ready)
if (IsLoaded)
updateState();
StateChanged?.Invoke(value);
@ -212,7 +212,10 @@ private void updateState()
middleLayerBackground.FadeColour(expanded_middle_layer_colour, resize_duration, Easing.OutQuint);
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User).With(d => d.Alpha = 0));
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, isNewLocalScore).With(d => d.Alpha = 0));
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, displayWithFlair).With(d => d.Alpha = 0));
// only the first expanded display should happen with flair.
displayWithFlair = false;
break;
case PanelState.Contracted: