mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Merge branch 'master' into improve-waveform-test
This commit is contained in:
@ -0,0 +1,150 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
public class TestCaseFrameStabilityContainer : OsuTestCase
|
||||
{
|
||||
private readonly ManualClock manualClock;
|
||||
|
||||
private readonly Container mainContainer;
|
||||
|
||||
private ClockConsumingChild consumer;
|
||||
|
||||
public TestCaseFrameStabilityContainer()
|
||||
{
|
||||
Child = mainContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = new FramedClock(manualClock = new ManualClock()),
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLargeJumps()
|
||||
{
|
||||
seekManualTo(0);
|
||||
createStabilityContainer();
|
||||
seekManualTo(100000);
|
||||
|
||||
confirmSeek(100000);
|
||||
checkFrameCount(6000);
|
||||
|
||||
seekManualTo(0);
|
||||
|
||||
confirmSeek(0);
|
||||
checkFrameCount(12000);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSmallJumps()
|
||||
{
|
||||
seekManualTo(0);
|
||||
createStabilityContainer();
|
||||
seekManualTo(40);
|
||||
|
||||
confirmSeek(40);
|
||||
checkFrameCount(3);
|
||||
|
||||
seekManualTo(0);
|
||||
|
||||
confirmSeek(0);
|
||||
checkFrameCount(6);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSingleFrameJump()
|
||||
{
|
||||
seekManualTo(0);
|
||||
createStabilityContainer();
|
||||
seekManualTo(8);
|
||||
confirmSeek(8);
|
||||
checkFrameCount(1);
|
||||
|
||||
seekManualTo(16);
|
||||
confirmSeek(16);
|
||||
checkFrameCount(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestInitialSeek()
|
||||
{
|
||||
seekManualTo(100000);
|
||||
createStabilityContainer();
|
||||
|
||||
confirmSeek(100000);
|
||||
checkFrameCount(0);
|
||||
}
|
||||
|
||||
private void createStabilityContainer() => AddStep("create container", () => mainContainer.Child = new FrameStabilityContainer().WithChild(consumer = new ClockConsumingChild()));
|
||||
|
||||
private void seekManualTo(double time) => AddStep($"seek manual clock to {time}", () => manualClock.CurrentTime = time);
|
||||
|
||||
private void confirmSeek(double time) => AddUntilStep($"wait for seek to {time}", () => consumer.Clock.CurrentTime == time);
|
||||
|
||||
private void checkFrameCount(int frames) =>
|
||||
AddAssert($"elapsed frames is {frames}", () => consumer.ElapsedFrames == frames);
|
||||
|
||||
public class ClockConsumingChild : CompositeDrawable
|
||||
{
|
||||
private readonly OsuSpriteText text;
|
||||
private readonly OsuSpriteText text2;
|
||||
private readonly OsuSpriteText text3;
|
||||
|
||||
public ClockConsumingChild()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
text = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
text2 = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
text3 = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public int ElapsedFrames;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (Clock.ElapsedFrameTime != 0)
|
||||
ElapsedFrames++;
|
||||
|
||||
text.Text = $"current time: {Clock.CurrentTime:F0}";
|
||||
if (Clock.ElapsedFrameTime != 0)
|
||||
text2.Text = $"last elapsed frame time: {Clock.ElapsedFrameTime:F0}";
|
||||
text3.Text = $"total frames: {ElapsedFrames:F0}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,21 +10,25 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
public class TestCasePlayerLoader : ManualInputManagerTestCase
|
||||
{
|
||||
private PlayerLoader loader;
|
||||
private readonly OsuScreenStack stack;
|
||||
private OsuScreenStack stack;
|
||||
|
||||
public TestCasePlayerLoader()
|
||||
[SetUp]
|
||||
public void Setup() => Schedule(() =>
|
||||
{
|
||||
InputManager.Add(stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both });
|
||||
}
|
||||
InputManager.Child = stack = new OsuScreenStack { RelativeSizeAxes = Axes.Both };
|
||||
Beatmap.Value = new TestWorkingBeatmap(new TestBeatmap(new OsuRuleset().RulesetInfo), Clock);
|
||||
});
|
||||
|
||||
[Test]
|
||||
public void TestLoadContinuation()
|
||||
@ -33,8 +37,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
|
||||
AddStep("mouse in centre", () => InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre));
|
||||
AddUntilStep("wait for no longer current", () => !loader.IsCurrentScreen());
|
||||
AddStep("exit loader", () => loader.Exit());
|
||||
AddUntilStep("wait for no longer alive", () => !loader.IsAlive);
|
||||
AddStep("load slow dummy beatmap", () =>
|
||||
{
|
||||
SlowLoadPlayer slow = null;
|
||||
@ -58,41 +60,25 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddStep("load player", () =>
|
||||
{
|
||||
Mods.Value = new[] { gameMod = new TestMod() };
|
||||
InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre);
|
||||
stack.Push(new PlayerLoader(() => player = new TestPlayer()));
|
||||
});
|
||||
|
||||
AddUntilStep("wait for player to become current", () =>
|
||||
{
|
||||
if (player.IsCurrentScreen())
|
||||
{
|
||||
playerMod1 = (TestMod)player.Mods.Value.Single();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
stack.Push(loader = new PlayerLoader(() => player = new TestPlayer()));
|
||||
});
|
||||
|
||||
AddUntilStep("wait for loader to become current", () => loader.IsCurrentScreen());
|
||||
AddStep("mouse in centre", () => InputManager.MoveMouseTo(loader.ScreenSpaceDrawQuad.Centre));
|
||||
AddUntilStep("wait for player to be current", () => player.IsCurrentScreen());
|
||||
AddStep("retrieve mods", () => playerMod1 = (TestMod)player.Mods.Value.Single());
|
||||
AddAssert("game mods not applied", () => gameMod.Applied == false);
|
||||
AddAssert("player mods applied", () => playerMod1.Applied);
|
||||
|
||||
AddStep("restart player", () =>
|
||||
{
|
||||
var lastPlayer = player;
|
||||
player = null;
|
||||
player.Restart();
|
||||
});
|
||||
|
||||
AddUntilStep("wait for player to become current", () =>
|
||||
{
|
||||
if (player.IsCurrentScreen())
|
||||
{
|
||||
playerMod2 = (TestMod)player.Mods.Value.Single();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
lastPlayer.Restart();
|
||||
});
|
||||
|
||||
AddUntilStep("wait for player to be current", () => player.IsCurrentScreen());
|
||||
AddStep("retrieve mods", () => playerMod2 = (TestMod)player.Mods.Value.Single());
|
||||
AddAssert("game mods not applied", () => gameMod.Applied == false);
|
||||
AddAssert("player has different mods", () => playerMod1 != playerMod2);
|
||||
AddAssert("player mods applied", () => playerMod2.Applied);
|
||||
|
@ -120,12 +120,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
}
|
||||
}
|
||||
|
||||
private class SecondarySource : ISkinSource
|
||||
private class SecondarySource : ISkin
|
||||
{
|
||||
public event Action SourceChanged;
|
||||
|
||||
public void TriggerSourceChanged() => SourceChanged?.Invoke();
|
||||
|
||||
public Drawable GetDrawableComponent(string componentName) => new SecondarySourceBox();
|
||||
|
||||
public Texture GetTexture(string componentName) => throw new NotImplementedException();
|
||||
@ -135,12 +131,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private class SkinSourceContainer : Container, ISkinSource
|
||||
private class SkinSourceContainer : Container, ISkin
|
||||
{
|
||||
public event Action SourceChanged;
|
||||
|
||||
public void TriggerSourceChanged() => SourceChanged?.Invoke();
|
||||
|
||||
public Drawable GetDrawableComponent(string componentName) => new BaseSourceBox();
|
||||
|
||||
public Texture GetTexture(string componentName) => throw new NotImplementedException();
|
||||
|
@ -23,7 +23,11 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
|
||||
public TestCaseLoaderAnimation()
|
||||
{
|
||||
Child = logo = new OsuLogo { Depth = float.MinValue };
|
||||
Child = logo = new OsuLogo
|
||||
{
|
||||
Alpha = 0,
|
||||
Depth = float.MinValue
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -39,7 +43,7 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
LoadScreen(loader);
|
||||
});
|
||||
|
||||
AddAssert("loaded", () =>
|
||||
AddUntilStep("loaded", () =>
|
||||
{
|
||||
logoVisible = loader.Logo?.Alpha > 0;
|
||||
return loader.Logo != null && loader.ScreenLoaded;
|
||||
|
@ -1,62 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestCaseBadgeContainer : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(BadgeContainer) };
|
||||
|
||||
public TestCaseBadgeContainer()
|
||||
{
|
||||
BadgeContainer badgeContainer;
|
||||
|
||||
Child = badgeContainer = new BadgeContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
};
|
||||
|
||||
AddStep("Show 1 badge", () => badgeContainer.ShowBadges(new[]
|
||||
{
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = "Appreciates compasses",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/mg2018-1star.png",
|
||||
}
|
||||
}));
|
||||
|
||||
AddStep("Show 2 badges", () => badgeContainer.ShowBadges(new[]
|
||||
{
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = "Contributed to osu!lazer testing",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/contributor.png",
|
||||
},
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = "Appreciates compasses",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/mg2018-1star.png",
|
||||
}
|
||||
}));
|
||||
|
||||
AddStep("Show many badges", () => badgeContainer.ShowBadges(Enumerable.Range(1, 20).Select(i => new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.Now,
|
||||
Description = $"Contributed to osu!lazer testing {i} times",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/contributor.jpg",
|
||||
}).ToArray()));
|
||||
}
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
|
@ -38,6 +38,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Country = new Country { FlagName = @"AU" },
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
||||
IsSupporter = true,
|
||||
SupportLevel = 3,
|
||||
}) { Width = 300 },
|
||||
},
|
||||
});
|
||||
|
@ -6,11 +6,12 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -19,7 +20,9 @@ namespace osu.Game.Tests.Visual.Online
|
||||
public class TestCaseUserProfile : OsuTestCase
|
||||
{
|
||||
private readonly TestUserProfileOverlay profile;
|
||||
private IAPIProvider api;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
@ -27,7 +30,46 @@ namespace osu.Game.Tests.Visual.Online
|
||||
typeof(UserProfileOverlay),
|
||||
typeof(RankGraph),
|
||||
typeof(LineGraph),
|
||||
typeof(BadgeContainer)
|
||||
typeof(SectionsContainer<>),
|
||||
typeof(SupporterIcon)
|
||||
};
|
||||
|
||||
public static readonly User TEST_USER = new User
|
||||
{
|
||||
Username = @"Somebody",
|
||||
Id = 1,
|
||||
Country = new Country { FullName = @"Alien" },
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
|
||||
JoinDate = DateTimeOffset.Now.AddDays(-1),
|
||||
LastVisit = DateTimeOffset.Now,
|
||||
ProfileOrder = new[] { "me" },
|
||||
Statistics = new UserStatistics
|
||||
{
|
||||
Ranks = new UserStatistics.UserRanks { Global = 2148, Country = 1 },
|
||||
PP = 4567.89m,
|
||||
Level = new UserStatistics.LevelInfo
|
||||
{
|
||||
Current = 727,
|
||||
Progress = 69,
|
||||
}
|
||||
},
|
||||
RankHistory = new User.RankHistoryData
|
||||
{
|
||||
Mode = @"osu",
|
||||
Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray()
|
||||
},
|
||||
Badges = new[]
|
||||
{
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.FromUnixTimeSeconds(1505741569),
|
||||
Description = "Outstanding help by being a voluntary test subject.",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/contributor.jpg"
|
||||
}
|
||||
},
|
||||
Title = "osu!volunteer",
|
||||
Colour = "ff0000",
|
||||
Achievements = new User.UserAchievement[0],
|
||||
};
|
||||
|
||||
public TestCaseUserProfile()
|
||||
@ -35,47 +77,11 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Add(profile = new TestUserProfileOverlay());
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IAPIProvider api)
|
||||
{
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
AddStep("Show offline dummy", () => profile.ShowUser(new User
|
||||
{
|
||||
Username = @"Somebody",
|
||||
Id = 1,
|
||||
Country = new Country { FullName = @"Alien" },
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
|
||||
JoinDate = DateTimeOffset.Now.AddDays(-1),
|
||||
LastVisit = DateTimeOffset.Now,
|
||||
ProfileOrder = new[] { "me" },
|
||||
Statistics = new UserStatistics
|
||||
{
|
||||
Ranks = new UserStatistics.UserRanks { Global = 2148, Country = 1 },
|
||||
PP = 4567.89m,
|
||||
},
|
||||
RankHistory = new User.RankHistoryData
|
||||
{
|
||||
Mode = @"osu",
|
||||
Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray()
|
||||
},
|
||||
Badges = new[]
|
||||
{
|
||||
new Badge
|
||||
{
|
||||
AwardedAt = DateTimeOffset.FromUnixTimeSeconds(1505741569),
|
||||
Description = "Outstanding help by being a voluntary test subject.",
|
||||
ImageUrl = "https://assets.ppy.sh/profile-badges/contributor.jpg"
|
||||
}
|
||||
}
|
||||
}, false));
|
||||
|
||||
checkSupporterTag(false);
|
||||
AddStep("Show offline dummy", () => profile.ShowUser(TEST_USER, false));
|
||||
|
||||
AddStep("Show null dummy", () => profile.ShowUser(new User
|
||||
{
|
||||
@ -92,8 +98,6 @@ namespace osu.Game.Tests.Visual.Online
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
||||
}, api.IsLoggedIn));
|
||||
|
||||
checkSupporterTag(true);
|
||||
|
||||
AddStep("Show flyte", () => profile.ShowUser(new User
|
||||
{
|
||||
Username = @"flyte",
|
||||
@ -106,15 +110,6 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("Show without reload", profile.Show);
|
||||
}
|
||||
|
||||
private void checkSupporterTag(bool isSupporter)
|
||||
{
|
||||
AddUntilStep("wait for load", () => profile.Header.User != null);
|
||||
if (isSupporter)
|
||||
AddAssert("is supporter", () => profile.Header.SupporterTag.Alpha == 1);
|
||||
else
|
||||
AddAssert("no supporter", () => profile.Header.SupporterTag.Alpha == 0);
|
||||
}
|
||||
|
||||
private class TestUserProfileOverlay : UserProfileOverlay
|
||||
{
|
||||
public new ProfileHeader Header => base.Header;
|
||||
|
81
osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs
Normal file
81
osu.Game.Tests/Visual/Online/TestCaseUserProfileHeader.cs
Normal file
@ -0,0 +1,81 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.Profile;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestCaseUserProfileHeader : OsuTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(ProfileHeader),
|
||||
typeof(RankGraph),
|
||||
typeof(LineGraph),
|
||||
typeof(ProfileHeaderTabControl),
|
||||
typeof(CentreHeaderContainer),
|
||||
typeof(BottomHeaderContainer),
|
||||
typeof(DetailHeaderContainer),
|
||||
typeof(ProfileHeaderButton)
|
||||
};
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
private readonly ProfileHeader header;
|
||||
|
||||
public TestCaseUserProfileHeader()
|
||||
{
|
||||
header = new ProfileHeader();
|
||||
Add(header);
|
||||
|
||||
AddStep("Show offline dummy", () => header.User.Value = TestCaseUserProfile.TEST_USER);
|
||||
|
||||
AddStep("Show null dummy", () => header.User.Value = new User
|
||||
{
|
||||
Username = "Null"
|
||||
});
|
||||
|
||||
addOnlineStep("Show ppy", new User
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
IsSupporter = true,
|
||||
Country = new Country { FullName = @"Australia", FlagName = @"AU" },
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
||||
});
|
||||
|
||||
addOnlineStep("Show flyte", new User
|
||||
{
|
||||
Username = @"flyte",
|
||||
Id = 3103765,
|
||||
Country = new Country { FullName = @"Japan", FlagName = @"JP" },
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
||||
});
|
||||
}
|
||||
|
||||
private void addOnlineStep(string name, User fallback)
|
||||
{
|
||||
AddStep(name, () =>
|
||||
{
|
||||
if (api.IsLoggedIn)
|
||||
{
|
||||
var request = new GetUserRequest(fallback.Id);
|
||||
request.Success += user => header.User.Value = user;
|
||||
api.Queue(request);
|
||||
}
|
||||
else
|
||||
header.User.Value = fallback;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user