Added, Game configurations: added "targetclasses" argument property. Can be used with argument type 14 (Thing Tag). When set, only things of given classes will be shown in the argument dropdown list in Edit Things window.

Changed, Classic modes: when "Fixed Things Scale" option is enabled, things will now switch to fixed size rendering mode when their visible size is less than 48 pixels.
Changed, Classic modes: changed the fixed size of things with FixedSize setting to 28 pixels.
Updated documentation ("targetclasses" argument property).
This commit is contained in:
MaxED 2016-04-04 12:09:38 +00:00 committed by spherallic
parent 1d78786bcf
commit c51ad81208
9 changed files with 8869 additions and 48 deletions

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
gzdoom_lights
{
dynlights
@ -471,4 +472,483 @@ gzdoom
blocking = 2;
5004 = "Map Spot (FraggleScript)";
}
=======
gzdoom_lights
{
dynlights
{
color = 7;
arrow = 0;
title = "Dynamic Lights";
sort = 1;
width = 0;
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
sprite = "internal:light";
9800
{
title = "Light";
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Intensity";
default = 64;
}
}
9801
{
title = "Pulse Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Start intensity";
default = 64;
}
arg4
{
title = "End intensity";
default = 32;
}
}
9802
{
title = "Flicker Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Primary intensity";
default = 64;
}
arg4
{
title = "Secondary intensity";
default = 32;
}
}
9803
{
title = "Sector Light";
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Intensity scale";
default = 4;
}
}
9804
{
title = "Random Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Minimal intensity";
default = 32;
}
arg4
{
title = "Maximal intensity";
default = 64;
}
}
9810
{
title = "Additive Light";
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Intensity";
default = 64;
}
}
9811
{
title = "Additive Pulse Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Start intensity";
default = 32;
}
arg4
{
title = "End intensity";
default = 64;
}
}
9812
{
title = "Additive Flicker Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Primary intensity";
default = 64;
}
arg4
{
title = "Secondary intensity";
default = 32;
}
}
9813
{
title = "Additive Sector Light";
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Intensity scale";
default = 4;
}
}
9814
{
title = "Additive Random Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Minimal intensity";
default = 32;
}
arg4
{
title = "Maximal intensity";
default = 64;
}
}
9820
{
title = "Subtractive Light";
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Radius";
default = 64;
}
}
9821
{
title = "Subtractive Pulse Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Start intensity";
default = 32;
}
arg4
{
title = "End intensity";
default = 64;
}
}
9822
{
title = "Subtractive Flicker Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Primary intensity";
default = 32;
}
arg4
{
title = "Secondary intensity";
default = 64;
}
}
9823
{
title = "Subtractive Sector Light";
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Intensity scale";
default = 4;
}
}
9824
{
title = "Subtractive Random Light";
fixedrotation = true;
arg0
{
title = "Red";
default = 255;
}
arg1
{
title = "Green";
default = 255;
}
arg2
{
title = "Blue";
default = 255;
}
arg3
{
title = "Minimal intensity";
default = 32;
}
arg4
{
title = "Maximal intensity";
default = 64;
}
}
9825 = "Vavoom Light (obsolete)";
1502
{
title = "Vavoom Light";
arg0
{
title = "Radius";
default = 16;
}
}
1503
{
title = "Vavoom Light Color";
arg0
{
title = "Radius";
default = 16;
}
arg1
{
title = "Red";
default = 255;
}
arg2
{
title = "Green";
default = 255;
}
arg3
{
title = "Blue";
default = 255;
}
}
}
}
gzdoom
{
zdoom
{
5004
{
title = "Map Spot (FraggleScript)";
sprite = "internal:MapSpot";
class = "FS_MapSpot";
}
}
>>>>>>> dddb1bbf (Added, Game configurations: added "targetclasses" argument property. Can be used with argument type 14 (Thing Tag). When set, only things of given classes will be shown in the argument dropdown list in Edit Things window.)
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
@ -94,3 +95,112 @@ arg0
</p>
</div>
</body>
=======
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Game Configuration - Linedefs Settings</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="default.css" media="screen" title="Default" />
</head>
<body>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="keyword" value="Configurations">
<param name="keyword" value="Game Configurations">
<param name="keyword" value="Action">
<param name="keyword" value="Argument">
</object>
<div id="title">
<h1>Game Configuration - Action Argument Settings</h1>
</div>
<div id="contents">
<p> <b class="fat">title</b> (string)<br />
Sets the title of this argument.<br />
Argument title can be also set in <a href="gc_decoratekeys.html#argtitle">DECORATE</a>.<br />
<br />
<b class="fat"><a name="argtooltip" id="argtooltip"></a>tooltip</b> (string) - <span class="red">GZDB only</span><br />
Allows to specify a tooltip text displayed for a <a href="gc_thingsettings.html#argtooltip">Thing</a> or Linedef argument definition. Newline character ("\n") can be used to format the text.<br />
Argument tooltips can be also set in <a href="gc_decoratekeys.html#argtooltip">DECORATE</a>.<br />
<strong>Example:</strong> </p>
<pre>arg1
{
title = "Mirror Polyobj Number";
<span class="blue">tooltip = "Polyobject that will mirror\nthis one's movements.";</span>
}</pre>
<br />
<b class="fat"><a name="argtype" id="argtype"></a>type</b> (integer)<br />
Sets the type of this argument. This changes the behaviour of Argument inputs in <a href="w_linedefedit.html">Linedef</a> and <a href="w_thingedit.html">Thing Edit</a> windows.<br />
Argument type can be also set in <a href="gc_decoratekeys.html#argtype">DECORATE</a>.<br />
<strong>Supported values are:</strong><br />
<br />
<ul style="list-style-type:none">
<li>0 = Integer (default)</li>
<li>4 = Action special</li>
<li>5 = Sector effect</li>
<li>8 = Angle in degrees</li>
<li>10 = XXRRGGBB color</li>
<li>11 = Enum option</li>
<li>12 = Enum bits</li>
<li>13 = Sector tag</li>
<li>14 = Thing tag</li>
<li>15 = Linedef tag</li>
<li>22 = Byte angle (<span class="red">GZDB only</span>)</li>
<li>23 = Thing Radius (<span class="red">GZDB only</span>)</li>
<li>24 = Thing Height (<span class="red">GZDB only</span>)</li>
</ul>
<p><b class="fat">targetclasses</b> (string) - <span class="red">GZDB only</span><br />
When set, only things of given classes will be shown in the argument dropdown list. Used only when argument <strong>type</strong> is 14.<br />
The value can be either a thing class name of a comma-separated list of thing class names:<br />
<pre>
arg0
{
title = &quot;MapSpot Tag&quot;;
type = 14;
<span class="blue">targetclasses = &quot;MapSpot,MapSpotGravity&quot;;</span>
}
</pre>
<p><b class="fat">enum</b> (structure or string)<br />
Provides a list of predefined values to display for this argument. Used only when argument <strong>type</strong> is 11 or 12.<br />
The value can be either a name of a predefined enum:<br />
<pre>
arg0
{
title = &quot;Volume&quot;;
type = 11;
<span class="blue">enum = &quot;sound_volume&quot;;</span>
}
</pre>
or an explicit definition:<br />
<pre>
arg0
{
title = "Apply to";
type = 11;
<span class="blue">enum
{
0 = "Floor and Ceiling";
1 = "Ceiling";
2 = "Floor";
}</span>
}
</pre>
Enums can be also set in <a href="gc_decoratekeys.html#argenum">DECORATE</a>.<br />
<br />
<b class="fat">default</b> (integer) - <span class="red">GZDB only</span><br />
Sets the default value for a Thing or Linedef argument definition.<br />
Default value can be also set in <a href="gc_decoratekeys.html#argdefault">DECORATE</a>.<br />
<strong>Example:</strong>
</p>
<pre>9038
{
title = "ColorSetter";
arg0
{
title = "Red";
<span class="blue">default = 255;</span>
}
}</pre>
</p>
</div>
</body>
>>>>>>> dddb1bbf (Added, Game configurations: added "targetclasses" argument property. Can be used with argument type 14 (Thing Tag). When set, only things of given classes will be shown in the argument dropdown list in Edit Things window.)

View file

@ -16,6 +16,7 @@
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
@ -40,6 +41,7 @@ namespace CodeImp.DoomBuilder.Config
private readonly int type;
private EnumList enumlist;
private readonly object defaultvalue; //mxd
private readonly HashSet<string> targetclasses; //mxd
#endregion
@ -49,6 +51,7 @@ namespace CodeImp.DoomBuilder.Config
public string ToolTip { get { return tooltip; } } //mxd
public bool Used { get { return used; } }
public int Type { get { return type; } }
public HashSet<string> TargetClasses { get { return targetclasses; } } //mxd
public EnumList Enum { get { return enumlist; } internal set { enumlist = value; } }
public object DefaultValue { get { return defaultvalue; } } //mxd
@ -67,6 +70,18 @@ namespace CodeImp.DoomBuilder.Config
this.type = cfg.ReadSetting(argspath + ".arg" + istr + ".type", 0);
this.defaultvalue = cfg.ReadSetting(argspath + ".arg" + istr + ".default", 0); //mxd
//mxd. Check for TargetClass?
this.targetclasses = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
if(this.type == (int)UniversalType.ThingTag)
{
string s = cfg.ReadSetting(argspath + ".arg" + istr + ".targetclasses", string.Empty);
if(!string.IsNullOrEmpty(s))
{
foreach(string tclass in s.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries))
targetclasses.Add(tclass.Trim());
}
}
// Determine enum type
IDictionary argdic = cfg.ReadSetting(argspath + ".arg" + istr, new Hashtable());
if(argdic.Contains("enum"))

