Fix RCS1061

This commit is contained in:
RoosterDragon
2023-03-18 12:16:52 +00:00
committed by Gustas
parent 5d91b678bb
commit 4dd787be13
32 changed files with 167 additions and 210 deletions

View File

@@ -100,27 +100,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
badgesVisible = false;
if (localProfile.State == LocalPlayerProfile.LinkState.Linked)
if (localProfile.State == LocalPlayerProfile.LinkState.Linked && localProfile.ProfileData.Badges.Count > 0)
{
if (localProfile.ProfileData.Badges.Count > 0)
{
Func<int, int> negotiateWidth = _ => widget.Get("PROFILE_HEADER").Bounds.Width;
Func<int, int> negotiateWidth = _ => widget.Get("PROFILE_HEADER").Bounds.Width;
// Remove any stale badges that may be left over from a previous session
badgeContainer.RemoveChildren();
// Remove any stale badges that may be left over from a previous session
badgeContainer.RemoveChildren();
var badges = Ui.LoadWidget("PLAYER_PROFILE_BADGES_INSERT", badgeContainer, new WidgetArgs()
var badges = Ui.LoadWidget("PLAYER_PROFILE_BADGES_INSERT", badgeContainer, new WidgetArgs()
{
{ "worldRenderer", worldRenderer },
{ "profile", localProfile.ProfileData },
{ "negotiateWidth", negotiateWidth }
});
if (badges.Bounds.Height > 0)
{
badgeContainer.Bounds.Height = badges.Bounds.Height;
badgesVisible = true;
}
if (badges.Bounds.Height > 0)
{
badgeContainer.Bounds.Height = badges.Bounds.Height;
badgesVisible = true;
}
}