mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Added "safeboundary" game configuration property. The value determines the maximum map bounding box size considered to be safe by "Check map size" error check.
Changed, Map Analysis mode: some checks are now available only under certain conditions (for example, "Check polyobjects" is now available only when the map is in Hexen or UDMF map format). Updated documentation ("Game Configuration - Basic Settings" page).
This commit is contained in:
parent
dc54992693
commit
154ceb0eb7
12 changed files with 150 additions and 68 deletions
|
@ -27,6 +27,9 @@ common
|
|||
// generalizedlinedefs is true for Doom format and false for
|
||||
// the other two, so it's not here.
|
||||
generalizedsectors = true;
|
||||
|
||||
//mxd. Maximum safe map size check (0 means skip check)
|
||||
safeboundary = 0;
|
||||
|
||||
// Texture loading options
|
||||
mixtexturesflats = true;
|
||||
|
|
|
@ -41,6 +41,9 @@ linetagindicatesectors = true;
|
|||
|
||||
// The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder
|
||||
formatinterface = "SRB2MapSetIO";
|
||||
|
||||
//Maximum safe map size check (0 means skip check)
|
||||
safeboundary = 0;
|
||||
|
||||
//Sky textures for vanilla maps
|
||||
defaultskytextures
|
||||
|
|
|
@ -78,66 +78,94 @@ skills
|
|||
5 = "Nightmare!";
|
||||
}
|
||||
</pre>
|
||||
<br />
|
||||
<b class="fat">linetagindicatesectors</b> (boolean)<br />
|
||||
When <b>true</b>, Doom Builder will highlight sectors associated with the same tag number when a line is highlighted. This is only really useful for Doom format maps, because Hexen format and UDMF format has no single tag on linedefs (in those formats, the arguments of the linedef's action can be tags, which also works to highlight sectors).<br />
|
||||
Default value is <b>false</b>.<br />
|
||||
<br />
|
||||
<b class="fat">singlesidedflag</b> (integer or string)<br />
|
||||
This lets Doom Builder know the <a href="gc_linedefflags.html">linedef flag</a> that indicates a line with only one side. Doom Builder will set this flag value on a linedef when it changes a line to become single sided and removes the flag from a linedef when it becomes double sided. Plugins can also use this information to perform operations on linedefs. For map formats that use numeric flags (Doom and Hexen) this must be an integer flag value. For map formats that use named flags (UDMF), this must be a string indicating the name of the flag.<br />
|
||||
<br />
|
||||
<b class="fat">doublesidedflag</b> (integer or string)<br />
|
||||
This lets Doom Builder know the <a href="gc_linedefflags.html">linedef flag</a> that indicates a line with two sides. Doom Builder will set this flag value on a linedef when it changes a line to become double sided and removes the flag from a linedef when it becomes single sided. Plugins can also use this information to perform operations on linedefs. For map formats that use numeric flags (Doom and Hexen) this must be an integer flag value. For map formats that use named flags (UDMF), this must be a string indicating the name of the flag.<br />
|
||||
<br />
|
||||
<b class="fat">impassableflag</b> (integer or string)<br />
|
||||
This lets Doom Builder know the <a href="gc_linedefflags.html">linedef flag</a> that indicates a line which blocks players and monsters. Doom Builder uses this to give the line a special color and plugins can use this information to perform operations related to blocking sound lines. For map formats that use numeric flags (Doom and Hexen) this must be an integer specifying the flag value of the Impassable flag. For map formats that use named flags (UDMF), this must be a string indicating the name of the Impassable flag.<br />
|
||||
<br />
|
||||
<b class="fat">defaultwalltexture</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a texture to use on sidedefs when creating a new sector.<br />
|
||||
<b>"STARTAN"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultfloortexture</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a flat to use on the floor when creating a new sector.<br />
|
||||
Default value is <b>"FLOOR0_1"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultceilingtexture</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a flat to use on the ceiling when creating a new sector.<br />
|
||||
Default value is <b>"CEIL1_1"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">makedoortrack</b> (string)<br />
|
||||
Name of a texture to use on the walls when making a door.<br />
|
||||
Default value is <b>"-"</b> (no texture).<br />
|
||||
<br />
|
||||
<b class="fat">makedoordoor</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a texture to use as the door texture when making a door.<br />
|
||||
Default value is <b>"-"</b> (no texture).<br />
|
||||
<br />
|
||||
<b class="fat">makedoorceil</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a texture to use as the door's ceiling texture when making a door.<br />
|
||||
Default value is <b>"-"</b> (no texture).<br />
|
||||
<br />
|
||||
<b class="fat">makedooraction</b> (integer)<br />
|
||||
Linedef action number to put on the lines when making a door.<br />
|
||||
<br />
|
||||
<b class="fat">makedoorarg#</b> (0 .. 4) (integer)<br />
|
||||
Arguments for the linedef action number to put on the lines when making a door.<br />
|
||||
<br />
|
||||
<b class="fat">doomlightlevels</b> (boolean)<br />
|
||||
Set this to <b>false</b> to use linear lighting in Doom Builder. Normally Doom Builder uses a simulation of Doom's light levels.
|
||||
<br />Default value is <b>true</b>.<br />
|
||||
<br />
|
||||
<b class="fat">start3dmode</b> (integer)<br />
|
||||
Thing type number that Doom Builder will use to keep your Visual Mode camera position stored in the map. Doom Builder will place a single thing of this type in your map and move it along as you move in Visual Mode.<br />
|
||||
<br />
|
||||
<b class="fat">skyflatname</b> (string)<br />
|
||||
Name of the flat that is interpreted as sky (meaning there is no ceiling). Doom Builder and plugins can use this information for various purposes.
|
||||
<br />Default value is <b>"F_SKY1"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultskytextures</b> (structure) - <span class="red">GZDB only</span>.<br />
|
||||
Defines the relationship between map names and sky texture names used by vanilla maps.<br />
|
||||
<br />
|
||||
<strong>Example:</strong>
|
||||
<pre>
|
||||
<br />
|
||||
<b class="fat">damagetypes</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Space-separated list of built-in damage types. This list is combined with DamageTypes parsed from DECORATE.<br />
|
||||
<br />
|
||||
<strong>Example:</strong>
|
||||
<pre>
|
||||
damagetypes = "None BFGSplash Drowning Slime";
|
||||
</pre>
|
||||
<br />
|
||||
<b class="fat">linetagindicatesectors</b> (boolean)<br />
|
||||
When <b>true</b>, Doom Builder will highlight sectors associated with the same tag number when a line is highlighted. This is only really useful for Doom format maps, because Hexen format and UDMF format has no single tag on linedefs (in those formats, the arguments of the linedef's action can be tags, which also works to highlight sectors).<br />
|
||||
Default value is <b>false</b>.<br />
|
||||
<br />
|
||||
<b class="fat">singlesidedflag</b> (integer or string)<br />
|
||||
This lets Doom Builder know the <a href="gc_linedefflags.html">linedef flag</a> that indicates a line with only one side. Doom Builder will set this flag value on a linedef when it changes a line to become single sided and removes the flag from a linedef when it becomes double sided. Plugins can also use this information to perform operations on linedefs. For map formats that use numeric flags (Doom and Hexen) this must be an integer flag value. For map formats that use named flags (UDMF), this must be a string indicating the name of the flag.<br />
|
||||
<br />
|
||||
<b class="fat">doublesidedflag</b> (integer or string)<br />
|
||||
This lets Doom Builder know the <a href="gc_linedefflags.html">linedef flag</a> that indicates a line with two sides. Doom Builder will set this flag value on a linedef when it changes a line to become double sided and removes the flag from a linedef when it becomes single sided. Plugins can also use this information to perform operations on linedefs. For map formats that use numeric flags (Doom and Hexen) this must be an integer flag value. For map formats that use named flags (UDMF), this must be a string indicating the name of the flag.<br />
|
||||
<br />
|
||||
<b class="fat">impassableflag</b> (integer or string)<br />
|
||||
This lets Doom Builder know the <a href="gc_linedefflags.html">linedef flag</a> that indicates a line which blocks players and monsters. Doom Builder uses this to give the line a special color and plugins can use this information to perform operations related to blocking sound lines. For map formats that use numeric flags (Doom and Hexen) this must be an integer specifying the flag value of the Impassable flag. For map formats that use named flags (UDMF), this must be a string indicating the name of the Impassable flag.<br />
|
||||
<br />
|
||||
<b class="fat">leftboundary</b> (integer)<br />
|
||||
Left map boundary.<br />
|
||||
Default value is <b>-32768</b>.<br />
|
||||
<br />
|
||||
<b class="fat">rightboundary</b> (integer)<br />
|
||||
Right map boundary.<br />
|
||||
Default value is <b>32767</b>.<br />
|
||||
<br />
|
||||
<b class="fat">topboundary</b> (integer)<br />
|
||||
Top map boundary.<br />
|
||||
Default value is <b>32767</b>.<br />
|
||||
<br />
|
||||
<b class="fat">bottomboundary</b> (integer)<br />
|
||||
Bottom map boundary.<br />
|
||||
Default value is <b>-32768</b>.<br />
|
||||
<br />
|
||||
<b class="fat">safeboundary</b> (integer) - <span class="red">GZDB only</span>.<br />
|
||||
Maximum map bounding box size considered to be safe by "Check map size" <a href="e_mapanalysis.html">error check</a>. Setting this to <b>0</b> disables the check.<br />
|
||||
Default value is <b>32767</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultwalltexture</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a texture to use on sidedefs when creating a new sector.<br />
|
||||
Default value is <b>"STARTAN"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultfloortexture</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a flat to use on the floor when creating a new sector.<br />
|
||||
Default value is <b>"FLOOR0_1"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultceilingtexture</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a flat to use on the ceiling when creating a new sector.<br />
|
||||
Default value is <b>"CEIL1_1"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">makedoortrack</b> (string)<br />
|
||||
Name of a texture to use on the walls when making a door.<br />
|
||||
Default value is <b>"-"</b> (no texture).<br />
|
||||
<br />
|
||||
<b class="fat">makedoordoor</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a texture to use as the door texture when making a door.<br />
|
||||
Default value is <b>"-"</b> (no texture).<br />
|
||||
<br />
|
||||
<b class="fat">makedoorceil</b> (string) - <span class="red">GZDB only</span>.<br />
|
||||
Name of a texture to use as the door's ceiling texture when making a door.<br />
|
||||
Default value is <b>"-"</b> (no texture).<br />
|
||||
<br />
|
||||
<b class="fat">makedooraction</b> (integer)<br />
|
||||
Linedef action number to put on the lines when making a door.<br />
|
||||
<br />
|
||||
<b class="fat">makedoorarg#</b> (0 .. 4) (integer)<br />
|
||||
Arguments for the linedef action number to put on the lines when making a door.<br />
|
||||
<br />
|
||||
<b class="fat">doomlightlevels</b> (boolean)<br />
|
||||
Set this to <b>false</b> to use linear lighting in Doom Builder. Normally Doom Builder uses a simulation of Doom's light levels. <br />
|
||||
Default value is <b>true</b>.<br />
|
||||
<br />
|
||||
<b class="fat">start3dmode</b> (integer)<br />
|
||||
Thing type number that Doom Builder will use to keep your Visual Mode camera position stored in the map. Doom Builder will place a single thing of this type in your map and move it along as you move in Visual Mode.<br />
|
||||
<br />
|
||||
<b class="fat">skyflatname</b> (string)<br />
|
||||
Name of the flat that is interpreted as sky (meaning there is no ceiling). Doom Builder and plugins can use this information for various purposes. <br />
|
||||
Default value is <b>"F_SKY1"</b>.<br />
|
||||
<br />
|
||||
<b class="fat">defaultskytextures</b> (structure) - <span class="red">GZDB only</span>.<br />
|
||||
Defines the relationship between map names and sky texture names used by vanilla maps.<br />
|
||||
<br />
|
||||
<strong>Example:</strong>
|
||||
<pre>
|
||||
defaultskytextures
|
||||
{
|
||||
SKY1 = "MAP01,MAP02,MAP03,MAP04,MAP05";
|
||||
|
|
|
@ -85,6 +85,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
private readonly int rightboundary;
|
||||
private readonly int topboundary;
|
||||
private readonly int bottomboundary;
|
||||
private readonly int safeboundary; //mxd
|
||||
private readonly bool doomlightlevels;
|
||||
private readonly string actionspecialhelp; //mxd
|
||||
private readonly string thingclasshelp; //mxd
|
||||
|
@ -212,6 +213,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
public int RightBoundary { get { return rightboundary; } }
|
||||
public int TopBoundary { get { return topboundary; } }
|
||||
public int BottomBoundary { get { return bottomboundary; } }
|
||||
public int SafeBoundary { get { return safeboundary; } } //mxd
|
||||
public bool DoomLightLevels { get { return doomlightlevels; } }
|
||||
public string ActionSpecialHelp { get { return actionspecialhelp; } } //mxd
|
||||
public string ThingClassHelp { get { return thingclasshelp; } } //mxd
|
||||
|
@ -370,6 +372,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
rightboundary = cfg.ReadSetting("rightboundary", 32767);
|
||||
topboundary = cfg.ReadSetting("topboundary", 32767);
|
||||
bottomboundary = cfg.ReadSetting("bottomboundary", -32768);
|
||||
safeboundary = cfg.ReadSetting("safeboundary", 32767); //mxd
|
||||
doomlightlevels = cfg.ReadSetting("doomlightlevels", true);
|
||||
actionspecialhelp = cfg.ReadSetting("actionspecialhelp", string.Empty); //mxd
|
||||
thingclasshelp = cfg.ReadSetting("thingclasshelp", string.Empty); //mxd
|
||||
|
|
|
@ -8,7 +8,8 @@ namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks
|
|||
public class CheckMapSize : ErrorChecker
|
||||
{
|
||||
private const int PROGRESS_STEP = 1000;
|
||||
internal const int MAXIMUM_DISTANCE = 32767;
|
||||
|
||||
public override bool SkipCheck { get { return General.Map.Config.SafeBoundary <= 0; } }
|
||||
|
||||
// Constructor
|
||||
public CheckMapSize()
|
||||
|
@ -48,7 +49,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks
|
|||
}
|
||||
|
||||
// Map elements should not be more than 32767 mu apart
|
||||
if(maxx - minx > MAXIMUM_DISTANCE || maxy - miny > MAXIMUM_DISTANCE)
|
||||
if(maxx - minx > General.Map.Config.SafeBoundary || maxy - miny > General.Map.Config.SafeBoundary)
|
||||
{
|
||||
SubmitResult(new ResultMapTooBig(new Vector2D(minx, miny), new Vector2D(maxx, maxy)));
|
||||
}
|
||||
|
|
|
@ -17,6 +17,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
// Only possible when the game configuration supports the use of decorate
|
||||
public override bool SkipCheck { get { return string.IsNullOrEmpty(General.Map.Config.DecorateGames); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Destructor
|
||||
|
||||
public CheckObsoleteThings()
|
||||
|
|
|
@ -19,6 +19,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
#endregion
|
||||
|
||||
#region ================== Properties
|
||||
|
||||
// Only possible in Hexen/UDMF map formats
|
||||
public override bool SkipCheck { get { return (!General.Map.UDMF && !General.Map.HEXEN); } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Destructor
|
||||
|
||||
public CheckPolyobjects()
|
||||
|
|
|
@ -7,6 +7,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public class CheckShortLinedefs : ErrorChecker
|
||||
{
|
||||
private const int PROGRESS_STEP = 1000;
|
||||
|
||||
// Only possible in UDMF map format
|
||||
public override bool SkipCheck { get { return !General.Map.UDMF; } }
|
||||
|
||||
// Constructor
|
||||
public CheckShortLinedefs()
|
||||
|
|
|
@ -37,7 +37,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
#region ================== Properties
|
||||
|
||||
public int TotalProgress { get { return totalprogress; } }
|
||||
|
||||
public virtual bool SkipCheck { get { return false; } } //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Constructor / Destructor
|
||||
|
|
|
@ -31,8 +31,8 @@ namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks
|
|||
// Initialize
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.toowide = max.x - min.x > CheckMapSize.MAXIMUM_DISTANCE;
|
||||
this.toohigh = max.y - min.y > CheckMapSize.MAXIMUM_DISTANCE;
|
||||
this.toowide = max.x - min.x > General.Map.Config.SafeBoundary;
|
||||
this.toohigh = max.y - min.y > General.Map.Config.SafeBoundary;
|
||||
description = "Map is too big.";
|
||||
}
|
||||
|
||||
|
@ -55,9 +55,9 @@ namespace CodeImp.DoomBuilder.BuilderModes.ErrorChecks
|
|||
// This must return the string that is displayed in the listbox
|
||||
public override string ToString()
|
||||
{
|
||||
if(toowide && toohigh) return "Map's width and height is bigger than " + CheckMapSize.MAXIMUM_DISTANCE + " m.u. This can cause rendering and physics issues.";
|
||||
if(toowide) return "Map is wider than than " + CheckMapSize.MAXIMUM_DISTANCE + " m.u. This can cause rendering and physics issues.";
|
||||
return "Map is taller than " + CheckMapSize.MAXIMUM_DISTANCE + " m.u. This can cause rendering and physics issues.";
|
||||
if(toowide && toohigh) return "Map's width and height is bigger than " + General.Map.Config.SafeBoundary + " m.u. This can cause rendering and physics issues.";
|
||||
if(toowide) return "Map is wider than " + General.Map.Config.SafeBoundary + " m.u. This can cause rendering and physics issues.";
|
||||
return "Map is taller than " + General.Map.Config.SafeBoundary + " m.u. This can cause rendering and physics issues.";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -611,6 +611,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
base.OnMapCloseEnd();
|
||||
undoredopanel.UpdateList();
|
||||
errorcheckform = null; //mxd. Error checks may need to be reinitialized
|
||||
|
||||
//mxd. Save settings
|
||||
SaveUISettings();
|
||||
|
|
|
@ -92,6 +92,31 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
object[] attr = t.GetCustomAttributes(typeof(ErrorCheckerAttribute), true);
|
||||
if(attr.Length > 0)
|
||||
{
|
||||
//mxd. Skip this check?..
|
||||
ErrorChecker checker;
|
||||
|
||||
try
|
||||
{
|
||||
// Create instance
|
||||
checker = (ErrorChecker)Assembly.GetExecutingAssembly().CreateInstance(t.FullName, false, BindingFlags.Default, null, null, CultureInfo.CurrentCulture, new object[0]);
|
||||
}
|
||||
catch(TargetInvocationException ex)
|
||||
{
|
||||
// Error!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance \"" + t.Name + "\"");
|
||||
General.WriteLogLine(ex.InnerException.GetType().Name + ": " + ex.InnerException.Message);
|
||||
throw;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// Error!
|
||||
General.ErrorLogger.Add(ErrorType.Error, "Failed to create class instance \"" + t.Name + "\"");
|
||||
General.WriteLogLine(ex.GetType().Name + ": " + ex.Message);
|
||||
throw;
|
||||
}
|
||||
|
||||
if(checker.SkipCheck) continue;
|
||||
|
||||
ErrorCheckerAttribute checkerattr = (attr[0] as ErrorCheckerAttribute);
|
||||
|
||||
// Add the type to the checkbox list
|
||||
|
|
Loading…
Reference in a new issue