View file

@ -41,6 +41,7 @@ namespace CodeImp.DoomBuilder.Config
public const int THING_ERROR_NONE = 0;
public const int THING_ERROR_INSIDE = 1;
public const int THING_ERROR_INSIDE_STUCK = 2;
private const float THING_FIXED_SIZE = 14f; //mxd
#endregion
@ -232,7 +233,7 @@ namespace CodeImp.DoomBuilder.Config
this.args[i] = new ArgumentInfo(cfg, "thingtypes." + cat.Name + "." + key, i, enums);
// Safety
if(this.radius < 4f) this.radius = 16f;
if(this.radius < 4f || this.fixedsize) this.radius = THING_FIXED_SIZE;
if(this.hangs && this.absolutez) this.hangs = false; //mxd
// Make long name for sprite lookup
@ -288,7 +289,7 @@ namespace CodeImp.DoomBuilder.Config
this.parametertext = cat.ParameterText;
// Safety
if (this.radius < 4f) this.radius = 8f;
if(this.radius < 4f || this.fixedsize) this.radius = THING_FIXED_SIZE;
if(this.hangs && this.absolutez) this.hangs = false; //mxd
// Make long name for sprite lookup
@ -342,7 +343,6 @@ namespace CodeImp.DoomBuilder.Config
this.parametertext = cat.ParameterText;
// Safety
if (this.radius < 4f) this.radius = 8f;
if(this.hangs && this.absolutez) this.hangs = false; //mxd
// Apply settings from actor
@ -393,7 +393,6 @@ namespace CodeImp.DoomBuilder.Config
this.parametertext = cat.ParameterText;
// Safety
if (this.radius < 4f) this.radius = 8f;
if(this.hangs && this.absolutez) this.hangs = false; //mxd
// Apply settings from actor
@ -618,7 +617,7 @@ namespace CodeImp.DoomBuilder.Config
this.bright = actor.GetFlagValue("bright", false);
// Safety
if(this.radius < 4f) this.radius = 8f;
if(this.radius < 4f || this.fixedsize) this.radius = THING_FIXED_SIZE;
if(this.spritescale.Width == 0.0f) this.spritescale.Width = 1.0f;
if(this.spritescale.Height == 0.0f) this.spritescale.Height = 1.0f;

