From cae889fb678bd21f7b20b174a1b5ded58269141f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 9 Jul 2015 21:12:06 +0200 Subject: [PATCH] leave a warning for thirdparty scripters --- OpenRA.Game/WDist.cs | 1 + .../Scripting/Global/CoordinateGlobals.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/OpenRA.Game/WDist.cs b/OpenRA.Game/WDist.cs index 5cf1ed7fe5..2b80ca9b27 100644 --- a/OpenRA.Game/WDist.cs +++ b/OpenRA.Game/WDist.cs @@ -142,6 +142,7 @@ namespace OpenRA switch (key.ToString()) { case "Length": return Length; + case "Range": Game.Debug("WRange.Range is deprecated. Use WDist.Length instead"); return Length; default: throw new LuaException("WDist does not define a member '{0}'".F(key)); } } diff --git a/OpenRA.Mods.Common/Scripting/Global/CoordinateGlobals.cs b/OpenRA.Mods.Common/Scripting/Global/CoordinateGlobals.cs index 95882da41e..cc8271074b 100644 --- a/OpenRA.Mods.Common/Scripting/Global/CoordinateGlobals.cs +++ b/OpenRA.Mods.Common/Scripting/Global/CoordinateGlobals.cs @@ -70,4 +70,16 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Create a new WDist by cell distance")] public WDist FromCells(int numCells) { return WDist.FromCells(numCells); } } + + [ScriptGlobal("WRange")] + public class WRangeGlobal : ScriptGlobal + { + public WRangeGlobal(ScriptContext context) : base(context) { } + + [Desc("Create a new WRange. DEPRECATED! Will be removed.")] + public WDist New(int r) { Game.Debug("WRange is deprecated. Use WDist instead."); return new WDist(r); } + + [Desc("Create a new WRange by cell distance. DEPRECATED! Will be removed.")] + public WDist FromCells(int numCells) { Game.Debug("WRange is deprecated. Use WDist instead."); return WDist.FromCells(numCells); } + } }