1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Hide unnecessary profile sections for bots (#6289)

Hide unnecessary profile sections for bots

Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
This commit is contained in:
Dean Herbert 2019-10-01 16:08:30 +08:00 committed by GitHub
commit 2f877be0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 10 deletions

View File

@ -107,6 +107,15 @@ namespace osu.Game.Tests.Visual.Online
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
}, api.IsLoggedIn));
AddStep("Show bancho", () => profile.ShowUser(new User
{
Username = @"BanchoBot",
Id = 3,
IsBot = true,
Country = new Country { FullName = @"Saint Helena", FlagName = @"SH" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c4.jpg"
}, api.IsLoggedIn));
AddStep("Hide", profile.Hide);
AddStep("Show without reload", profile.Show);
}

View File

@ -44,7 +44,8 @@ namespace osu.Game.Overlays
Clear();
lastSection = null;
sections = new ProfileSection[]
sections = !user.IsBot
? new ProfileSection[]
{
//new AboutSection(),
new RecentSection(),
@ -53,6 +54,10 @@ namespace osu.Game.Overlays
new HistoricalSection(),
new BeatmapsSection(),
new KudosuSection()
}
: new ProfileSection[]
{
//new AboutSection(),
};
tabs = new ProfileTabControl

View File

@ -78,6 +78,9 @@ namespace osu.Game.Users
[JsonProperty(@"is_bng")]
public bool IsBNG;
[JsonProperty(@"is_bot")]
public bool IsBot;
[JsonProperty(@"is_active")]
public bool Active;