mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Added "defaultlinedefactivation" setting to configuration.
Added some boilerplate to SaveScreenshot function.
This commit is contained in:
parent
a938453703
commit
aea360adb9
5 changed files with 17 additions and 11 deletions
|
@ -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";
|
||||
|
|
|
@ -1970,6 +1970,7 @@ speciallinedefs_udmf
|
|||
impassableflag = "blocking";
|
||||
upperunpeggedflag = "dontpegtop";
|
||||
lowerunpeggedflag = "dontpegbottom";
|
||||
defaultlinedefactivation = "playercross"; //mxd. Used when translating a map to UDMF
|
||||
}
|
||||
|
||||
// Door making
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue