1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

Fix code quality, add new cards to the test scene

This commit is contained in:
StanR 2024-01-03 00:37:24 +06:00
parent 5eaf5fca2a
commit c4be6fa974
2 changed files with 24 additions and 4 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Scoring; using osu.Game.Scoring;
@ -29,6 +30,9 @@ namespace osu.Game.Tests.Visual.Online
private UserGridPanel boundPanel1; private UserGridPanel boundPanel1;
private TestUserListPanel boundPanel2; private TestUserListPanel boundPanel2;
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
[Resolved] [Resolved]
private IRulesetStore rulesetStore { get; set; } private IRulesetStore rulesetStore { get; set; }
@ -85,8 +89,25 @@ namespace osu.Game.Tests.Visual.Online
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/8195163/4a8e2ad5a02a2642b631438cfa6c6bd7e2f9db289be881cb27df18331f64144c.jpeg", CoverUrl = @"https://assets.ppy.sh/user-profile-covers/8195163/4a8e2ad5a02a2642b631438cfa6c6bd7e2f9db289be881cb27df18331f64144c.jpeg",
IsOnline = false, IsOnline = false,
LastVisit = DateTimeOffset.Now LastVisit = DateTimeOffset.Now
}) }),
}, new UserRankPanel(new APIUser
{
Username = @"flyte",
Id = 3103765,
CountryCode = CountryCode.JP,
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg",
Statistics = new UserStatistics { GlobalRank = 12345, CountryRank = 1234 }
}) { Width = 300 },
new UserRankPanel(new APIUser
{
Username = @"peppy",
Id = 2,
Colour = "99EB47",
CountryCode = CountryCode.AU,
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
Statistics = new UserStatistics { GlobalRank = null, CountryRank = null }
}) { Width = 300 }
}
}; };
boundPanel1.Status.BindTo(status); boundPanel1.Status.BindTo(status);

View File

@ -30,7 +30,6 @@ namespace osu.Game.Overlays.Login
[Resolved] [Resolved]
private OsuColour colours { get; set; } = null!; private OsuColour colours { get; set; } = null!;
private UserRankPanel panel = null!;
private UserDropdown dropdown = null!; private UserDropdown dropdown = null!;
/// <summary> /// <summary>
@ -131,7 +130,7 @@ namespace osu.Game.Overlays.Login
Text = LoginPanelStrings.SignedIn, Text = LoginPanelStrings.SignedIn,
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold), Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold),
}, },
panel = new UserRankPanel(api.LocalUser.Value) new UserRankPanel(api.LocalUser.Value)
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Action = RequestHide Action = RequestHide