View file

@ -52,6 +52,7 @@ namespace CodeImp.DoomBuilder.Rendering
private const int THING_BUFFER_SIZE = 100;
private const float MINIMUM_THING_RADIUS = 1.5f; //mxd
private const float MINIMUM_SPRITE_RADIUS = 8.0f; //mxd
private const float FIXED_THING_SIZE = 48.0f; //mxd
internal const int NUM_VIEW_MODES = 4;
#endregion
@ -629,7 +630,6 @@ namespace CodeImp.DoomBuilder.Rendering
}
renderlayer = RenderLayers.Plotter;
try { graphics.Device.SetRenderState(RenderState.FogEnable, false); } catch(Exception) { }
// Rendertargets available?
if(plottertex != null)
@ -671,7 +671,6 @@ namespace CodeImp.DoomBuilder.Rendering
}
renderlayer = RenderLayers.Things;
try { graphics.Device.SetRenderState(RenderState.FogEnable, false); } catch(Exception) { }
// Rendertargets available?
if(thingstex != null)
@ -708,7 +707,6 @@ namespace CodeImp.DoomBuilder.Rendering
}
renderlayer = RenderLayers.Overlay;
try { graphics.Device.SetRenderState(RenderState.FogEnable, false); } catch(Exception) { }
// Rendertargets available?
if(overlaytex != null)
@ -961,9 +959,24 @@ namespace CodeImp.DoomBuilder.Rendering
if(thingsize * scale < MINIMUM_THING_RADIUS) return false; //mxd. Don't render tiny little things
// Determine sizes
float fixedscaler = (t.FixedSize ? 1.0f : 2.0f); //mxd
float circlesize = ((t.FixedSize || General.Settings.FixedThingsScale) && (scale > fixedscaler) ? t.Size * fixedscaler : t.Size * scale);
float bboxsize = ((!t.FixedSize && General.Settings.FixedThingsScale) && (scale > 2.0f) ? t.Size * scale : -1); //mxd
float circlesize, bboxsize;
if(t.FixedSize && scale > 1.0f)
{
circlesize = t.Size;
bboxsize = -1;
}
else if(General.Settings.FixedThingsScale && t.Size * scale > FIXED_THING_SIZE)
{
circlesize = FIXED_THING_SIZE;
bboxsize = t.Size * scale;
}
else
{
circlesize = t.Size * scale;
bboxsize = -1;
}
float screensize = (bboxsize > 0 ? bboxsize : circlesize); //mxd
// Transform to screen coordinates
@ -1034,8 +1047,13 @@ namespace CodeImp.DoomBuilder.Rendering
{
// Determine size
float thingsize = General.Settings.DrawThingsFixedSize ? General.Settings.DefaultThingSize : t.Size;
float fixedscaler = (t.FixedSize ? 1.0f : 2.0f);
float arrowsize = ((t.FixedSize || General.Settings.FixedThingsScale) && (scale > fixedscaler) ? t.Size * fixedscaler : t.Size * scale) * THING_ARROW_SIZE; //mxd
float arrowsize;
if(t.FixedSize && scale > 1.0f)
arrowsize = thingsize * THING_ARROW_SIZE;
else if(General.Settings.FixedThingsScale && thingsize * scale > FIXED_THING_SIZE)
arrowsize = FIXED_THING_SIZE * THING_ARROW_SIZE;
else
arrowsize = thingsize * scale * THING_ARROW_SIZE;
// Setup rotated rect for arrow
float sinarrowsize = (float)Math.Sin(t.Angle + Angle2D.PI * 0.25f) * arrowsize;
@ -1257,15 +1275,23 @@ namespace CodeImp.DoomBuilder.Rendering
buffercount = 0;
totalcount = 0;
foreach(Thing t in group.Value)
{
if(t.IsModel && ((General.Settings.GZDrawModelsMode == ModelRenderMode.SELECTION && t.Selected) || (General.Settings.GZDrawModelsMode == ModelRenderMode.ACTIVE_THINGS_FILTER && alpha == 1.0f))) continue;
bool forcespriterendering;
float spritewidth, spriteheight, spritescale;
float fixedscaler = (group.Value[0].FixedSize ? 1.0f : 2.0f); // Make sure thing size stays at 2x scale when FixedThingsScale is enabled
// Apply FixedSize setting?
if((group.Value[0].FixedSize || General.Settings.FixedThingsScale) && (scale > fixedscaler))
// Determine sizes
if(t.FixedSize && scale > 1.0f)
{
spritescale = fixedscaler;
forcespriterendering = true; // Always render sprite when thing size is affected by FixedSize or FixedThingsScale settings
spritescale = 1.0f;
forcespriterendering = true; // Always render sprite when thing size is affected by FixedSize setting
}
else if(General.Settings.FixedThingsScale && t.Size * scale > FIXED_THING_SIZE)
{
spritescale = FIXED_THING_SIZE / t.Size;
forcespriterendering = true; // Always render sprite when thing size is affected by FixedThingsScale setting
}
else
{
@ -1291,18 +1317,8 @@ namespace CodeImp.DoomBuilder.Rendering
spriteheight = spritewidth;
}
// Apply radius and height Thing Argument overrides?
if(!group.Value[0].FixedSize)
{
float sizeoverridescaler = group.Value[0].Size / info.Radius;
spritewidth *= sizeoverridescaler;
spriteheight *= sizeoverridescaler;
}
float spritesize = Math.Max(spritewidth, spriteheight);
foreach(Thing t in group.Value)
{
if(t.IsModel && ((General.Settings.GZDrawModelsMode == ModelRenderMode.SELECTION && t.Selected) || (General.Settings.GZDrawModelsMode == ModelRenderMode.ACTIVE_THINGS_FILTER && alpha == 1.0f))) continue;
if(!forcespriterendering && spritesize < MINIMUM_SPRITE_RADIUS)
{
// Hackish way to tell arrow rendering code to draw bigger arrow...

View file

@ -31,23 +31,31 @@ namespace CodeImp.DoomBuilder.Types
protected override EnumList CreateTagList()
{
//collect tags
// Collect tags
List<int> tags = new List<int>();
EnumList taglist = new EnumList();
foreach(Thing t in General.Map.Map.Things)
{
if(t.Tag == 0 || tags.Contains(t.Tag)) continue;
// Check target class?
if(arginfo.TargetClasses.Count > 0)
{
ThingTypeInfo info = General.Map.Data.GetThingInfoEx(t.SRB2Type);
if(info != null && !arginfo.TargetClasses.Contains(info.ClassName)) continue;
}
tags.Add(t.Tag);
}
//now sort them in descending order
// Now sort them in descending order
tags.Sort((a, b) => -1 * a.CompareTo(b));
//create enum items
// Create enum items
foreach(int tag in tags)
{
if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels
if(General.Map.Options.TagLabels.ContainsKey(tag)) // Tag labels
taglist.Add(new EnumItem(tag.ToString(), General.Map.Options.TagLabels[tag]));
else
taglist.Add(new EnumItem(tag.ToString(), tag.ToString()));