mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge pull request #2427 from peppy/fix-badge-container
Fix BadgeContainer being unable to handle null badges
This commit is contained in:
@ -92,22 +92,18 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
|
|
||||||
public void ShowBadges(Badge[] badges)
|
public void ShowBadges(Badge[] badges)
|
||||||
{
|
{
|
||||||
switch (badges.Length)
|
if (badges == null || badges.Length == 0)
|
||||||
{
|
{
|
||||||
case 0:
|
Hide();
|
||||||
Hide();
|
return;
|
||||||
return;
|
|
||||||
case 1:
|
|
||||||
badgeCountText.Hide();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
badgeCountText.Show();
|
|
||||||
badgeCountText.Text = $"{badges.Length} badges";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Show();
|
|
||||||
badgeCount = badges.Length;
|
badgeCount = badges.Length;
|
||||||
|
|
||||||
|
badgeCountText.FadeTo(badgeCount > 1 ? 1 : 0);
|
||||||
|
badgeCountText.Text = $"{badges.Length} badges";
|
||||||
|
|
||||||
|
Show();
|
||||||
visibleBadge = 0;
|
visibleBadge = 0;
|
||||||
|
|
||||||
badgeFlowContainer.Clear();
|
badgeFlowContainer.Clear();
|
||||||
|
Reference in New Issue
Block a user