mirror of
https://github.com/ppy/osu
synced 2024-12-16 20:05:41 +00:00
Make CarouselRoot a nested class
This commit is contained in:
parent
6f88a80bde
commit
69e2d4fd22
@ -628,5 +628,23 @@ namespace osu.Game.Screens.Select
|
|||||||
// layer transformations on top, with a similar reasoning to the previous comment.
|
// layer transformations on top, with a similar reasoning to the previous comment.
|
||||||
p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - 1.5f * dist, 0, 1));
|
p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - 1.5f * dist, 0, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class CarouselRoot : CarouselGroupEagerSelect
|
||||||
|
{
|
||||||
|
private readonly BeatmapCarousel carousel;
|
||||||
|
|
||||||
|
public CarouselRoot(BeatmapCarousel carousel)
|
||||||
|
{
|
||||||
|
this.carousel = carousel;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void PerformSelection()
|
||||||
|
{
|
||||||
|
if (LastSelected == null)
|
||||||
|
carousel.SelectNextRandom();
|
||||||
|
else
|
||||||
|
base.PerformSelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select.Carousel
|
|
||||||
{
|
|
||||||
public class CarouselRoot : CarouselGroupEagerSelect
|
|
||||||
{
|
|
||||||
private readonly BeatmapCarousel carousel;
|
|
||||||
|
|
||||||
public CarouselRoot(BeatmapCarousel carousel)
|
|
||||||
{
|
|
||||||
this.carousel = carousel;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PerformSelection()
|
|
||||||
{
|
|
||||||
if (LastSelected == null)
|
|
||||||
carousel.SelectNextRandom();
|
|
||||||
else
|
|
||||||
base.PerformSelection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user