mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
add previews to osu!direct
This commit is contained in:
@ -32,6 +32,7 @@ namespace osu.Game.Overlays
|
||||
private readonly FillFlowContainer resultCountsContainer;
|
||||
private readonly OsuSpriteText resultCountsText;
|
||||
private FillFlowContainer<DirectPanel> panels;
|
||||
private DirectPanel playing;
|
||||
|
||||
protected override Color4 BackgroundColour => OsuColour.FromHex(@"485e74");
|
||||
protected override Color4 TrianglesColourLight => OsuColour.FromHex(@"465b71");
|
||||
@ -201,6 +202,12 @@ namespace osu.Game.Overlays
|
||||
panels.FadeOut(200);
|
||||
panels.Expire();
|
||||
panels = null;
|
||||
|
||||
if (playing != null)
|
||||
{
|
||||
playing.PreviewPlaying.Value = false;
|
||||
playing = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (BeatmapSets == null) return;
|
||||
@ -223,6 +230,17 @@ namespace osu.Game.Overlays
|
||||
})
|
||||
};
|
||||
|
||||
foreach (DirectPanel panel in newPanels.Children)
|
||||
panel.PreviewPlaying.ValueChanged += newValue =>
|
||||
{
|
||||
if (newValue)
|
||||
{
|
||||
if (playing != null && playing != panel)
|
||||
playing.PreviewPlaying.Value = false;
|
||||
playing = panel;
|
||||
}
|
||||
};
|
||||
|
||||
LoadComponentAsync(newPanels, p =>
|
||||
{
|
||||
if (panels != null) ScrollFlow.Remove(panels);
|
||||
|
Reference in New Issue
Block a user