mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
PaginatedBeatmapContainer.BeganPlayingPreview
This commit is contained in:
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
|||||||
|
|
||||||
private DirectPanel currentlyPlaying;
|
private DirectPanel currentlyPlaying;
|
||||||
|
|
||||||
public event Action<DirectGridPanel> BeatmapAdded;
|
public event Action<PaginatedBeatmapContainer> BeganPlayingPreview;
|
||||||
|
|
||||||
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<User> user, string header, string missing = "None... yet.")
|
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<User> user, string header, string missing = "None... yet.")
|
||||||
: base(user, header, missing)
|
: base(user, header, missing)
|
||||||
@ -61,16 +61,22 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
|||||||
{
|
{
|
||||||
if (!isPlaying) return;
|
if (!isPlaying) return;
|
||||||
|
|
||||||
|
BeganPlayingPreview?.Invoke(this);
|
||||||
if (currentlyPlaying != null && currentlyPlaying != panel)
|
if (currentlyPlaying != null && currentlyPlaying != panel)
|
||||||
currentlyPlaying.PreviewPlaying.Value = false;
|
StopPlayingPreview();
|
||||||
|
|
||||||
currentlyPlaying = panel;
|
currentlyPlaying = panel;
|
||||||
};
|
};
|
||||||
BeatmapAdded?.Invoke(panel);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Api.Queue(req);
|
Api.Queue(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void StopPlayingPreview()
|
||||||
|
{
|
||||||
|
if (currentlyPlaying != null)
|
||||||
|
currentlyPlaying.PreviewPlaying.Value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,16 +26,15 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"),
|
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, "Graveyarded Beatmaps"),
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var beatmapContainer in Children.OfType<PaginatedBeatmapContainer>())
|
foreach (var paginatedBeatmapContainer in Children.OfType<PaginatedBeatmapContainer>())
|
||||||
{
|
{
|
||||||
beatmapContainer.BeatmapAdded += panel => panel.PreviewPlaying.ValueChanged += isPlaying =>
|
paginatedBeatmapContainer.BeganPlayingPreview += (BeatmapContainer) =>
|
||||||
{
|
{
|
||||||
if (!isPlaying) return;
|
foreach (var bc in Children.OfType<PaginatedBeatmapContainer>())
|
||||||
|
{
|
||||||
if (currentlyPlaying != null && currentlyPlaying != panel)
|
if (bc != BeatmapContainer)
|
||||||
currentlyPlaying.PreviewPlaying.Value = false;
|
bc.StopPlayingPreview();
|
||||||
|
}
|
||||||
currentlyPlaying = panel;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user