mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into fix-randomizer
This commit is contained in:
@ -229,11 +229,15 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectNextRandom()
|
||||
/// <summary>
|
||||
/// Select the next beatmap in the random sequence.
|
||||
/// </summary>
|
||||
/// <returns>True if a selection could be made, else False.</returns>
|
||||
public bool SelectNextRandom()
|
||||
{
|
||||
var visibleSets = beatmapSets.Where(s => !s.Filtered).ToList();
|
||||
if (!visibleSets.Any())
|
||||
return;
|
||||
var visible = beatmapSets.Where(s => !s.Filtered).ToList();
|
||||
if (!visible.Any())
|
||||
return false;
|
||||
|
||||
if (selectedBeatmap != null)
|
||||
{
|
||||
@ -264,6 +268,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
var visibleBeatmaps = set.Beatmaps.Where(s => !s.Filtered).ToList();
|
||||
select(visibleBeatmaps.Skip(RNG.Next(visibleBeatmaps.Count)).FirstOrDefault());
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SelectPreviousRandom()
|
||||
|
@ -109,6 +109,13 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
if (value == placeholderState) return;
|
||||
|
||||
if (value != PlaceholderState.Successful)
|
||||
{
|
||||
getScoresRequest?.Cancel();
|
||||
getScoresRequest = null;
|
||||
Scores = null;
|
||||
}
|
||||
|
||||
switch (placeholderState = value)
|
||||
{
|
||||
case PlaceholderState.NetworkFailure:
|
||||
@ -211,10 +218,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
private void updateScores()
|
||||
{
|
||||
getScoresRequest?.Cancel();
|
||||
getScoresRequest = null;
|
||||
Scores = null;
|
||||
|
||||
if (Scope == LeaderboardScope.Local)
|
||||
{
|
||||
// TODO: get local scores from wherever here.
|
||||
@ -234,16 +237,15 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
return;
|
||||
}
|
||||
|
||||
PlaceholderState = PlaceholderState.Retrieving;
|
||||
loading.Show();
|
||||
|
||||
if (Scope != LeaderboardScope.Global && !api.LocalUser.Value.IsSupporter)
|
||||
{
|
||||
loading.Hide();
|
||||
PlaceholderState = PlaceholderState.NotSupporter;
|
||||
return;
|
||||
}
|
||||
|
||||
PlaceholderState = PlaceholderState.Retrieving;
|
||||
loading.Show();
|
||||
|
||||
getScoresRequest = new GetScoresRequest(Beatmap, osuGame?.Ruleset.Value ?? Beatmap.Ruleset, Scope);
|
||||
getScoresRequest.Success += r =>
|
||||
{
|
||||
|
@ -25,6 +25,8 @@ namespace osu.Game.Screens.Select.Options
|
||||
private readonly Box holder;
|
||||
private readonly FillFlowContainer<BeatmapOptionsButton> buttonsContainer;
|
||||
|
||||
public override bool BlockScreenWideMouse => false;
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
base.PopIn();
|
||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
private OsuScreen player;
|
||||
private readonly ModSelectOverlay modSelect;
|
||||
private readonly BeatmapDetailArea beatmapDetails;
|
||||
protected readonly BeatmapDetailArea BeatmapDetails;
|
||||
private bool removeAutoModOnResume;
|
||||
|
||||
public PlaySongSelect()
|
||||
@ -35,13 +35,13 @@ namespace osu.Game.Screens.Select
|
||||
Anchor = Anchor.BottomCentre,
|
||||
});
|
||||
|
||||
LeftContent.Add(beatmapDetails = new BeatmapDetailArea
|
||||
LeftContent.Add(BeatmapDetails = new BeatmapDetailArea
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Top = 10, Right = 5 },
|
||||
});
|
||||
|
||||
beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
|
||||
BeatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
|
||||
}
|
||||
|
||||
private SampleChannel sampleConfirm;
|
||||
@ -78,7 +78,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||
|
||||
beatmapDetails.Beatmap = beatmap;
|
||||
BeatmapDetails.Beatmap = beatmap;
|
||||
|
||||
if (beatmap.Track != null)
|
||||
beatmap.Track.Looping = true;
|
||||
|
@ -449,9 +449,16 @@ namespace osu.Game.Screens.Select
|
||||
private void carouselBeatmapsLoaded()
|
||||
{
|
||||
if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false)
|
||||
{
|
||||
Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo);
|
||||
}
|
||||
else if (Carousel.SelectedBeatmapSet == null)
|
||||
Carousel.SelectNextRandom();
|
||||
{
|
||||
if (!Carousel.SelectNextRandom())
|
||||
// in the case random selection failed, we want to trigger selectionChanged
|
||||
// to show the dummy beatmap (we have nothing else to display).
|
||||
carouselSelectionChanged(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void delete(BeatmapSetInfo beatmap)
|
||||
|
Reference in New Issue
Block a user