mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
get everything working again
This commit is contained in:
parent
5bc6042309
commit
ccc804a9b2
@ -11,7 +11,7 @@ using osu.Game.Overlays.Profile;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestCaseUserProfileHeader : OsuTestCase
|
||||
{
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual
|
||||
};
|
||||
|
||||
[Resolved]
|
||||
private APIAccess api { get; set; }
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
private readonly ProfileHeader header;
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
private readonly SpriteIcon iconSprite;
|
||||
private readonly OsuSpriteText titleText, pageText;
|
||||
public const float ICON_WIDTH = icon_size + icon_spacing;
|
||||
private const float icon_size = 25, icon_spacing = 10;
|
||||
|
||||
protected IconUsage Icon
|
||||
{
|
||||
@ -48,12 +50,12 @@ namespace osu.Game.Graphics.UserInterface
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Spacing = new Vector2(10, 0),
|
||||
Spacing = new Vector2(icon_spacing, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
iconSprite = new SpriteIcon
|
||||
{
|
||||
Size = new Vector2(25),
|
||||
Size = new Vector2(icon_size),
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
bottomTopLinkContainer.AddText("Contributed ");
|
||||
bottomTopLinkContainer.AddLink($@"{user.PostCount:#,##0} forum posts", $"https://osu.ppy.sh/users/{user.Id}/posts", creationParameters: bold);
|
||||
|
||||
void tryAddInfo(FontAwesome icon, string content, string link = null)
|
||||
void tryAddInfo(IconUsage icon, string content, string link = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(content)) return;
|
||||
|
||||
@ -138,16 +138,16 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
websiteWithoutProtcol = websiteWithoutProtcol.Substring(protocolIndex + 2);
|
||||
}
|
||||
|
||||
tryAddInfo(FontAwesome.fa_map_marker, user.Location);
|
||||
tryAddInfo(FontAwesome.fa_heart_o, user.Interests);
|
||||
tryAddInfo(FontAwesome.fa_suitcase, user.Occupation);
|
||||
tryAddInfo(FontAwesome.Solid.MapMarker, user.Location);
|
||||
tryAddInfo(OsuIcon.Heart, user.Interests);
|
||||
tryAddInfo(FontAwesome.Solid.Suitcase, user.Occupation);
|
||||
bottomLinkContainer.NewLine();
|
||||
if (!string.IsNullOrEmpty(user.Twitter))
|
||||
tryAddInfo(FontAwesome.fa_twitter, "@" + user.Twitter, $@"https://twitter.com/{user.Twitter}");
|
||||
tryAddInfo(FontAwesome.fa_gamepad, user.Discord); //todo: update fontawesome to include discord logo
|
||||
tryAddInfo(FontAwesome.fa_skype, user.Skype, @"skype:" + user.Skype + @"?chat");
|
||||
tryAddInfo(FontAwesome.fa_lastfm, user.Lastfm, $@"https://last.fm/users/{user.Lastfm}");
|
||||
tryAddInfo(FontAwesome.fa_link, websiteWithoutProtcol, user.Website);
|
||||
tryAddInfo(FontAwesome.Brands.Twitter, "@" + user.Twitter, $@"https://twitter.com/{user.Twitter}");
|
||||
tryAddInfo(FontAwesome.Brands.Discord, user.Discord);
|
||||
tryAddInfo(FontAwesome.Brands.Skype, user.Skype, @"skype:" + user.Skype + @"?chat");
|
||||
tryAddInfo(FontAwesome.Brands.Lastfm, user.Lastfm, $@"https://last.fm/users/{user.Lastfm}");
|
||||
tryAddInfo(FontAwesome.Solid.Link, websiteWithoutProtcol, user.Website);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Icon = FontAwesome.fa_user,
|
||||
Icon = FontAwesome.Solid.User,
|
||||
FillMode = FillMode.Fit,
|
||||
Size = new Vector2(50, 14)
|
||||
},
|
||||
@ -116,7 +116,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(20),
|
||||
Icon = FontAwesome.fa_chevron_up,
|
||||
Icon = FontAwesome.Solid.ChevronUp,
|
||||
},
|
||||
}
|
||||
},
|
||||
@ -212,7 +212,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
detailsToggleButton.Action = () =>
|
||||
{
|
||||
detailsVisible = !detailsVisible;
|
||||
expandButtonIcon.Icon = detailsVisible ? FontAwesome.fa_chevron_down : FontAwesome.fa_chevron_up;
|
||||
expandButtonIcon.Icon = detailsVisible ? FontAwesome.Solid.ChevronDown : FontAwesome.Solid.ChevronUp;
|
||||
hiddenDetailContainer.Alpha = detailsVisible ? 1 : 0;
|
||||
expandedDetailContainer.Alpha = detailsVisible ? 0 : 1;
|
||||
DetailsVisibilityAction(detailsVisible);
|
||||
|
@ -4,7 +4,7 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Users;
|
||||
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
private ChatOverlay chatOverlay { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private APIAccess apiAccess { get; set; }
|
||||
private IAPIProvider apiProvider { get; set; }
|
||||
|
||||
public ProfileMessageButton()
|
||||
{
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Icon = FontAwesome.fa_envelope,
|
||||
Icon = FontAwesome.Solid.Envelope,
|
||||
FillMode = FillMode.Fit,
|
||||
Size = new Vector2(50, 14)
|
||||
};
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
chatOverlay?.Show();
|
||||
};
|
||||
|
||||
User.ValueChanged += e => Content.Alpha = !e.NewValue.PMFriendsOnly && apiAccess.LocalUser.Value.Id != e.NewValue.Id ? 1 : 0;
|
||||
User.ValueChanged += e => Content.Alpha = !e.NewValue.PMFriendsOnly && apiProvider.LocalUser.Value.Id != e.NewValue.Id ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
{
|
||||
Width = 12,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Icon = FontAwesome.fa_heart,
|
||||
Icon = FontAwesome.Solid.Heart,
|
||||
});
|
||||
}
|
||||
|
||||
@ -66,8 +66,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
AutoSizeAxes = Axes.X,
|
||||
Height = 0.6f,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.Solid.Heart,
|
||||
Origin = Anchor.Centre
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -5,11 +5,11 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Profile.Header;
|
||||
using osu.Game.Users;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Profile
|
||||
@ -17,7 +17,6 @@ namespace osu.Game.Overlays.Profile
|
||||
public class ProfileHeader : Container
|
||||
{
|
||||
private readonly UserCoverBackground coverContainer;
|
||||
private readonly ScreenTitle coverTitle;
|
||||
private readonly ProfileHeaderTabControl infoTabControl;
|
||||
|
||||
private const float cover_height = 150;
|
||||
@ -52,10 +51,9 @@ namespace osu.Game.Overlays.Profile
|
||||
Depth = -float.MaxValue,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
coverTitle = new ScreenTitle
|
||||
new ProfileHeaderTitle
|
||||
{
|
||||
Title = "Player ",
|
||||
Page = "Info"
|
||||
X = -ScreenTitle.ICON_WIDTH,
|
||||
},
|
||||
infoTabControl = new ProfileHeaderTabControl
|
||||
{
|
||||
@ -113,10 +111,8 @@ namespace osu.Game.Overlays.Profile
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, TextureStore textures)
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
coverTitle.AccentColour = colours.CommunityUserGreen;
|
||||
|
||||
infoTabControl.AccentColour = colours.CommunityUserGreen;
|
||||
}
|
||||
|
||||
@ -131,5 +127,20 @@ namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
public string TooltipText { get; set; }
|
||||
}
|
||||
|
||||
private class ProfileHeaderTitle : ScreenTitle
|
||||
{
|
||||
public ProfileHeaderTitle()
|
||||
{
|
||||
Title = "Player ";
|
||||
Section = "Info";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
AccentColour = colours.CommunityUserGreen;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Multi
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
X = -35,
|
||||
X = -ScreenTitle.ICON_WIDTH,
|
||||
},
|
||||
breadcrumbs = new HeaderBreadcrumbControl(stack)
|
||||
{
|
||||
|
@ -36,15 +36,16 @@ namespace osu.Game.Users
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Sprite
|
||||
var sprite = new Sprite
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Texture = textures.Get(user.CoverUrl),
|
||||
FillMode = FillMode.Fill,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400),
|
||||
Origin = Anchor.Centre
|
||||
};
|
||||
sprite.OnLoadComplete += d => d.FadeInFromZero(400);
|
||||
return sprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ namespace osu.Game.Users
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new DelayedLoadWrapper(coverBackground = new UserCoverBackground(user)
|
||||
new DelayedLoadWrapper(coverBackground = new UserCoverBackground
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
|
Loading…
Reference in New Issue
Block a user