mirror of
https://github.com/ppy/osu
synced 2024-12-16 03:45:46 +00:00
Change graph's colour on stream selection
This commit is contained in:
parent
eca5fb6f05
commit
78f0f37ee6
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 += () =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user