mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge branch 'master' into master
This commit is contained in:
@ -187,12 +187,12 @@ namespace osu.Game.Screens.Select
|
|||||||
if (groups.Count == 0)
|
if (groups.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
randomSelectedBeatmaps.Push(new KeyValuePair<BeatmapGroup, BeatmapPanel>(selectedGroup, selectedGroup.SelectedPanel));
|
|
||||||
|
|
||||||
var visibleGroups = getVisibleGroups();
|
var visibleGroups = getVisibleGroups();
|
||||||
if (!visibleGroups.Any())
|
if (!visibleGroups.Any())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
randomSelectedBeatmaps.Push(new KeyValuePair<BeatmapGroup, BeatmapPanel>(selectedGroup, selectedGroup.SelectedPanel));
|
||||||
|
|
||||||
BeatmapGroup group;
|
BeatmapGroup group;
|
||||||
|
|
||||||
if (randomType == SelectionRandomType.RandomPermutation)
|
if (randomType == SelectionRandomType.RandomPermutation)
|
||||||
@ -287,6 +287,12 @@ namespace osu.Game.Screens.Select
|
|||||||
perform();
|
perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ScrollToSelected(bool animated = true)
|
||||||
|
{
|
||||||
|
float selectedY = computeYPositions(animated);
|
||||||
|
ScrollTo(selectedY, animated);
|
||||||
|
}
|
||||||
|
|
||||||
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
|
private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet)
|
||||||
{
|
{
|
||||||
foreach (var b in beatmapSet.Beatmaps)
|
foreach (var b in beatmapSet.Beatmaps)
|
||||||
@ -426,8 +432,7 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
float selectedY = computeYPositions(animated);
|
ScrollToSelected(animated);
|
||||||
ScrollTo(selectedY, animated);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,6 +129,11 @@ namespace osu.Game.Screens.Select
|
|||||||
Right = left_area_padding,
|
Right = left_area_padding,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Add(new ResetScrollContainer(() => carousel.ScrollToSelected())
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 250,
|
||||||
|
});
|
||||||
|
|
||||||
if (ShowFooter)
|
if (ShowFooter)
|
||||||
{
|
{
|
||||||
@ -414,5 +419,21 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ResetScrollContainer : Container
|
||||||
|
{
|
||||||
|
private readonly Action onHoverAction;
|
||||||
|
|
||||||
|
public ResetScrollContainer(Action onHoverAction)
|
||||||
|
{
|
||||||
|
this.onHoverAction = onHoverAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(InputState state)
|
||||||
|
{
|
||||||
|
onHoverAction?.Invoke();
|
||||||
|
return base.OnHover(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user