diff --git a/Build/Scripting/ZDoom_DECORATE.cfg b/Build/Scripting/ZDoom_DECORATE.cfg index c5642b8..3aa6894 100644 --- a/Build/Scripting/ZDoom_DECORATE.cfg +++ b/Build/Scripting/ZDoom_DECORATE.cfg @@ -1086,6 +1086,11 @@ constants CHF_NIGHTMAREFAST; CHF_NOPLAYACTIVE; CHF_RESURRECT; + CHF_NORANDOMTURN; + CHF_NODIRECTIONTURN; + CHF_NOPOSTATTACKTURN; + CHF_STOPIFBLOCKED; + CHF_DONTTURN; CLOFF_AIM_VERT_NOOFFSET; CLOFF_ALLOWNULL; CLOFF_BEYONDTARGET; diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index 15b4c60..082136a 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -48,6 +48,7 @@ namespace CodeImp.DoomBuilder internal const string TEMP_MAP_HEADER = "TEMPMAP"; internal const string BUILD_MAP_HEADER = "MAP01"; public const string CONFIG_MAP_HEADER = "~MAP"; + private const int REPLACE_TARGET_MAP = -1; //mxd #endregion @@ -400,8 +401,7 @@ namespace CodeImp.DoomBuilder // Copy the map lumps to the temp file General.WriteLogLine("Copying map lumps to temporary file..."); - CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, - true, true, true, true); + CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, REPLACE_TARGET_MAP, true, true, true, true); // Close the map file mapwad.Dispose(); @@ -504,7 +504,7 @@ namespace CodeImp.DoomBuilder // Copy the map lumps to the temp file General.WriteLogLine("Copying map lumps to temporary file..."); - CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, true, true, true, true); + CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, REPLACE_TARGET_MAP, true, true, true, true); // Close the map file mapwad.Dispose(); @@ -866,6 +866,7 @@ namespace CodeImp.DoomBuilder // Determine original map name string origmapname = (!string.IsNullOrEmpty(options.PreviousName) && purpose != SavePurpose.IntoFile) ? options.PreviousName : options.CurrentName; string origwadfile = string.Empty; //mxd + int mapheaderindex = REPLACE_TARGET_MAP; //mxd. Lump index of the map file header in the source WAD try { @@ -943,7 +944,7 @@ namespace CodeImp.DoomBuilder origcfg = new GameConfiguration(ci.Configuration); } - CopyAllLumpsExceptMap(origwad, targetwad, origcfg, origmapname); + mapheaderindex = CopyAllLumpsExceptMap(origwad, targetwad, origcfg, origmapname); // Close original file and delete it origwad.Dispose(); @@ -980,7 +981,7 @@ namespace CodeImp.DoomBuilder } // Copy map lumps to target file - CopyLumpsByType(tempwad, TEMP_MAP_HEADER, targetwad, origmapname, true, true, includenodes, true); + CopyLumpsByType(tempwad, TEMP_MAP_HEADER, targetwad, origmapname, mapheaderindex, true, true, includenodes, true); // mxd. Was the map renamed? if(options.LevelNameChanged) @@ -1190,7 +1191,7 @@ namespace CodeImp.DoomBuilder // Copy lumps to buildwad General.WriteLogLine("Copying map lumps to temporary build file..."); - CopyLumpsByType(tempwad, TEMP_MAP_HEADER, buildwad, BUILD_MAP_HEADER, true, false, false, true); + CopyLumpsByType(tempwad, TEMP_MAP_HEADER, buildwad, BUILD_MAP_HEADER, REPLACE_TARGET_MAP, true, false, false, true); // Close buildwad buildwad.Dispose(); @@ -1235,7 +1236,7 @@ namespace CodeImp.DoomBuilder { // Copy nodebuilder lumps to temp file General.WriteLogLine("Copying nodebuilder lumps to temporary file..."); - CopyLumpsByType(buildwad, BUILD_MAP_HEADER, tempwad, TEMP_MAP_HEADER, false, false, true, false); + CopyLumpsByType(buildwad, BUILD_MAP_HEADER, tempwad, TEMP_MAP_HEADER, REPLACE_TARGET_MAP, false, false, true, false); } else { @@ -1430,13 +1431,16 @@ namespace CodeImp.DoomBuilder foreach(Lump lump in toRemove) target.Remove(lump); } - // This copies all lumps, except those of a specific map - private static void CopyAllLumpsExceptMap(WAD source, WAD target, GameConfiguration mapconfig, string sourcemapname) + // This copies all lumps, except those of a specific map. mxd. Returns the index of skipped map's header lump + private static int CopyAllLumpsExceptMap(WAD source, WAD target, GameConfiguration mapconfig, string sourcemapname) { // Go for all lumps bool skipping = false; - foreach(Lump srclump in source.Lumps) + int headerpos = REPLACE_TARGET_MAP; //mxd + for(int i = 0; i < source.Lumps.Count; i++) { + Lump srclump = source.Lumps[i]; + // Check if we should stop skipping lumps here if(skipping) { @@ -1452,10 +1456,12 @@ namespace CodeImp.DoomBuilder } // Check if we should start skipping lumps here - if(!skipping && (srclump.Name == sourcemapname)) + //TODO: I see a big, but kinda esoteric problem here if the source has several maps with the same name (mxd) + if(!skipping && headerpos == REPLACE_TARGET_MAP && srclump.Name == sourcemapname) { // We have encountered the map header, start skipping! skipping = true; + headerpos = i; } // Not skipping this lump? @@ -1466,16 +1472,20 @@ namespace CodeImp.DoomBuilder srclump.CopyTo(tgtlump); } } + + return headerpos; } // This copies specific map lumps from one WAD to another private void CopyLumpsByType(WAD source, string sourcemapname, WAD target, string targetmapname, + int targetheaderinsertindex, //mxd bool copyrequired, bool copyblindcopy, bool copynodebuild, bool copyscript) { - // Find the map header in target - int tgtheaderindex = target.FindLumpIndex(targetmapname); + // Find the map header in target (mxd. Or use the provided one) + bool replacetargetmap = (targetheaderinsertindex == REPLACE_TARGET_MAP); //mxd + int tgtheaderindex = (replacetargetmap ? target.FindLumpIndex(targetmapname) : targetheaderinsertindex); //mxd if(tgtheaderindex == -1) { // If this header doesnt exists in the target @@ -1505,13 +1515,17 @@ namespace CodeImp.DoomBuilder int sourceindex = FindSpecificLump(source, srclumpname, srcheaderindex, sourcemapname, config.MapLumps); if(sourceindex > -1) { - // Remove lump at target - int lumpindex = RemoveSpecificLump(target, tgtlumpname, tgtheaderindex, targetmapname, config.MapLumps); + //mxd. Don't do this when inserting a map (SaveMap() removes the old version of the map before calling CopyLumpsByType()) + if(replacetargetmap) + { + // Remove lump at target + int lumpindex = RemoveSpecificLump(target, tgtlumpname, tgtheaderindex, targetmapname, config.MapLumps); - // Determine target index - // When original lump was found and removed then insert at that position - // otherwise insert after last insertion position - if(lumpindex > -1) targetindex = lumpindex; else targetindex++; + // Determine target index + // When original lump was found and removed then insert at that position + // otherwise insert after last insertion position + if(lumpindex > -1) targetindex = lumpindex; else targetindex++; + } if(targetindex > target.Lumps.Count) targetindex = target.Lumps.Count; // Copy the lump to the target @@ -1519,6 +1533,9 @@ namespace CodeImp.DoomBuilder Lump lump = source.Lumps[sourceindex]; Lump newlump = target.Insert(tgtlumpname, targetindex, lump.Length); lump.CopyTo(newlump); + + //mxd. We still need to increment targetindex... + if(!replacetargetmap) targetindex++; } else { diff --git a/Source/Core/Properties/AssemblyInfo.cs b/Source/Core/Properties/AssemblyInfo.cs index 0b3ba79..99480e0 100644 --- a/Source/Core/Properties/AssemblyInfo.cs +++ b/Source/Core/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -28,4 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.14.0.2501")] \ No newline at end of file +[assembly: AssemblyVersion("2.14.0.2501")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/BuilderEffects/Properties/AssemblyInfo.cs b/Source/Plugins/BuilderEffects/Properties/AssemblyInfo.cs index 09e15fa..cd2ef42 100644 --- a/Source/Plugins/BuilderEffects/Properties/AssemblyInfo.cs +++ b/Source/Plugins/BuilderEffects/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -33,3 +34,4 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs index 82a93b2..9381063 100644 --- a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs +++ b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -28,4 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.14.0.2501")] \ No newline at end of file +[assembly: AssemblyVersion("2.14.0.2501")] +[assembly: NeutralResourcesLanguageAttribute("en")] \ No newline at end of file diff --git a/Source/Plugins/CommentsPanel/Properties/AssemblyInfo.cs b/Source/Plugins/CommentsPanel/Properties/AssemblyInfo.cs index 4a1d9e2..353100f 100644 --- a/Source/Plugins/CommentsPanel/Properties/AssemblyInfo.cs +++ b/Source/Plugins/CommentsPanel/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -32,3 +33,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/NodesViewer/Properties/AssemblyInfo.cs b/Source/Plugins/NodesViewer/Properties/AssemblyInfo.cs index 0891601..5458256 100644 --- a/Source/Plugins/NodesViewer/Properties/AssemblyInfo.cs +++ b/Source/Plugins/NodesViewer/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -33,3 +34,4 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/SoundPropagationMode/Properties/AssemblyInfo.cs b/Source/Plugins/SoundPropagationMode/Properties/AssemblyInfo.cs index e1affcb..ca4cdf1 100644 --- a/Source/Plugins/SoundPropagationMode/Properties/AssemblyInfo.cs +++ b/Source/Plugins/SoundPropagationMode/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, @@ -33,3 +34,4 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs b/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs index d24b97f..53f2450 100644 --- a/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs +++ b/Source/Plugins/StairSectorBuilder/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // Управление общими сведениями о сборке осуществляется с помощью // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, @@ -33,3 +34,4 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/TagRange/Properties/AssemblyInfo.cs b/Source/Plugins/TagRange/Properties/AssemblyInfo.cs index c70989e..6e4b487 100644 --- a/Source/Plugins/TagRange/Properties/AssemblyInfo.cs +++ b/Source/Plugins/TagRange/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -32,3 +33,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/Source/Plugins/VisplaneExplorer/Properties/AssemblyInfo.cs b/Source/Plugins/VisplaneExplorer/Properties/AssemblyInfo.cs index 8f48b96..c01054c 100644 --- a/Source/Plugins/VisplaneExplorer/Properties/AssemblyInfo.cs +++ b/Source/Plugins/VisplaneExplorer/Properties/AssemblyInfo.cs @@ -1,5 +1,6 @@ using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -33,3 +34,4 @@ using System.Runtime.InteropServices; // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")]