mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 08:37:34 +09:00
Merge pull request #12044 from Joehuu/update-profile-kudosu-section
Update kudosu section on user profile overlay in line with web
This commit is contained in:
commit
0c272ce432
@ -23,51 +23,24 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
{
|
{
|
||||||
this.user.BindTo(user);
|
this.user.BindTo(user);
|
||||||
CountSection total;
|
CountSection total;
|
||||||
CountSection avaliable;
|
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
CornerRadius = 3;
|
CornerRadius = 3;
|
||||||
Children = new Drawable[]
|
Child = total = new CountTotal();
|
||||||
{
|
|
||||||
new FillFlowContainer
|
this.user.ValueChanged += u => total.Count = u.NewValue?.Kudosu.Total ?? 0;
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
Spacing = new Vector2(5, 0),
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
total = new CountTotal(),
|
|
||||||
avaliable = new CountAvailable()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.user.ValueChanged += u =>
|
|
||||||
{
|
|
||||||
total.Count = u.NewValue?.Kudosu.Total ?? 0;
|
|
||||||
avaliable.Count = u.NewValue?.Kudosu.Available ?? 0;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e) => true;
|
protected override bool OnClick(ClickEvent e) => true;
|
||||||
|
|
||||||
private class CountAvailable : CountSection
|
|
||||||
{
|
|
||||||
public CountAvailable()
|
|
||||||
: base("Kudosu Avaliable")
|
|
||||||
{
|
|
||||||
DescriptionText.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class CountTotal : CountSection
|
private class CountTotal : CountSection
|
||||||
{
|
{
|
||||||
public CountTotal()
|
public CountTotal()
|
||||||
: base("Total Kudosu Earned")
|
: base("Total Kudosu Earned")
|
||||||
{
|
{
|
||||||
DescriptionText.AddText("Based on how much of a contribution the user has made to beatmap moderation. See ");
|
DescriptionText.AddText("Based on how much of a contribution the user has made to beatmap moderation. See ");
|
||||||
DescriptionText.AddLink("this link", "https://osu.ppy.sh/wiki/Kudosu");
|
DescriptionText.AddLink("this page", "https://osu.ppy.sh/wiki/Kudosu");
|
||||||
DescriptionText.AddText(" for more information.");
|
DescriptionText.AddText(" for more information.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,13 +53,12 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
|
|
||||||
public new int Count
|
public new int Count
|
||||||
{
|
{
|
||||||
set => valueText.Text = value.ToString();
|
set => valueText.Text = value.ToString("N0");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CountSection(string header)
|
public CountSection(string header)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Width = 0.5f;
|
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Padding = new MarginPadding { Top = 10, Bottom = 20 };
|
Padding = new MarginPadding { Top = 10, Bottom = 20 };
|
||||||
Child = new FillFlowContainer
|
Child = new FillFlowContainer
|
||||||
@ -131,7 +103,6 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
lineBackground.Colour = colourProvider.Highlight1;
|
lineBackground.Colour = colourProvider.Highlight1;
|
||||||
DescriptionText.Colour = colourProvider.Foreground1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user