From 092377fdaa234738a79eeb409cea0e5722c154a4 Mon Sep 17 00:00:00 2001 From: _ltn <46729135+rltn@users.noreply.github.com> Date: Fri, 28 Apr 2023 01:47:14 +0300 Subject: [PATCH] moving UpdateableCountryText --- .../Profile/Header/TopHeaderContainer.cs | 41 +++++++++++++++++ .../Users/Drawables/UpdateableCountryText.cs | 46 ------------------- 2 files changed, 41 insertions(+), 46 deletions(-) delete mode 100644 osu.Game/Users/Drawables/UpdateableCountryText.cs diff --git a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs index 811628c3c1..54c84e08b8 100644 --- a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs @@ -19,6 +19,20 @@ using osu.Game.Users; using osu.Game.Users.Drawables; using osuTK; + +using System; +// using osu.Framework.Allocation; +using osu.Framework.Input.Events; +// using osu.Framework.Graphics; +// using osu.Framework.Graphics.Containers; +// using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +// using osu.Game.Graphics.Sprites; +// using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays; +using osu.Framework.Graphics.Sprites; +// using osu.Framework.Extensions; + namespace osu.Game.Overlays.Profile.Header { public partial class TopHeaderContainer : CompositeDrawable @@ -158,6 +172,7 @@ namespace osu.Game.Overlays.Profile.Header }, userCountryText = new UpdateableCountryText { + Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular), Margin = new MarginPadding { Left = 5 }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, @@ -228,5 +243,31 @@ namespace osu.Game.Overlays.Profile.Header Masking = true; } } + + private partial class UpdateableCountryText : OsuHoverContainer + { + public bool ShowPlaceholderOnUnknown = true; + public FontUsage Font = default; + [Resolved] + private RankingsOverlay? rankingsOverlay { get; set; } + public UpdateableCountryText() + { + AutoSizeAxes = Axes.Both; + } + + public void load(CountryCode countryCode) + { + Action = () => + { + rankingsOverlay?.ShowCountry(countryCode); + }; + + Child = new OsuSpriteText + { + Font = Font, + Text = countryCode.GetDescription(), + }; + } + } } } diff --git a/osu.Game/Users/Drawables/UpdateableCountryText.cs b/osu.Game/Users/Drawables/UpdateableCountryText.cs deleted file mode 100644 index fd749da707..0000000000 --- a/osu.Game/Users/Drawables/UpdateableCountryText.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using System; -using osu.Framework.Allocation; -using osu.Framework.Input.Events; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Game.Graphics; -using osu.Game.Graphics.Containers; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Game.Overlays; -using osu.Framework.Extensions; - -namespace osu.Game.Users.Drawables -{ - public partial class UpdateableCountryText : OsuHoverContainer - { - - public bool ShowPlaceholderOnUnknown = true; - - [Resolved] - private RankingsOverlay? rankingsOverlay { get; set; } - public UpdateableCountryText() - { - AutoSizeAxes = Axes.Both; - } - - // [BackgroundDependencyLoader] - public void load(CountryCode countryCode) - { - Action = () => - { - rankingsOverlay?.ShowCountry(countryCode); - }; - - Child = new OsuSpriteText - { - Font = OsuFont.GetFont(size: 14f, weight: FontWeight.Regular), - Text = countryCode.GetDescription(), - }; - } - } - -} \ No newline at end of file