mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Added "scroll to" container
This commit is contained in:
parent
8458622c4d
commit
e121b119be
@ -31,6 +31,7 @@ namespace osu.Game.Screens.Select
|
|||||||
private BeatmapManager manager;
|
private BeatmapManager manager;
|
||||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap();
|
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap();
|
||||||
|
|
||||||
|
private readonly ActionContainer actionContainer;
|
||||||
private readonly BeatmapCarousel carousel;
|
private readonly BeatmapCarousel carousel;
|
||||||
private DialogOverlay dialogOverlay;
|
private DialogOverlay dialogOverlay;
|
||||||
|
|
||||||
@ -129,6 +130,12 @@ namespace osu.Game.Screens.Select
|
|||||||
Right = left_area_padding,
|
Right = left_area_padding,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Add(actionContainer = new ActionContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 250,
|
||||||
|
OnHoverAction = () => carousel.ScrollToSelected(),
|
||||||
|
});
|
||||||
|
|
||||||
if (ShowFooter)
|
if (ShowFooter)
|
||||||
{
|
{
|
||||||
@ -409,5 +416,16 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ActionContainer : Container
|
||||||
|
{
|
||||||
|
public Action OnHoverAction;
|
||||||
|
|
||||||
|
protected override bool OnHover(InputState state)
|
||||||
|
{
|
||||||
|
OnHoverAction?.Invoke();
|
||||||
|
return base.OnHover(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user