diff --git a/OpenRA.Mods.Common/Widgets/Logic/LoadLocalPlayerProfileLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/LoadLocalPlayerProfileLogic.cs new file mode 100644 index 0000000000..2f938e9fd8 --- /dev/null +++ b/OpenRA.Mods.Common/Widgets/Logic/LoadLocalPlayerProfileLogic.cs @@ -0,0 +1,30 @@ +#region Copyright & License Information +/* + * Copyright (c) The OpenRA Developers and Contributors + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using System; +using OpenRA.Widgets; + +namespace OpenRA.Mods.Common.Widgets.Logic +{ + public class LoadLocalPlayerProfileLogic : ChromeLogic + { + [ObjectCreator.UseCtor] + public LoadLocalPlayerProfileLogic(Widget widget, World world) + { + Func minimalProfile = () => Ui.CurrentWindow() != null; + + Game.LoadWidget(world, "LOCAL_PROFILE_PANEL", widget, new WidgetArgs() + { + { "minimalProfile", minimalProfile } + }); + } + } +} diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 944072f975..fbbf69cd28 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -255,16 +255,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic menuType != MenuType.StartupPrompts && webServices.ModVersionStatus == ModVersionStatus.Outdated; - var playerProfile = widget.GetOrNull("PLAYER_PROFILE_CONTAINER"); - if (playerProfile != null) - { - Func minimalProfile = () => Ui.CurrentWindow() != null; - Game.LoadWidget(world, "LOCAL_PROFILE_PANEL", playerProfile, new WidgetArgs() - { - { "minimalProfile", minimalProfile } - }); - } - menuType = MenuType.StartupPrompts; void OnIntroductionComplete() diff --git a/mods/cnc/chrome/mainmenu.yaml b/mods/cnc/chrome/mainmenu.yaml index b8e42f3747..c9cd062e31 100644 --- a/mods/cnc/chrome/mainmenu.yaml +++ b/mods/cnc/chrome/mainmenu.yaml @@ -274,5 +274,6 @@ Container@MENU_BACKGROUND: Width: 200 Height: 200 Container@PLAYER_PROFILE_CONTAINER: + Logic: LoadLocalPlayerProfileLogic X: 31 Y: 31 diff --git a/mods/common/chrome/mainmenu.yaml b/mods/common/chrome/mainmenu.yaml index 21b9fdb952..a3c2a2b14a 100644 --- a/mods/common/chrome/mainmenu.yaml +++ b/mods/common/chrome/mainmenu.yaml @@ -274,5 +274,6 @@ Container@MAINMENU: Shadow: true Text: label-update-notice-b Container@PLAYER_PROFILE_CONTAINER: + Logic: LoadLocalPlayerProfileLogic X: 25 Y: 25 diff --git a/mods/d2k/chrome/mainmenu.yaml b/mods/d2k/chrome/mainmenu.yaml index 94d5bcab23..1e16d99b38 100644 --- a/mods/d2k/chrome/mainmenu.yaml +++ b/mods/d2k/chrome/mainmenu.yaml @@ -267,5 +267,6 @@ Container@MAINMENU: Width: 200 Height: 200 Container@PLAYER_PROFILE_CONTAINER: + Logic: LoadLocalPlayerProfileLogic X: 5 Y: 5