mirror of https://github.com/ppy/osu
Flash panels on select
This commit is contained in:
parent
be3904b647
commit
123629ba9e
|
@ -29,6 +29,7 @@ public class TournamentBeatmapPanel : CompositeDrawable
|
||||||
public const float HEIGHT = 50;
|
public const float HEIGHT = 50;
|
||||||
|
|
||||||
private readonly Bindable<MatchPairing> currentMatch = new Bindable<MatchPairing>();
|
private readonly Bindable<MatchPairing> currentMatch = new Bindable<MatchPairing>();
|
||||||
|
private Box flash;
|
||||||
|
|
||||||
public TournamentBeatmapPanel(BeatmapInfo beatmap)
|
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();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BeatmapChoice choice;
|
||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
{
|
||||||
var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == Beatmap.OnlineBeatmapID);
|
var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == Beatmap.OnlineBeatmapID);
|
||||||
|
|
||||||
|
bool doFlash = found != choice;
|
||||||
|
choice = found;
|
||||||
|
|
||||||
if (found != null)
|
if (found != null)
|
||||||
{
|
{
|
||||||
|
if (doFlash)
|
||||||
|
flash.FadeOutFromOne(500).Loop(0, 10);
|
||||||
|
|
||||||
BorderThickness = 6;
|
BorderThickness = 6;
|
||||||
|
|
||||||
switch (found.Team)
|
switch (found.Team)
|
||||||
|
|
Loading…
Reference in New Issue