Add proper action to YearButton

This commit is contained in:
Andrei Zavatski
2021-05-19 15:38:53 +03:00
parent e3ed9b8135
commit d60478851f

View File

@ -81,6 +81,9 @@ namespace osu.Game.Overlays.News.Sidebar
{ {
public int Year { get; } public int Year { get; }
[Resolved(canBeNull: true)]
private NewsOverlay overlay { get; set; }
private readonly bool isCurrent; private readonly bool isCurrent;
public YearButton(int year, bool isCurrent) public YearButton(int year, bool isCurrent)
@ -106,7 +109,7 @@ namespace osu.Game.Overlays.News.Sidebar
{ {
IdleColour = isCurrent ? Color4.White : colourProvider.Light2; IdleColour = isCurrent ? Color4.White : colourProvider.Light2;
HoverColour = isCurrent ? Color4.White : colourProvider.Light1; HoverColour = isCurrent ? Color4.White : colourProvider.Light1;
Action = () => { }; // Avoid button being disabled since there's no proper action assigned. Action = () => overlay?.ShowYear(Year);
} }
} }
} }