mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:02:55 +08:00
Move update streams inside header content
This commit is contained in:
parent
661fc01e7d
commit
81e42041e6
@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
public Action ListingSelected;
|
||||
|
||||
public UpdateStreamBadgeArea Streams;
|
||||
|
||||
private const string listing_string = "Listing";
|
||||
|
||||
public ChangelogHeader()
|
||||
@ -34,6 +36,12 @@ namespace osu.Game.Overlays.Changelog
|
||||
};
|
||||
|
||||
Current.ValueChanged += showBuild;
|
||||
|
||||
Streams.Current.ValueChanged += e =>
|
||||
{
|
||||
if (e.NewValue?.LatestBuild != null && e.NewValue != Current.Value?.UpdateStream)
|
||||
Current.Value = e.NewValue.LatestBuild;
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -54,11 +62,14 @@ namespace osu.Game.Overlays.Changelog
|
||||
TabControl.AddItem(e.NewValue.ToString());
|
||||
TabControl.Current.Value = e.NewValue.ToString();
|
||||
|
||||
Streams.Current.Value = e.NewValue.UpdateStream;
|
||||
|
||||
title.Version = e.NewValue.UpdateStream.DisplayName;
|
||||
}
|
||||
else
|
||||
{
|
||||
TabControl.Current.Value = listing_string;
|
||||
Streams.Current.Value = null;
|
||||
title.Version = null;
|
||||
}
|
||||
}
|
||||
@ -67,10 +78,11 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
protected override Drawable CreateContent() => new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
// todo: move badge display here
|
||||
Streams = new UpdateStreamBadgeArea(),
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -26,8 +26,6 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
private ChangelogHeader header;
|
||||
|
||||
private UpdateStreamBadgeArea updateStreamBadges;
|
||||
|
||||
private Container<ChangelogContent> content;
|
||||
|
||||
private SampleChannel sampleBack;
|
||||
@ -81,7 +79,6 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
ListingSelected = ShowListing,
|
||||
},
|
||||
updateStreamBadges = new UpdateStreamBadgeArea(),
|
||||
content = new Container<ChangelogContent>
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
@ -92,12 +89,6 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
};
|
||||
|
||||
updateStreamBadges.Current.ValueChanged += e =>
|
||||
{
|
||||
if (e.NewValue?.LatestBuild != null && e.NewValue != Current.Value?.UpdateStream)
|
||||
ShowBuild(e.NewValue.LatestBuild);
|
||||
};
|
||||
|
||||
sampleBack = audio.Sample.Get(@"UI/generic-select-soft");
|
||||
|
||||
header.Current.BindTo(Current);
|
||||
@ -105,16 +96,9 @@ namespace osu.Game.Overlays
|
||||
Current.BindValueChanged(e =>
|
||||
{
|
||||
if (e.NewValue != null)
|
||||
{
|
||||
updateStreamBadges.Current.Value = e.NewValue.UpdateStream;
|
||||
|
||||
loadContent(new ChangelogSingleBuild(e.NewValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
updateStreamBadges.Current.Value = null;
|
||||
loadContent(new ChangelogListing(builds));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -161,7 +145,7 @@ namespace osu.Game.Overlays
|
||||
res.Streams.ForEach(s => s.LatestBuild.UpdateStream = res.Streams.Find(s2 => s2.Id == s.LatestBuild.UpdateStream.Id));
|
||||
|
||||
builds = res.Builds;
|
||||
updateStreamBadges.Populate(res.Streams);
|
||||
header.Streams.Populate(res.Streams);
|
||||
|
||||
Current.TriggerChange();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user