Change graph's colour on stream selection

This commit is contained in:
HoutarouOreki 2018-07-21 07:16:22 +02:00
parent eca5fb6f05
commit 78f0f37ee6
2 changed files with 12 additions and 2 deletions

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Overlays.Changelog
{
@ -13,13 +14,15 @@ namespace osu.Game.Overlays.Changelog
// placeholder json file: https://api.myjson.com/bins/10ye8a
public class ChangelogChart : BufferedContainer
{
private Box background;
public ChangelogChart()
{
RelativeSizeAxes = Axes.X;
Height = 100;
Children = new Drawable[]
{
new Box
background = new Box
{
Colour = StreamColour.STABLE,
RelativeSizeAxes = Axes.Both,
@ -33,5 +36,10 @@ namespace osu.Game.Overlays.Changelog
},
};
}
public void ShowChart(APIChangelog releaseStream)
{
background.Colour = StreamColour.FromStreamName(releaseStream.UpdateStream.Name);
}
}
}

View File

@ -22,6 +22,7 @@ namespace osu.Game.Overlays
{
private readonly ChangelogHeader header;
public readonly ChangelogStreams Streams;
private readonly ChangelogChart chart;
private APIChangelog changelogEntry;
private APIAccess api;
@ -72,7 +73,7 @@ namespace osu.Game.Overlays
{
header = new ChangelogHeader(),
Streams = new ChangelogStreams(),
new ChangelogChart(),
chart = new ChangelogChart(),
content = new ChangelogContent(),
},
},
@ -87,6 +88,7 @@ namespace osu.Game.Overlays
}
header.ShowReleaseStream();
content.ShowBuild(Streams.SelectedRelease);
chart.ShowChart(Streams.SelectedRelease);
};
header.OnListingActivated += () =>
{