diff --git a/Source/Core/Editing/EditModeAttribute.cs b/Source/Core/Editing/EditModeAttribute.cs
index 618f765b..ee24e301 100755
--- a/Source/Core/Editing/EditModeAttribute.cs
+++ b/Source/Core/Editing/EditModeAttribute.cs
@@ -43,6 +43,8 @@ namespace CodeImp.DoomBuilder.Editing
private bool usebydefault;
private bool safestartmode;
private string[] supportedmapformats; //mxd
+ private bool isdeprecated = false;
+ private string deprecationmessage = string.Empty;
#endregion
@@ -115,6 +117,16 @@ namespace CodeImp.DoomBuilder.Editing
///
public string[] SupportedMapFormats { get { return supportedmapformats; } set { supportedmapformats = value; } }
+ ///
+ /// When set to true the DeprecationMessage will be shown as a warning in the errors and warnings dialog
+ ///
+ public bool IsDeprecated { get { return isdeprecated; } set { isdeprecated = value; } }
+
+ ///
+ /// Message to be shown as a warning in the errors and warnings dialog when IsDeprecated is true
+ ///
+ public string DeprecationMessage { get { return deprecationmessage; } set { deprecationmessage = value; } }
+
#endregion
#region ================== Constructor / Disposer
diff --git a/Source/Core/Editing/EditModeInfo.cs b/Source/Core/Editing/EditModeInfo.cs
index 8e4acdcf..3580f606 100755
--- a/Source/Core/Editing/EditModeInfo.cs
+++ b/Source/Core/Editing/EditModeInfo.cs
@@ -91,7 +91,7 @@ namespace CodeImp.DoomBuilder.Editing
if(stream != null)
{
buttonimage = Image.FromStream(stream);
- buttondesc = attr.DisplayName;
+ buttondesc = attr.DisplayName + (attribs.IsDeprecated ? " (deprecated)" : "");
buttonorder = attr.ButtonOrder;
}
}
diff --git a/Source/Core/Editing/EditingManager.cs b/Source/Core/Editing/EditingManager.cs
index 4b7e3b58..07401644 100755
--- a/Source/Core/Editing/EditingManager.cs
+++ b/Source/Core/Editing/EditingManager.cs
@@ -367,6 +367,9 @@ namespace CodeImp.DoomBuilder.Editing
// Engage new mode
if(newmode != null)
{
+ if (newmode.Attributes.IsDeprecated)
+ General.ErrorLogger.Add(ErrorType.Warning, "The editing mode \"" + newmode.Attributes.DisplayName + "\" is deprecated and will be removed in the future. " + newmode.Attributes.DeprecationMessage);
+
newmode.OnEngage();
General.Plugins.OnEditEngage(oldmode, newmode);
}
diff --git a/Source/Core/Windows/ConfigForm.cs b/Source/Core/Windows/ConfigForm.cs
index 7ea77848..4ba41e69 100755
--- a/Source/Core/Windows/ConfigForm.cs
+++ b/Source/Core/Windows/ConfigForm.cs
@@ -88,7 +88,7 @@ namespace CodeImp.DoomBuilder.Windows
// Is this mode selectable by the user?
if(emi.IsOptional)
{
- lvi = listmodes.Items.Add(emi.Attributes.DisplayName);
+ lvi = listmodes.Items.Add(emi.Attributes.DisplayName + (emi.Attributes.IsDeprecated ? " (deprecated)" : ""));
lvi.Tag = emi;
lvi.SubItems.Add(emi.Plugin.Plug.Name);
lvi.UseItemStyleForSubItems = true; //mxd
@@ -199,14 +199,14 @@ namespace CodeImp.DoomBuilder.Windows
if(emi.Attributes.SupportedMapFormats != null &&
Array.IndexOf(emi.Attributes.SupportedMapFormats, gameconfig.FormatInterface) == -1)
{
- lvi.Text = emi.Attributes.DisplayName + " (map format not supported)";
+ lvi.Text = emi.Attributes.DisplayName + " (map format not supported" + (emi.Attributes.IsDeprecated ? ", deprecated" : "") + ")";
lvi.ForeColor = SystemColors.GrayText;
lvi.BackColor = SystemColors.InactiveBorder;
lvi.Checked = false;
}
else
{
- lvi.Text = emi.Attributes.DisplayName;
+ lvi.Text = emi.Attributes.DisplayName + (emi.Attributes.IsDeprecated ? " (deprecated)" : "");
lvi.ForeColor = SystemColors.WindowText;
lvi.BackColor = SystemColors.Window;
lvi.Checked = (configinfo.EditModes.ContainsKey(emi.Type.FullName) && configinfo.EditModes[emi.Type.FullName]);
diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs
index 234ad497..8185f654 100755
--- a/Source/Core/Windows/MainForm.cs
+++ b/Source/Core/Windows/MainForm.cs
@@ -299,7 +299,7 @@ namespace CodeImp.DoomBuilder.Windows
if(General.Editing.Mode != null)
{
General.MainWindow.CheckEditModeButton(General.Editing.Mode.EditModeButtonName);
- General.MainWindow.DisplayModeName(General.Editing.Mode.Attributes.DisplayName);
+ General.MainWindow.DisplayModeName(General.Editing.Mode.Attributes.DisplayName + (General.Editing.Mode.Attributes.IsDeprecated ? " (deprecated)" : ""));
}
else
{
diff --git a/Source/Plugins/3DFloorMode/DrawSlopesMode.cs b/Source/Plugins/3DFloorMode/DrawSlopesMode.cs
index 1f57e740..93367520 100644
--- a/Source/Plugins/3DFloorMode/DrawSlopesMode.cs
+++ b/Source/Plugins/3DFloorMode/DrawSlopesMode.cs
@@ -50,8 +50,9 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
SupportedMapFormats = new[] { "UniversalMapSetIO" },
Volatile = true,
UseByDefault = true,
- Optional = false)]
-
+ Optional = false,
+ IsDeprecated = true,
+ DeprecationMessage = "Please use the visual sloping functionality instead.")]
public class DrawSlopesMode : ClassicMode
{
#region ================== Constants
diff --git a/Source/Plugins/3DFloorMode/SlopeMode.cs b/Source/Plugins/3DFloorMode/SlopeMode.cs
index b42a6d73..4b38c895 100644
--- a/Source/Plugins/3DFloorMode/SlopeMode.cs
+++ b/Source/Plugins/3DFloorMode/SlopeMode.cs
@@ -63,7 +63,9 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
ButtonGroup = "000_editing",
SupportedMapFormats = new[] { "UniversalMapSetIO" },
UseByDefault = true,
- SafeStartMode = true)]
+ SafeStartMode = true,
+ IsDeprecated = true,
+ DeprecationMessage = "Please use the visual sloping functionality instead.")]
public class SlopeMode : ClassicMode
{