mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Improve fake-api
This commit is contained in:
@ -7,16 +7,16 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
public class GetChangelogBuildRequest : APIRequest<APIChangelog>
|
public class GetChangelogBuildRequest : APIRequest<APIChangelog>
|
||||||
{
|
{
|
||||||
//private readonly string name;
|
private readonly string name;
|
||||||
//private readonly string version;
|
private readonly string version;
|
||||||
|
|
||||||
//public GetChangelogBuildRequest(string streamName, string buildVersion)
|
public GetChangelogBuildRequest(string streamName, string buildVersion)
|
||||||
//{
|
{
|
||||||
// name = streamName;
|
name = streamName;
|
||||||
// version = buildVersion;
|
version = buildVersion;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//protected override string Target => $@"changelog/{name}/{version}";
|
protected override string Target => $@"changelog/{name}/{version}";
|
||||||
protected override string Uri => @"https://api.myjson.com/bins/ya5q2"; // for testing
|
protected override string Uri => $@"https://houtarouoreki.github.io/fake-api/{Target}"; // for testing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
public class GetChangelogLatestBuildsRequest : APIRequest<List<APIChangelog>>
|
public class GetChangelogLatestBuildsRequest : APIRequest<List<APIChangelog>>
|
||||||
{
|
{
|
||||||
//protected override string Target => @"changelog";
|
protected override string Target => @"changelog/latest-builds";
|
||||||
protected override string Uri => @"https://api.myjson.com/bins/16waui"; // for testing
|
protected override string Uri => $@"https://houtarouoreki.github.io/fake-api/{Target}"; // for testing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
public class GetChangelogRequest : APIRequest<APIChangelog[]>
|
public class GetChangelogRequest : APIRequest<APIChangelog[]>
|
||||||
{
|
{
|
||||||
//protected override string Target => @"changelog";
|
protected override string Target => @"changelog";
|
||||||
protected override string Uri => @"https://api.myjson.com/bins/6zv2i"; // for testing
|
protected override string Uri => $@"https://houtarouoreki.github.io/fake-api/{Target}"; // for testing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,8 +41,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
add(changelog);
|
add(changelog);
|
||||||
//fetchChangelogBuild(changelog);
|
fetchChangelogBuild(changelog);
|
||||||
fetchChangelogBuild();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNext()
|
private void showNext()
|
||||||
@ -69,11 +68,9 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
this.api = api;
|
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 =>
|
req.Success += res =>
|
||||||
{
|
{
|
||||||
currentBuild = res;
|
currentBuild = res;
|
||||||
|
@ -108,20 +108,10 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
public void UpdateChevronTooltips(string previousVersion, string nextVersion)
|
public void UpdateChevronTooltips(string previousVersion, string nextVersion)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(previousVersion))
|
if (!string.IsNullOrEmpty(previousVersion))
|
||||||
chevronPrevious.IsEnabled = false;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
chevronPrevious.TooltipText = previousVersion;
|
chevronPrevious.TooltipText = previousVersion;
|
||||||
chevronPrevious.IsEnabled = true;
|
if (!string.IsNullOrEmpty(nextVersion))
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(nextVersion))
|
|
||||||
chevronNext.IsEnabled = false;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
chevronNext.TooltipText = nextVersion;
|
chevronNext.TooltipText = nextVersion;
|
||||||
chevronNext.IsEnabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//public ChangelogContentGroup() { } // for listing
|
//public ChangelogContentGroup() { } // for listing
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user