Update comments; Improve neighboring builds handling;

Apply fixes to things pointed out by AppVeyor
This commit is contained in:
HoutarouOreki
2018-07-20 15:48:20 +02:00
parent 227394925a
commit 02a8fb2154
9 changed files with 37 additions and 49 deletions

View File

@ -29,8 +29,11 @@ namespace osu.Game.Overlays.Changelog
public override void Add(ChangelogContentGroup changelogContentGroup)
{
changelogContentGroup.PreviousRequested = ShowPrevious;
changelogContentGroup.NextRequested = ShowNext;
if (changelogContentGroup != null)
{
changelogContentGroup.PreviousRequested = showPrevious;
changelogContentGroup.NextRequested = showNext;
}
base.Add(changelogContentGroup);
}
@ -38,26 +41,29 @@ namespace osu.Game.Overlays.Changelog
{
Clear();
Add(new ChangelogContentGroup(changelog));
FetchChangelogBuild(changelog);
//fetchChangelogBuild(changelog);
fetchChangelogBuild();
}
private void ShowNext()
private void showNext()
{
if (currentBuild.Versions.Next != null)
{
Clear();
Add(new ChangelogContentGroup(currentBuild.Versions.Next));
FetchChangelogBuild(currentBuild.Versions.Next);
//fetchChangelogBuild(currentBuild.Versions.Next);
fetchChangelogBuild();
}
}
private void ShowPrevious()
private void showPrevious()
{
if (currentBuild.Versions.Previous != null)
{
Clear();
Add(new ChangelogContentGroup(currentBuild.Versions.Previous));
FetchChangelogBuild(currentBuild.Versions.Previous);
//fetchChangelogBuild(currentBuild.Versions.Previous);
fetchChangelogBuild();
}
}
@ -67,9 +73,11 @@ namespace osu.Game.Overlays.Changelog
this.api = api;
}
private void FetchChangelogBuild(APIChangelog build)
//private void fetchChangelogBuild(APIChangelog build)
private void fetchChangelogBuild()
{
var req = new GetChangelogBuildRequest(build.UpdateStream.Name, build.Version);
//var req = new GetChangelogBuildRequest(build.UpdateStream.Name, build.Version);
var req = new GetChangelogBuildRequest();
req.Success += res => currentBuild = res;
api.Queue(req);
}

View File

@ -15,8 +15,6 @@ namespace osu.Game.Overlays.Changelog
public class ChangelogContentGroup : FillFlowContainer
{
public Action NextRequested, PreviousRequested;
// need to keep in mind it looks different on Listing (one contains all builds from a date)
// and when a stream is selected (looks like now)
public ChangelogContentGroup(APIChangelog build)
{
RelativeSizeAxes = Axes.X;
@ -47,7 +45,7 @@ namespace osu.Game.Overlays.Changelog
Icon = FontAwesome.fa_chevron_left,
Size = new Vector2(24),
TooltipText = "Previous",
OnPressed = () => PreviousRequested(),
Action = () => PreviousRequested(),
},
new FillFlowContainer<SpriteText>
{
@ -65,7 +63,7 @@ namespace osu.Game.Overlays.Changelog
TextSize = 28, // web: 24,
Font = @"Exo2.0-Medium",
},
new SpriteText // a space...
new SpriteText
{
Text = " ",
TextSize = 28,
@ -84,7 +82,7 @@ namespace osu.Game.Overlays.Changelog
Icon = FontAwesome.fa_chevron_right,
Size = new Vector2(24),
TooltipText = "Next",
OnPressed = () => NextRequested(),
Action = () => NextRequested(),
},
}
},
@ -105,6 +103,6 @@ namespace osu.Game.Overlays.Changelog
},
};
}
//public ChangelogContentGroup(DateTimeOffset date) { }
//public ChangelogContentGroup() { } // for listing
}
}

View File

@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Changelog
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill,
},
new Container // this is the line badge-Changelog-Stream
new Container
{
Height = title_height,
Anchor = Anchor.BottomLeft,
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Changelog
Y = -version_height,
Children = new Drawable[]
{
new CircularContainer // a purple circle
new CircularContainer
{
X = icon_margin,
Masking = true,
@ -131,8 +131,6 @@ namespace osu.Game.Overlays.Changelog
{
Top = 10,
Left = 7,
// + chevron size, and account for gained space on left by
// listing's font draw width being smaller
Right = 18,
Bottom = 15,
},
@ -153,7 +151,7 @@ namespace osu.Game.Overlays.Changelog
releaseStream = new TextBadgePairRelease(Purple, "Lazer")
},
},
new Box // purple line
new Box
{
Colour = Purple,
RelativeSizeAxes = Axes.X,

View File

@ -26,8 +26,6 @@ namespace osu.Game.Overlays.Changelog
public ChangelogStreams()
{
// this should actually be resizeable (https://streamable.com/yw2ug)
// if not, with small width:height ratio it cuts off right-most content
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
@ -70,7 +68,6 @@ namespace osu.Game.Overlays.Changelog
protected override bool OnHover(InputState state)
{
// is this nullreference-safe for badgesContainer?
foreach (StreamBadge streamBadge in BadgesContainer.Children)
{
if (SelectedRelease != null)