Skip to content

Commit d6ab850

Browse files
committed
Fix team flag layout on user profile
1 parent 605979e commit d6ab850

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs

+42-16
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ public partial class TopHeaderContainer : CompositeDrawable
4242
private ExternalLinkButton openUserExternally = null!;
4343
private OsuSpriteText titleText = null!;
4444
private UpdateableFlag userFlag = null!;
45-
private UpdateableTeamFlag teamFlag = null!;
4645
private OsuHoverContainer userCountryContainer = null!;
4746
private OsuSpriteText userCountryText = null!;
47+
private UpdateableTeamFlag teamFlag = null!;
48+
private OsuSpriteText teamText;
4849
private GroupBadgeFlow groupBadgeFlow = null!;
4950
private ToggleCoverButton coverToggle = null!;
5051
private PreviousUsernamesDisplay previousUsernamesDisplay = null!;
@@ -161,27 +162,51 @@ private void load(OverlayColourProvider colourProvider, OsuConfigManager configM
161162
{
162163
AutoSizeAxes = Axes.Both,
163164
Direction = FillDirection.Horizontal,
165+
Spacing = new Vector2(10, 0),
164166
Children = new Drawable[]
165167
{
166-
userFlag = new UpdateableFlag
167-
{
168-
Size = new Vector2(28, 20),
169-
},
170-
teamFlag = new UpdateableTeamFlag
168+
new FillFlowContainer
171169
{
172-
Size = new Vector2(40, 20),
170+
AutoSizeAxes = Axes.Both,
171+
Direction = FillDirection.Horizontal,
172+
Spacing = new Vector2(4, 0),
173+
Children = new Drawable[]
174+
{
175+
userFlag = new UpdateableFlag
176+
{
177+
Size = new Vector2(28, 20),
178+
},
179+
userCountryContainer = new OsuHoverContainer
180+
{
181+
AutoSizeAxes = Axes.Both,
182+
Anchor = Anchor.CentreLeft,
183+
Origin = Anchor.CentreLeft,
184+
Child = userCountryText = new OsuSpriteText
185+
{
186+
Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular),
187+
},
188+
},
189+
}
173190
},
174-
userCountryContainer = new OsuHoverContainer
191+
new FillFlowContainer
175192
{
176193
AutoSizeAxes = Axes.Both,
177-
Anchor = Anchor.CentreLeft,
178-
Origin = Anchor.CentreLeft,
179-
Margin = new MarginPadding { Left = 5 },
180-
Child = userCountryText = new OsuSpriteText
194+
Direction = FillDirection.Horizontal,
195+
Spacing = new Vector2(4, 0),
196+
Children = new Drawable[]
181197
{
182-
Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular),
183-
},
184-
},
198+
teamFlag = new UpdateableTeamFlag
199+
{
200+
Size = new Vector2(40, 20),
201+
},
202+
teamText = new OsuSpriteText
203+
{
204+
Anchor = Anchor.CentreLeft,
205+
Origin = Anchor.CentreLeft,
206+
Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular),
207+
},
208+
}
209+
}
185210
}
186211
},
187212
}
@@ -220,9 +245,10 @@ private void updateUser(UserProfileData? data)
220245
usernameText.Text = user?.Username ?? string.Empty;
221246
openUserExternally.Link = $@"{api.Endpoints.WebsiteUrl}/users/{user?.Id ?? 0}";
222247
userFlag.CountryCode = user?.CountryCode ?? default;
223-
teamFlag.Team = user?.Team;
224248
userCountryText.Text = (user?.CountryCode ?? default).GetDescription();
225249
userCountryContainer.Action = () => rankingsOverlay?.ShowCountry(user?.CountryCode ?? default);
250+
teamFlag.Team = user?.Team;
251+
teamText.Text = user?.Team?.Name ?? string.Empty;
226252
supporterTag.SupportLevel = user?.SupportLevel ?? 0;
227253
titleText.Text = user?.Title ?? string.Empty;
228254
titleText.Colour = Color4Extensions.FromHex(user?.Colour ?? "fff");

0 commit comments

Comments
 (0)