From a1c3a456fbd5512bd9748ffab6dd03924860c32f Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 13 Jun 2017 03:31:17 +0800 Subject: [PATCH] Add placeholder text in profile header. --- osu.Game/Users/Profile/ProfileHeader.cs | 48 ++++++++++++++++++++++++- osu.Game/Users/UserProfile.cs | 4 +-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/osu.Game/Users/Profile/ProfileHeader.cs b/osu.Game/Users/Profile/ProfileHeader.cs index d7b874da07..7d3d3a4c28 100644 --- a/osu.Game/Users/Profile/ProfileHeader.cs +++ b/osu.Game/Users/Profile/ProfileHeader.cs @@ -1,11 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; namespace osu.Game.Users.Profile @@ -14,12 +18,14 @@ namespace osu.Game.Users.Profile { private readonly User user; + private readonly OsuTextFlowContainer infoText; + private const float cover_height = 200, avatar_size = 110, avatar_bottom_position = -20; public ProfileHeader(User user) { this.user = user; RelativeSizeAxes = Axes.X; - Height = cover_height; + Height = cover_height + cover_height - UserProfile.TAB_HEIGHT; Children = new Drawable[] { @@ -84,8 +90,48 @@ namespace osu.Game.Users.Profile } } } + }, + infoText = new OsuTextFlowContainer(t => + { + t.TextSize = 12; + t.Alpha = 0.8f; + }) + { + Y = cover_height + 20, + Margin = new MarginPadding { Horizontal = UserProfile.CONTENT_X_MARGIN }, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + ParagraphSpacing = 1, + //LineSpacing = 0.5f } }; + + Action bold = t => + { + t.Font = @"Exo2.0-Bold"; + t.Alpha = 1; + }; + // placeholder text + infoText.AddTextAwesome(FontAwesome.fa_map_marker); + infoText.AddText(" position "); + infoText.AddTextAwesome(FontAwesome.fa_twitter); + infoText.AddText(" tweet "); + infoText.AddTextAwesome(FontAwesome.fa_heart_o); + infoText.AddText(" favorite "); + infoText.NewParagraph(); + infoText.AddText("0 years old"); + infoText.NewLine(); + infoText.AddText("Commander of "); + infoText.AddText("The Color Scribbles", bold); + infoText.NewParagraph(); + infoText.AddText("Joined since "); + infoText.AddText("June 2017", bold); + infoText.NewLine(); + infoText.AddText("Last seen "); + infoText.AddText("0 minutes ago", bold); + infoText.NewParagraph(); + infoText.AddText("Play with "); + infoText.AddText("Mouse, Keyboard, Tablet", bold); } } } diff --git a/osu.Game/Users/UserProfile.cs b/osu.Game/Users/UserProfile.cs index 27f18a0f14..bbe73b8124 100644 --- a/osu.Game/Users/UserProfile.cs +++ b/osu.Game/Users/UserProfile.cs @@ -22,7 +22,7 @@ namespace osu.Game.Users private ProfileSection lastSection; private readonly ProfileTabControl tabs; - public const float CONTENT_X_MARGIN = 50; + public const float CONTENT_X_MARGIN = 50, TAB_HEIGHT = 24; public UserProfile(User user) { @@ -42,7 +42,7 @@ namespace osu.Game.Users RelativeSizeAxes = Axes.X, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Height = 24 + Height = TAB_HEIGHT }; sections.ForEach(tabs.AddItem);