mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Merge remote-tracking branch 'origin/master' into backgrounded-beatmap-status-lookups
# Conflicts: # osu.Game.Tests/Visual/SongSelect/TestScenePlaySongSelect.cs
This commit is contained in:
commit
243cd517ad
@ -138,7 +138,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
createSongSelect();
|
||||
changeRuleset(2);
|
||||
importForRuleset(0);
|
||||
addRulesetImportStep(0);
|
||||
AddUntilStep("no selection", () => songSelect.Carousel.SelectedBeatmap == null);
|
||||
}
|
||||
|
||||
@ -147,8 +147,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
createSongSelect();
|
||||
changeRuleset(2);
|
||||
importForRuleset(2);
|
||||
importForRuleset(1);
|
||||
addRulesetImportStep(2);
|
||||
addRulesetImportStep(1);
|
||||
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.RulesetID == 2);
|
||||
|
||||
changeRuleset(1);
|
||||
|
@ -10,11 +10,14 @@ namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
private OsuCheckbox checkbox;
|
||||
|
||||
private string labelText;
|
||||
|
||||
protected override Drawable CreateControl() => checkbox = new OsuCheckbox();
|
||||
|
||||
public override string LabelText
|
||||
{
|
||||
set => checkbox.LabelText = value;
|
||||
get => labelText;
|
||||
set => checkbox.LabelText = labelText = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,9 +152,12 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Schedule(() =>
|
||||
{
|
||||
int? previouslySelectedID = null;
|
||||
CarouselBeatmapSet existingSet = beatmapSets.FirstOrDefault(b => b.BeatmapSet.ID == beatmapSet.ID);
|
||||
|
||||
bool hadSelection = existingSet?.State?.Value == CarouselItemState.Selected;
|
||||
// If the selected beatmap is about to be removed, store its ID so it can be re-selected if required
|
||||
if (existingSet?.State?.Value == CarouselItemState.Selected)
|
||||
previouslySelectedID = selectedBeatmap?.Beatmap.ID;
|
||||
|
||||
var newSet = createCarouselSet(beatmapSet);
|
||||
|
||||
@ -172,8 +175,8 @@ namespace osu.Game.Screens.Select
|
||||
applyActiveCriteria(false, false);
|
||||
|
||||
//check if we can/need to maintain our current selection.
|
||||
if (hadSelection)
|
||||
select((CarouselItem)newSet.Beatmaps.FirstOrDefault(b => b.Beatmap.ID == selectedBeatmap?.Beatmap.ID) ?? newSet);
|
||||
if (previouslySelectedID != null)
|
||||
select((CarouselItem)newSet.Beatmaps.FirstOrDefault(b => b.Beatmap.ID == previouslySelectedID) ?? newSet);
|
||||
|
||||
itemsCache.Invalidate();
|
||||
Schedule(() => BeatmapSetsChanged?.Invoke());
|
||||
|
@ -595,11 +595,17 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
bindBindables();
|
||||
|
||||
// If a selection was already obtained, do not attempt to update the selected beatmap.
|
||||
if (Carousel.SelectedBeatmapSet != null)
|
||||
return;
|
||||
|
||||
// Attempt to select the current beatmap on the carousel, if it is valid to be selected.
|
||||
if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false && Beatmap.Value.BeatmapSetInfo?.Protected == false
|
||||
&& Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false))
|
||||
return;
|
||||
|
||||
if (Carousel.SelectedBeatmapSet == null && !Carousel.SelectNextRandom())
|
||||
// If the current active beatmap could not be selected, select a new random beatmap.
|
||||
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).
|
||||
|
Loading…
Reference in New Issue
Block a user