Flash panels on select

This commit is contained in:
Dean Herbert 2018-11-11 10:48:57 +09:00
parent be3904b647
commit 123629ba9e
1 changed files with 16 additions and 0 deletions

View File

@ -29,6 +29,7 @@ public class TournamentBeatmapPanel : CompositeDrawable
public const float HEIGHT = 50;
private readonly Bindable<MatchPairing> currentMatch = new Bindable<MatchPairing>();
private Box flash;
public TournamentBeatmapPanel(BeatmapInfo beatmap)
{
@ -117,6 +118,13 @@ private void load(LadderInfo ladder)
}
},
},
flash = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Gray,
Blending = BlendingMode.Additive,
Alpha = 0,
},
});
}
@ -126,12 +134,20 @@ private void matchChanged(MatchPairing match)
updateState();
}
private BeatmapChoice choice;
private void updateState()
{
var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == Beatmap.OnlineBeatmapID);
bool doFlash = found != choice;
choice = found;
if (found != null)
{
if (doFlash)
flash.FadeOutFromOne(500).Loop(0, 10);
BorderThickness = 6;
switch (found.Team)