1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

move scroll to into action

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-06-04 23:48:27 +07:00
parent a431ef6c48
commit f07d4532d9
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -71,9 +71,6 @@ namespace osu.Game.Overlays.Wiki
private class TableOfContentsEntry : OsuHoverContainer
{
[Resolved]
private OverlayScrollContainer scrollContainer { get; set; }
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
@ -103,16 +100,16 @@ namespace osu.Game.Overlays.Wiki
protected override IEnumerable<Drawable> EffectTargets => new Drawable[] { textFlow };
[BackgroundDependencyLoader]
private void load()
private void load(OverlayScrollContainer scrollContainer)
{
IdleColour = colourProvider.Light2;
HoverColour = colourProvider.Light1;
Action = () => scrollContainer.ScrollTo(target);
}
protected override bool OnClick(ClickEvent e)
{
IdleColour = colourProvider.Light1;
scrollContainer.ScrollTo(target);
return base.OnClick(e);
}
}