diff --git a/Build/Configurations/Includes/UDMF_misc.cfg b/Build/Configurations/Includes/UDMF_misc.cfg index b5409fd0d87c4e5e4f307bf3c76dfdfcafde3383..2e0f1cac60126da35c8ba31dada049731bee75b2 100644 --- a/Build/Configurations/Includes/UDMF_misc.cfg +++ b/Build/Configurations/Includes/UDMF_misc.cfg @@ -77,7 +77,7 @@ linedefflags linedefactivations { - playercross = "When player walks over"; //mxd. The first flag is now used as default flag when translating a map to UDMF format + playercross = "When player walks over"; playeruse = "When player presses use"; monstercross = "When monster walks over"; monsteruse = "When monster presses use"; diff --git a/Build/Configurations/Includes/ZDoom_misc.cfg b/Build/Configurations/Includes/ZDoom_misc.cfg index 599e56f59079e3f50a51ba4c83ad0fae44c13ae0..a7a0be2c0304be5ea86c4cf7f1976495246f6d7b 100644 --- a/Build/Configurations/Includes/ZDoom_misc.cfg +++ b/Build/Configurations/Includes/ZDoom_misc.cfg @@ -1970,6 +1970,7 @@ speciallinedefs_udmf impassableflag = "blocking"; upperunpeggedflag = "dontpegtop"; lowerunpeggedflag = "dontpegbottom"; + defaultlinedefactivation = "playercross"; //mxd. Used when translating a map to UDMF } // Door making diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs index 876d871c31fd9727f6068e9162cddaa26dcd4272..aa0f12eee4d43e4eaa70794cc9c708ded25807b4 100644 --- a/Source/Core/Config/GameConfiguration.cs +++ b/Source/Core/Config/GameConfiguration.cs @@ -50,7 +50,7 @@ namespace CodeImp.DoomBuilder.Config private string defaultsavecompiler; private string defaulttestcompiler; private string formatinterface; - //private string soundlinedefflag; + private string defaultLinedefActivation; //mxd private string singlesidedflag; private string doublesidedflag; private string impassableflag; @@ -146,7 +146,7 @@ namespace CodeImp.DoomBuilder.Config public float DefaultFlatScale { get { return defaultflatscale; } } public bool ScaledTextureOffsets { get { return scaledtextureoffsets; } } public string FormatInterface { get { return formatinterface; } } - //public string SoundLinedefFlag { get { return soundlinedefflag; } } //mxd + public string DefaultLinedefActivationFlag { get { return defaultLinedefActivation; } } //mxd public string SingleSidedFlag { get { return singlesidedflag; } } public string DoubleSidedFlag { get { return doublesidedflag; } } public string ImpassableFlag { get { return impassableflag; } } @@ -297,12 +297,11 @@ namespace CodeImp.DoomBuilder.Config topboundary = cfg.ReadSetting("topboundary", 32767); bottomboundary = cfg.ReadSetting("bottomboundary", -32768); doomlightlevels = cfg.ReadSetting("doomlightlevels", true); + defaultLinedefActivation = cfg.ReadSetting("defaultlinedefactivation", ""); //mxd for(int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0); // Flags have special (invariant culture) conversion // because they are allowed to be written as integers in the configs - //obj = cfg.ReadSettingObject("soundlinedefflag", 0); - //if(obj is int) soundlinedefflag = ((int)obj).ToString(CultureInfo.InvariantCulture); else soundlinedefflag = obj.ToString(); obj = cfg.ReadSettingObject("singlesidedflag", 0); if(obj is int) singlesidedflag = ((int)obj).ToString(CultureInfo.InvariantCulture); else singlesidedflag = obj.ToString(); obj = cfg.ReadSettingObject("doublesidedflag", 0); diff --git a/Source/Core/Map/Linedef.cs b/Source/Core/Map/Linedef.cs index dc7c1a1715d51b60a612630a07c3e404a70af858..d28d4fa4c9cb18529cc2cdb4011154760fe4f63e 100644 --- a/Source/Core/Map/Linedef.cs +++ b/Source/Core/Map/Linedef.cs @@ -407,8 +407,9 @@ namespace CodeImp.DoomBuilder.Map // Now make the new flags flags.Clear(); - //mxd. That's hackish... - if(action != 0 && activate == 0) flags[General.Map.Config.LinedefActivates[0].Key] = true; + //mxd. Add default activation flag if needed + if(action != 0 && activate == 0 && !string.IsNullOrEmpty(General.Map.Config.DefaultLinedefActivationFlag)) + flags[General.Map.Config.DefaultLinedefActivationFlag] = true; foreach(FlagTranslation f in General.Map.Config.LinedefFlagsTranslation) { diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 101cecd2becd9414e6269dc4d40af518c3edcf8f..b2d98a17cf168a7731d9c86cf4e834852030f992 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -2602,13 +2602,18 @@ namespace CodeImp.DoomBuilder.Windows //save image using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { - using(Graphics g = Graphics.FromImage(bitmap)) + using(Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size); - bitmap.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg); + try { + bitmap.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg); + DisplayStatus(StatusType.Info, "Screenshot saved to '" + path + "'"); + } catch(ExternalException e) { + DisplayStatus(StatusType.Warning, "Failed to save screenshot..."); + General.ErrorLogger.Add(ErrorType.Error, "Failed to save screenshot:" + Environment.NewLine + e.Message); + } + } } - - DisplayStatus(StatusType.Info, "Screenshot saved to '" + path + "'"); } #endregion