mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 09:02:55 +08:00
Rename APIChangelog to APIChangelogBuild
This commit is contained in:
parent
510b52a503
commit
b8ac328ae9
@ -22,7 +22,7 @@ namespace osu.Game.Tests.Visual
|
||||
AddWaitStep(3);
|
||||
AddStep(@"Show with Lazer 2018.712.0", () =>
|
||||
{
|
||||
changelog.FetchAndShowBuild(new APIChangelog
|
||||
changelog.FetchAndShowBuild(new APIChangelogBuild
|
||||
{
|
||||
Version = "2018.712.0",
|
||||
UpdateStream = new UpdateStream { Name = "lazer" },
|
||||
|
@ -5,7 +5,7 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetChangelogBuildRequest : APIRequest<APIChangelog>
|
||||
public class GetChangelogBuildRequest : APIRequest<APIChangelogBuild>
|
||||
{
|
||||
private readonly string name;
|
||||
private readonly string version;
|
||||
|
@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetChangelogLatestBuildsRequest : APIRequest<List<APIChangelog>>
|
||||
public class GetChangelogLatestBuildsRequest : APIRequest<List<APIChangelogBuild>>
|
||||
{
|
||||
protected override string Target => @"changelog/latest-builds";
|
||||
protected override string Uri => $@"https://houtarouoreki.github.io/fake-api/{Target}"; // for testing
|
||||
|
@ -5,7 +5,7 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetChangelogRequest : APIRequest<APIChangelog[]>
|
||||
public class GetChangelogRequest : APIRequest<APIChangelogBuild[]>
|
||||
{
|
||||
protected override string Target => @"changelog";
|
||||
protected override string Uri => $@"https://houtarouoreki.github.io/fake-api/{Target}/index"; // for testing
|
||||
|
@ -7,7 +7,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
public class APIChangelog
|
||||
public class APIChangelogBuild
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; }
|
||||
@ -40,10 +40,10 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public class Versions
|
||||
{
|
||||
[JsonProperty("next")]
|
||||
public APIChangelog Next { get; set; }
|
||||
public APIChangelogBuild Next { get; set; }
|
||||
|
||||
[JsonProperty("previous")]
|
||||
public APIChangelog Previous { get; set; }
|
||||
public APIChangelogBuild Previous { get; set; }
|
||||
}
|
||||
|
||||
public class ChangelogEntry
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
private const float vertical_padding = 20;
|
||||
private const float horizontal_padding = 85;
|
||||
|
||||
public delegate void SelectionHandler(APIChangelog releaseStream, EventArgs args);
|
||||
public delegate void SelectionHandler(APIChangelogBuild releaseStream, EventArgs args);
|
||||
|
||||
public event SelectionHandler Selected;
|
||||
|
||||
@ -46,9 +46,9 @@ namespace osu.Game.Overlays.Changelog
|
||||
};
|
||||
}
|
||||
|
||||
public void Populate(List<APIChangelog> latestBuilds)
|
||||
public void Populate(List<APIChangelogBuild> latestBuilds)
|
||||
{
|
||||
foreach (APIChangelog updateStream in latestBuilds)
|
||||
foreach (APIChangelogBuild updateStream in latestBuilds)
|
||||
{
|
||||
var streamBadge = new StreamBadge(updateStream);
|
||||
streamBadge.Selected += onBadgeSelected;
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
private APIAccess api;
|
||||
private ChangelogContentGroup changelogContentGroup;
|
||||
|
||||
public delegate void BuildSelectedEventHandler(APIChangelog build, EventArgs args);
|
||||
public delegate void BuildSelectedEventHandler(APIChangelogBuild build, EventArgs args);
|
||||
|
||||
public event BuildSelectedEventHandler BuildSelected;
|
||||
|
||||
@ -28,12 +28,12 @@ namespace osu.Game.Overlays.Changelog
|
||||
Padding = new MarginPadding{ Bottom = 100 };
|
||||
}
|
||||
|
||||
public void ShowListing(APIChangelog[] changelog)
|
||||
public void ShowListing(APIChangelogBuild[] changelog)
|
||||
{
|
||||
DateTime currentDate = new DateTime();
|
||||
Clear();
|
||||
|
||||
foreach (APIChangelog build in changelog)
|
||||
foreach (APIChangelogBuild build in changelog)
|
||||
{
|
||||
if (build.CreatedAt.Date != currentDate)
|
||||
{
|
||||
@ -71,7 +71,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowBuild(APIChangelog changelogBuild)
|
||||
public void ShowBuild(APIChangelogBuild changelogBuild)
|
||||
{
|
||||
Child = changelogContentGroup = new ChangelogContentGroup(changelogBuild);
|
||||
changelogContentGroup.GenerateText(changelogBuild.ChangelogEntries);
|
||||
@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
changelogContentGroup.BuildSelected += OnBuildSelected;
|
||||
}
|
||||
|
||||
protected virtual void OnBuildSelected(APIChangelog build, EventArgs args)
|
||||
protected virtual void OnBuildSelected(APIChangelogBuild build, EventArgs args)
|
||||
{
|
||||
BuildSelected?.Invoke(build, EventArgs.Empty);
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ namespace osu.Game.Overlays.Changelog
|
||||
private readonly SortedDictionary<string, List<ChangelogEntry>> categories =
|
||||
new SortedDictionary<string, List<ChangelogEntry>>();
|
||||
|
||||
public delegate void BuildSelectedEventHandler(APIChangelog build, EventArgs args);
|
||||
public delegate void BuildSelectedEventHandler(APIChangelogBuild build, EventArgs args);
|
||||
|
||||
public event BuildSelectedEventHandler BuildSelected;
|
||||
|
||||
public readonly FillFlowContainer ChangelogEntries;
|
||||
|
||||
public ChangelogContentGroup(APIChangelog build)
|
||||
public ChangelogContentGroup(APIChangelogBuild build)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
};
|
||||
}
|
||||
|
||||
public ChangelogContentGroup(APIChangelog build, bool newDate)
|
||||
public ChangelogContentGroup(APIChangelogBuild build, bool newDate)
|
||||
{
|
||||
OsuHoverContainer clickableBuildText;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
@ -202,7 +202,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnBuildSelected(APIChangelog build)
|
||||
protected virtual void OnBuildSelected(APIChangelogBuild build)
|
||||
{
|
||||
BuildSelected?.Invoke(build, EventArgs.Empty);
|
||||
}
|
||||
|
@ -33,10 +33,10 @@ namespace osu.Game.Overlays.Changelog
|
||||
private SampleChannel sampleClick;
|
||||
private SampleChannel sampleHover;
|
||||
|
||||
public readonly APIChangelog LatestBuild;
|
||||
public readonly APIChangelogBuild LatestBuild;
|
||||
private readonly FillFlowContainer<SpriteText> text;
|
||||
|
||||
public StreamBadge(APIChangelog latestBuild)
|
||||
public StreamBadge(APIChangelogBuild latestBuild)
|
||||
{
|
||||
LatestBuild = latestBuild;
|
||||
Height = badge_height;
|
||||
|
@ -152,7 +152,7 @@ namespace osu.Game.Overlays
|
||||
return false;
|
||||
}
|
||||
|
||||
private void onBuildSelected(APIChangelog build, EventArgs e) => FetchAndShowBuild(build);
|
||||
private void onBuildSelected(APIChangelogBuild build, EventArgs e) => FetchAndShowBuild(build);
|
||||
|
||||
private void fetchListing()
|
||||
{
|
||||
@ -183,12 +183,12 @@ namespace osu.Game.Overlays
|
||||
/// <summary>
|
||||
/// Fetches and shows a specific build from a specific update stream.
|
||||
/// </summary>
|
||||
/// <param name="build">Must contain at least <see cref="APIChangelog.UpdateStream.Name"/> and
|
||||
/// <see cref="APIChangelog.Version"/>. If <see cref="APIChangelog.UpdateStream.DisplayName"/> and
|
||||
/// <see cref="APIChangelog.DisplayVersion"/> are specified, the header will instantly display them.</param>
|
||||
/// <param name="build">Must contain at least <see cref="APIChangelogBuild.UpdateStream.Name"/> and
|
||||
/// <see cref="APIChangelogBuild.Version"/>. If <see cref="APIChangelogBuild.UpdateStream.DisplayName"/> and
|
||||
/// <see cref="APIChangelogBuild.DisplayVersion"/> are specified, the header will instantly display them.</param>
|
||||
/// <param name="updateBadges">Whether to update badges. Should be set to false in case
|
||||
/// the function is called by selecting a badge, to avoid an infinite loop.</param>
|
||||
public void FetchAndShowBuild(APIChangelog build, bool updateBadges = true)
|
||||
public void FetchAndShowBuild(APIChangelogBuild build, bool updateBadges = true)
|
||||
{
|
||||
var req = new GetChangelogBuildRequest(build.UpdateStream.Name, build.Version);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user