From 4c55e820d6c0ae31a93c200b71804be321649554 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 4 Jul 2018 22:11:57 +0200 Subject: [PATCH] Add beta warning to legacy update path --- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 1 + .../UpdateRules/Rules/LegacyBetaWarning.cs | 45 +++++++++++++++++++ OpenRA.Mods.Common/UpdateRules/UpdatePath.cs | 1 + 3 files changed, 47 insertions(+) create mode 100644 OpenRA.Mods.Common/UpdateRules/Rules/LegacyBetaWarning.cs diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index ceaa777a7a..1c212cabee 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -606,6 +606,7 @@ + diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/LegacyBetaWarning.cs b/OpenRA.Mods.Common/UpdateRules/Rules/LegacyBetaWarning.cs new file mode 100644 index 0000000000..91260a9a3c --- /dev/null +++ b/OpenRA.Mods.Common/UpdateRules/Rules/LegacyBetaWarning.cs @@ -0,0 +1,45 @@ +#region Copyright & License Information +/* + * Copyright 2007-2018 The OpenRA Developers (see AUTHORS) + * 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 System.Collections.Generic; +using System.Linq; + +namespace OpenRA.Mods.Common.UpdateRules.Rules +{ + public class LegacyBetaWarning : UpdateRule + { + public override string Name { get { return "Update path from 20171014 to 20180307 is in beta state"; } } + public override string Description + { + get + { + return "Due to time constraints and the legacy status of the included rules,\n" + + "the update path to 20180307 is considered a beta path.\n" + + "If you encounter any issues, please report them on GitHub or our IRC channel."; + } + } + + bool displayed; + + public override IEnumerable AfterUpdate(ModData modData) + { + var message = "Due to time constraints and the legacy status of the included rules,\n" + + "the update path to 20180307 is considered a beta path.\n" + + "If you encounter any issues, please report them on GitHub or our IRC channel."; + + if (!displayed) + yield return message; + + displayed = true; + } + } +} diff --git a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs index 938d1ef40b..4a8c6c110e 100644 --- a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs +++ b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs @@ -36,6 +36,7 @@ namespace OpenRA.Mods.Common.UpdateRules { new UpdatePath("release-20171014", "release-20180218", new UpdateRule[] { + new LegacyBetaWarning(), new RemoveMobileOnRails(), new AircraftCanHoverGeneralization(), new AddNukeLaunchAnimation(),