Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for viewing multiple profiles at once #247

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
using osuTK;
using osu.Game.Users.Drawables;

namespace PerformanceCalculatorGUI.Components
{
public partial class ExtendedCombinedProfileScore : ExtendedProfileScore
buyaspacecube marked this conversation as resolved.
Show resolved Hide resolved
{
private APIUser User;

public ExtendedCombinedProfileScore(ExtendedScore score, APIUser user)
: base(score)
{
User = user;
}

[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
AddInternal(new UpdateableAvatar(User, false)
{
Size = new Vector2(height)
});
}

protected override ExtendedProfileItemContainer ProfileScoreItems(RulesetStore rulesets)
{
var items = new ExtendedProfileItemContainer {
// This doesn't show the rounded corners on the right hand side but it's the best I could figure out, please feel free to improve it
Position = new Vector2(height, 0),
Padding = new MarginPadding { Right = height },

OnHoverAction = () =>
{
positionChangeText.Text = $"#{Score.Position.Value}";
},
OnUnhoverAction = () =>
{
positionChangeText.Text = $"{Score.PositionChange.Value:+0;-0;-}";
},
Children = ProfileScoreDrawables(rulesets)
};

return items;
}
}
}
Loading