1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:02: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" CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
}, api.IsLoggedIn)); }, 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("Hide", profile.Hide);
AddStep("Show without reload", profile.Show); AddStep("Show without reload", profile.Show);
} }

View File

@ -44,16 +44,21 @@ namespace osu.Game.Overlays
Clear(); Clear();
lastSection = null; lastSection = null;
sections = new ProfileSection[] sections = !user.IsBot
{ ? new ProfileSection[]
//new AboutSection(), {
new RecentSection(), //new AboutSection(),
new RanksSection(), new RecentSection(),
//new MedalsSection(), new RanksSection(),
new HistoricalSection(), //new MedalsSection(),
new BeatmapsSection(), new HistoricalSection(),
new KudosuSection() new BeatmapsSection(),
}; new KudosuSection()
}
: new ProfileSection[]
{
//new AboutSection(),
};
tabs = new ProfileTabControl tabs = new ProfileTabControl
{ {

View File

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