mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-18 18:11:13 +00:00
Fixed: inheritance from game configuration for dynamic lights; Fixed: visual representation of inherited lights (reported by Nash); Fixed: inherited thing arguments from game configuration; Added: //$ClearArgs for clearing inherited arguments.
This commit is contained in:
parent
125844b308
commit
748fe9e2e5
15 changed files with 288 additions and 114 deletions
|
@ -16,6 +16,7 @@ gzdoom_lights
|
||||||
9800
|
9800
|
||||||
{
|
{
|
||||||
title = "Light";
|
title = "Light";
|
||||||
|
class = "PointLight";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -40,6 +41,7 @@ gzdoom_lights
|
||||||
9801
|
9801
|
||||||
{
|
{
|
||||||
title = "Pulse Light";
|
title = "Pulse Light";
|
||||||
|
class = "PointLightPulse";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -70,6 +72,7 @@ gzdoom_lights
|
||||||
9802
|
9802
|
||||||
{
|
{
|
||||||
title = "Flicker Light";
|
title = "Flicker Light";
|
||||||
|
class = "PointLightFlicker";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -100,6 +103,7 @@ gzdoom_lights
|
||||||
9803
|
9803
|
||||||
{
|
{
|
||||||
title = "Sector Light";
|
title = "Sector Light";
|
||||||
|
class = "SectorPointLight";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -124,6 +128,7 @@ gzdoom_lights
|
||||||
9804
|
9804
|
||||||
{
|
{
|
||||||
title = "Random Light";
|
title = "Random Light";
|
||||||
|
class = "PointLightFlickerRandom";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -154,6 +159,7 @@ gzdoom_lights
|
||||||
9810
|
9810
|
||||||
{
|
{
|
||||||
title = "Additive Light";
|
title = "Additive Light";
|
||||||
|
class = "PointLightAdditive";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -178,6 +184,7 @@ gzdoom_lights
|
||||||
9811
|
9811
|
||||||
{
|
{
|
||||||
title = "Additive Pulse Light";
|
title = "Additive Pulse Light";
|
||||||
|
class = "PointLightPulseAdditive";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -208,6 +215,7 @@ gzdoom_lights
|
||||||
9812
|
9812
|
||||||
{
|
{
|
||||||
title = "Additive Flicker Light";
|
title = "Additive Flicker Light";
|
||||||
|
class = "PointLightFlickerAdditive";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -238,6 +246,7 @@ gzdoom_lights
|
||||||
9813
|
9813
|
||||||
{
|
{
|
||||||
title = "Additive Sector Light";
|
title = "Additive Sector Light";
|
||||||
|
class = "SectorPointLightAdditive";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -262,6 +271,7 @@ gzdoom_lights
|
||||||
9814
|
9814
|
||||||
{
|
{
|
||||||
title = "Additive Random Light";
|
title = "Additive Random Light";
|
||||||
|
class = "PointLightFlickerRandomAdditive";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -292,6 +302,7 @@ gzdoom_lights
|
||||||
9820
|
9820
|
||||||
{
|
{
|
||||||
title = "Subtractive Light";
|
title = "Subtractive Light";
|
||||||
|
class = "PointLightSubtractive";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -316,6 +327,7 @@ gzdoom_lights
|
||||||
9821
|
9821
|
||||||
{
|
{
|
||||||
title = "Subtractive Pulse Light";
|
title = "Subtractive Pulse Light";
|
||||||
|
class = "PointLightPulseSubtractive";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -346,6 +358,7 @@ gzdoom_lights
|
||||||
9822
|
9822
|
||||||
{
|
{
|
||||||
title = "Subtractive Flicker Light";
|
title = "Subtractive Flicker Light";
|
||||||
|
class = "PointLightFlickerSubtractive";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -376,6 +389,7 @@ gzdoom_lights
|
||||||
9823
|
9823
|
||||||
{
|
{
|
||||||
title = "Subtractive Sector Light";
|
title = "Subtractive Sector Light";
|
||||||
|
class = "SectorPointLightSubtractive";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -400,6 +414,7 @@ gzdoom_lights
|
||||||
9824
|
9824
|
||||||
{
|
{
|
||||||
title = "Subtractive Random Light";
|
title = "Subtractive Random Light";
|
||||||
|
class = "PointLightFlickerRandomSubtractive";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -431,6 +446,7 @@ gzdoom_lights
|
||||||
9830
|
9830
|
||||||
{
|
{
|
||||||
title = "Attenuated Light";
|
title = "Attenuated Light";
|
||||||
|
class = "PointLightAttenuated";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -455,6 +471,7 @@ gzdoom_lights
|
||||||
9831
|
9831
|
||||||
{
|
{
|
||||||
title = "Attenuated Pulse Light";
|
title = "Attenuated Pulse Light";
|
||||||
|
class = "PointLightPulseAttenuated";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -485,6 +502,7 @@ gzdoom_lights
|
||||||
9832
|
9832
|
||||||
{
|
{
|
||||||
title = "Attenuated Flicker Light";
|
title = "Attenuated Flicker Light";
|
||||||
|
class = "PointLightFlickerAttenuated";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -515,6 +533,7 @@ gzdoom_lights
|
||||||
9833
|
9833
|
||||||
{
|
{
|
||||||
title = "Attenuated Sector Light";
|
title = "Attenuated Sector Light";
|
||||||
|
class = "SectorPointLightAttenuated";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Red";
|
title = "Red";
|
||||||
|
@ -539,6 +558,7 @@ gzdoom_lights
|
||||||
9834
|
9834
|
||||||
{
|
{
|
||||||
title = "Attenuated Random Light";
|
title = "Attenuated Random Light";
|
||||||
|
class = "PointLightFlickerRandomAttenuated";
|
||||||
fixedrotation = true;
|
fixedrotation = true;
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
|
@ -569,6 +589,7 @@ gzdoom_lights
|
||||||
1502
|
1502
|
||||||
{
|
{
|
||||||
title = "Vavoom Light";
|
title = "Vavoom Light";
|
||||||
|
class = "VavoomLightWhite";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Radius";
|
title = "Radius";
|
||||||
|
@ -578,6 +599,7 @@ gzdoom_lights
|
||||||
1503
|
1503
|
||||||
{
|
{
|
||||||
title = "Vavoom Light Color";
|
title = "Vavoom Light Color";
|
||||||
|
class = "VavoomLightColor";
|
||||||
arg0
|
arg0
|
||||||
{
|
{
|
||||||
title = "Radius";
|
title = "Radius";
|
||||||
|
|
|
@ -242,10 +242,42 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
//mxd. Constructor for an argument info defined in DECORATE
|
//mxd. Constructor for an argument info defined in DECORATE
|
||||||
internal ArgumentInfo(string actorname, string argtitle, string tooltip, string renderstyle, string rendercolor,
|
// [ZZ] Constructor for an argument info defined in DECORATE/ZScript. reworked.
|
||||||
string minrange, string minrangecolor, string maxrange, string maxrangecolor, string targetclasses,
|
internal ArgumentInfo(ActorStructure actor, int i)
|
||||||
int type, int defaultvalue, string enumstr, IDictionary<string, EnumList> enums, bool str, string argtitlestr)
|
|
||||||
{
|
{
|
||||||
|
if(!actor.HasPropertyWithValue("$arg" + i))
|
||||||
|
{
|
||||||
|
used = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string argtitle = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i));
|
||||||
|
string tooltip = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "tooltip").Replace("\\n", Environment.NewLine));
|
||||||
|
int type = actor.GetPropertyValueInt("$arg" + i + "type", 0);
|
||||||
|
string targetclasses = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "targetclasses"));
|
||||||
|
int defaultvalue = actor.GetPropertyValueInt("$arg" + i + "default", 0);
|
||||||
|
string enumstr = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "enum"));
|
||||||
|
string renderstyle = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "renderstyle"));
|
||||||
|
string rendercolor, minrange, maxrange, minrangecolor, maxrangecolor;
|
||||||
|
bool str = (actor.HasProperty("$arg" + i + "str"));
|
||||||
|
string argtitlestr = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "str"));
|
||||||
|
if (string.IsNullOrEmpty(argtitlestr)) argtitlestr = argtitle;
|
||||||
|
if (!string.IsNullOrEmpty(renderstyle))
|
||||||
|
{
|
||||||
|
rendercolor = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "rendercolor"));
|
||||||
|
minrange = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "minrange"));
|
||||||
|
minrangecolor = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "minrangecolor"));
|
||||||
|
maxrange = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "maxrange"));
|
||||||
|
maxrangecolor = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "maxrangecolor"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rendercolor = string.Empty; minrange = string.Empty; maxrange = string.Empty; minrangecolor = string.Empty; maxrangecolor = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
string actorname = actor.ClassName;
|
||||||
|
IDictionary<string, EnumList> enums = General.Map.Config.Enums;
|
||||||
|
|
||||||
this.used = true;
|
this.used = true;
|
||||||
this.title = argtitle;
|
this.title = argtitle;
|
||||||
this.tooltip = tooltip;
|
this.tooltip = tooltip;
|
||||||
|
|
|
@ -27,6 +27,7 @@ using CodeImp.DoomBuilder.IO;
|
||||||
using CodeImp.DoomBuilder.Map;
|
using CodeImp.DoomBuilder.Map;
|
||||||
using CodeImp.DoomBuilder.Rendering;
|
using CodeImp.DoomBuilder.Rendering;
|
||||||
using CodeImp.DoomBuilder.ZDoom;
|
using CodeImp.DoomBuilder.ZDoom;
|
||||||
|
using CodeImp.DoomBuilder.GZBuilder;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -97,6 +98,10 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
//mxd. Ambinent sound info
|
//mxd. Ambinent sound info
|
||||||
private AmbientSoundInfo ambientsound;
|
private AmbientSoundInfo ambientsound;
|
||||||
|
|
||||||
|
// [ZZ] GZDoom inheritance data (DECORATE and ZScript). used for dynamic lighting.
|
||||||
|
private int dynamiclighttype = -1;
|
||||||
|
private List<ActorStructure> actorstructures = new List<ActorStructure>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Properties
|
#region ================== Properties
|
||||||
|
@ -143,6 +148,10 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
//mxd. Ambinent sound info
|
//mxd. Ambinent sound info
|
||||||
public AmbientSoundInfo AmbientSound { get { return ambientsound; } internal set { ambientsound = value; } }
|
public AmbientSoundInfo AmbientSound { get { return ambientsound; } internal set { ambientsound = value; } }
|
||||||
|
|
||||||
|
// [ZZ] GZDoom inheritance data
|
||||||
|
public int DynamicLightType { get { return dynamiclighttype; } set { if (dynamiclighttype < 0) dynamiclighttype = value; } }
|
||||||
|
public List<ActorStructure> ActorStructures { get { return actorstructures; } internal set { actorstructures = value; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Constructor / Disposer
|
#region ================== Constructor / Disposer
|
||||||
|
@ -438,6 +447,10 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
this.rollsprite = other.rollsprite;
|
this.rollsprite = other.rollsprite;
|
||||||
this.rollcenter = other.rollcenter;
|
this.rollcenter = other.rollcenter;
|
||||||
|
|
||||||
|
//
|
||||||
|
this.dynamiclighttype = other.dynamiclighttype;
|
||||||
|
this.actorstructures = other.actorstructures;
|
||||||
|
|
||||||
// We have no destructor
|
// We have no destructor
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
@ -475,34 +488,9 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
//mxd. Custom argument titles?
|
//mxd. Custom argument titles?
|
||||||
for(int i = 0; i < args.Length; i++)
|
for(int i = 0; i < args.Length; i++)
|
||||||
{
|
{
|
||||||
if(!actor.HasPropertyWithValue("$arg" + i)) continue;
|
ArgumentInfo arg = actor.GetArgumentInfo(i);
|
||||||
string argtitle = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i));
|
if (arg != null)
|
||||||
string argtooltip = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "tooltip").Replace("\\n", Environment.NewLine));
|
args[i] = arg;
|
||||||
int argtype = actor.GetPropertyValueInt("$arg" + i + "type", 0);
|
|
||||||
string targetclasses = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "targetclasses"));
|
|
||||||
int defaultvalue = actor.GetPropertyValueInt("$arg" + i + "default", 0);
|
|
||||||
string argenum = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "enum"));
|
|
||||||
string argrenderstyle = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "renderstyle"));
|
|
||||||
string argrendercolor, minrange, maxrange, minrangecolor, maxrangecolor;
|
|
||||||
bool argstr = (actor.HasProperty("$arg" + i + "str"));
|
|
||||||
string argtitlestr = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "str"));
|
|
||||||
if (string.IsNullOrEmpty(argtitlestr)) argtitlestr = argtitle;
|
|
||||||
if (!string.IsNullOrEmpty(argrenderstyle))
|
|
||||||
{
|
|
||||||
argrendercolor = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "rendercolor"));
|
|
||||||
minrange = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "minrange"));
|
|
||||||
minrangecolor = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "minrangecolor"));
|
|
||||||
maxrange = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "maxrange"));
|
|
||||||
maxrangecolor = ZDTextParser.StripQuotes(actor.GetPropertyAllValues("$arg" + i + "maxrangecolor"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
argrendercolor = string.Empty; minrange = string.Empty; maxrange = string.Empty; minrangecolor = string.Empty; maxrangecolor = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
args[i] = new ArgumentInfo(title, argtitle, argtooltip, argrenderstyle, argrendercolor,
|
|
||||||
minrange, minrangecolor, maxrange, maxrangecolor, targetclasses,
|
|
||||||
argtype, defaultvalue, argenum, General.Map.Config.Enums, argstr, argtitlestr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//mxd. Some SLADE compatibility
|
//mxd. Some SLADE compatibility
|
||||||
|
@ -605,6 +593,20 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
|
|
||||||
//mxd
|
//mxd
|
||||||
if(blocking > THING_BLOCKING_NONE) errorcheck = THING_ERROR_INSIDE_STUCK;
|
if(blocking > THING_BLOCKING_NONE) errorcheck = THING_ERROR_INSIDE_STUCK;
|
||||||
|
|
||||||
|
// [ZZ] add parent doomednums if any. (and this one as well)
|
||||||
|
actorstructures.Clear();
|
||||||
|
ActorStructure p = actor;
|
||||||
|
while (p != null)
|
||||||
|
{
|
||||||
|
actorstructures.Add(p);
|
||||||
|
|
||||||
|
int light_doomednumtype = GZGeneral.GetGZLightTypeByClass(p.ClassName);
|
||||||
|
if (light_doomednumtype != 0)
|
||||||
|
DynamicLightType = light_doomednumtype;
|
||||||
|
|
||||||
|
p = p.BaseClass;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//mxd. This tries to find all possible sprite rotations. Returns true when voxel substitute exists
|
//mxd. This tries to find all possible sprite rotations. Returns true when voxel substitute exists
|
||||||
|
|
|
@ -539,7 +539,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||||
const int linealpha = 128;
|
const int linealpha = 128;
|
||||||
foreach(Thing t in things)
|
foreach(Thing t in things)
|
||||||
{
|
{
|
||||||
int lightid = Array.IndexOf(GZGeneral.GZ_LIGHTS, t.Type);
|
int lightid = GZGeneral.GetGZLightTypeByThing(t);
|
||||||
if(lightid == -1) continue;
|
if(lightid == -1) continue;
|
||||||
|
|
||||||
// TODO: this basically duplicates VisualThing.UpdateLight()...
|
// TODO: this basically duplicates VisualThing.UpdateLight()...
|
||||||
|
@ -554,7 +554,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||||
else if (lightid < GZGeneral.GZ_LIGHT_TYPES[1]) n = 10;
|
else if (lightid < GZGeneral.GZ_LIGHT_TYPES[1]) n = 10;
|
||||||
else if (lightid < GZGeneral.GZ_LIGHT_TYPES[2]) n = 20;
|
else if (lightid < GZGeneral.GZ_LIGHT_TYPES[2]) n = 20;
|
||||||
else n = 30;
|
else n = 30;
|
||||||
DynamicLightType lightType = (DynamicLightType)(t.Type - 9800 - n);
|
DynamicLightType lightType = (DynamicLightType)(t.DynamicLightType - 9800 - n);
|
||||||
|
|
||||||
if(lightType == DynamicLightType.SECTOR)
|
if(lightType == DynamicLightType.SECTOR)
|
||||||
{
|
{
|
||||||
|
@ -584,7 +584,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch(t.Type)
|
switch(t.DynamicLightType)
|
||||||
{
|
{
|
||||||
case 1502: // Vavoom light
|
case 1502: // Vavoom light
|
||||||
color = new PixelColor(linealpha, 255, 255, 255);
|
color = new PixelColor(linealpha, 255, 255, 255);
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#region ================== Namespaces
|
#region ================== Namespaces
|
||||||
|
|
||||||
|
using CodeImp.DoomBuilder.Config;
|
||||||
using CodeImp.DoomBuilder.GZBuilder.Data;
|
using CodeImp.DoomBuilder.GZBuilder.Data;
|
||||||
|
using CodeImp.DoomBuilder.Map;
|
||||||
|
using System;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -28,6 +31,34 @@ namespace CodeImp.DoomBuilder.GZBuilder
|
||||||
private static readonly int[] acsSpecials = { 80, 81, 82, 83, 84, 85, 226 };
|
private static readonly int[] acsSpecials = { 80, 81, 82, 83, 84, 85, 226 };
|
||||||
public static int[] ACS_SPECIALS { get { return acsSpecials; } }
|
public static int[] ACS_SPECIALS { get { return acsSpecials; } }
|
||||||
|
|
||||||
|
// [ZZ] this is for proper inheritance of lights.
|
||||||
|
// technically this can be found by parsing gzdoom.pk3/mapinfo/common.txt, but I wouldn't do that without a good reason for now.
|
||||||
|
private static readonly string[] gzLightClasses =
|
||||||
|
{
|
||||||
|
/* normal lights */ "pointlight", "pointlightpulse", "pointlightflicker", "sectorpointlight", "pointlightflickerrandom",
|
||||||
|
/* additive lights */ "pointlightadditive", "pointlightpulseadditive", "pointlightflickeradditive", "sectorpointlightadditive", "pointlightflickerrandomadditive",
|
||||||
|
/* subtractive lights */ "pointlightsubtractive", "pointlightpulsesubtractive", "pointlightflickersubtractive", "sectorpointlightsubtractive", "pointlightflickerrandomsubtractive",
|
||||||
|
/* attenuated lights */ "pointlightattenuated", "pointlightpulseattenuated", "pointlightflickerattenuated", "sectorpointlightattenuated", "pointlightflickerrandomattenuated",
|
||||||
|
/* vavoom lights */ "vavoomlightwhite", "vavoomlightcolor"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static int GetGZLightTypeByClass(string classname)
|
||||||
|
{
|
||||||
|
int idx = Array.IndexOf(gzLightClasses, classname.ToLowerInvariant());
|
||||||
|
if (idx >= 0)
|
||||||
|
return gzLights[idx];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetGZLightTypeByThing(Thing t)
|
||||||
|
{
|
||||||
|
int type = Array.IndexOf(gzLights, t.DynamicLightType);
|
||||||
|
if (type >= 0)
|
||||||
|
return type;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
private int type;
|
private int type;
|
||||||
|
private int dynamiclighttype;
|
||||||
private Vector3D pos;
|
private Vector3D pos;
|
||||||
private int angledoom; // Angle as entered / stored in file
|
private int angledoom; // Angle as entered / stored in file
|
||||||
private float anglerad; // Angle in radians
|
private float anglerad; // Angle in radians
|
||||||
|
@ -89,6 +90,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
|
|
||||||
public MapSet Map { get { return map; } }
|
public MapSet Map { get { return map; } }
|
||||||
public int Type { get { return type; } set { BeforePropsChange(); type = value; } } //mxd
|
public int Type { get { return type; } set { BeforePropsChange(); type = value; } } //mxd
|
||||||
|
public int DynamicLightType { get { return dynamiclighttype; } internal set { BeforePropsChange(); dynamiclighttype = value; } }
|
||||||
public Vector3D Position { get { return pos; } }
|
public Vector3D Position { get { return pos; } }
|
||||||
public float ScaleX { get { return scaleX; } } //mxd. This is UDMF property, not actual scale!
|
public float ScaleX { get { return scaleX; } } //mxd. This is UDMF property, not actual scale!
|
||||||
public float ScaleY { get { return scaleY; } } //mxd. This is UDMF property, not actual scale!
|
public float ScaleY { get { return scaleY; } } //mxd. This is UDMF property, not actual scale!
|
||||||
|
@ -223,6 +225,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
|
|
||||||
// Copy properties
|
// Copy properties
|
||||||
t.type = type;
|
t.type = type;
|
||||||
|
t.dynamiclighttype = dynamiclighttype;
|
||||||
t.anglerad = anglerad;
|
t.anglerad = anglerad;
|
||||||
t.angledoom = angledoom;
|
t.angledoom = angledoom;
|
||||||
t.roll = roll; //mxd
|
t.roll = roll; //mxd
|
||||||
|
@ -522,6 +525,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
ThingTypeInfo ti = General.Map.Data.GetThingInfo(type);
|
ThingTypeInfo ti = General.Map.Data.GetThingInfo(type);
|
||||||
|
|
||||||
// Apply size
|
// Apply size
|
||||||
|
dynamiclighttype = (Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, type)!=-1) ? type : ti.DynamicLightType;
|
||||||
size = ti.Radius;
|
size = ti.Radius;
|
||||||
height = ti.Height; //mxd
|
height = ti.Height; //mxd
|
||||||
fixedsize = ti.FixedSize;
|
fixedsize = ti.FixedSize;
|
||||||
|
|
|
@ -542,11 +542,11 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
if(t.Selected) return General.Colors.Selection;
|
if(t.Selected) return General.Colors.Selection;
|
||||||
|
|
||||||
//mxd. If thing is light, set it's color to light color:
|
//mxd. If thing is light, set it's color to light color:
|
||||||
if(Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, t.Type) != -1)
|
if(GZBuilder.GZGeneral.GetGZLightTypeByThing(t) != -1)
|
||||||
{
|
{
|
||||||
if(t.Type == 1502) //vavoom light
|
if(t.DynamicLightType == 1502) //vavoom light
|
||||||
return new PixelColor(255, 255, 255, 255);
|
return new PixelColor(255, 255, 255, 255);
|
||||||
if(t.Type == 1503) //vavoom colored light
|
if(t.DynamicLightType == 1503) //vavoom colored light
|
||||||
return new PixelColor(255, (byte)t.Args[1], (byte)t.Args[2], (byte)t.Args[3]);
|
return new PixelColor(255, (byte)t.Args[1], (byte)t.Args[2], (byte)t.Args[3]);
|
||||||
return new PixelColor(255, (byte)t.Args[0], (byte)t.Args[1], (byte)t.Args[2]);
|
return new PixelColor(255, (byte)t.Args[0], (byte)t.Args[1], (byte)t.Args[2]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -895,7 +895,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
world = CreateThingPositionMatrix(t);
|
world = CreateThingPositionMatrix(t);
|
||||||
|
|
||||||
//mxd. If current thing is light - set it's color to light color
|
//mxd. If current thing is light - set it's color to light color
|
||||||
if(Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, t.Thing.Type) != -1 && !fullbrightness)
|
if(GZBuilder.GZGeneral.GetGZLightTypeByThing(t.Thing) != -1 && !fullbrightness)
|
||||||
{
|
{
|
||||||
wantedshaderpass += 4; // Render using one of passes, which uses World3D.VertexColor
|
wantedshaderpass += 4; // Render using one of passes, which uses World3D.VertexColor
|
||||||
vertexcolor = t.LightColor;
|
vertexcolor = t.LightColor;
|
||||||
|
@ -1205,7 +1205,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
world = CreateThingPositionMatrix(t);
|
world = CreateThingPositionMatrix(t);
|
||||||
|
|
||||||
//mxd. If current thing is light - set it's color to light color
|
//mxd. If current thing is light - set it's color to light color
|
||||||
if(Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, t.Thing.Type) != -1 && !fullbrightness)
|
if(GZBuilder.GZGeneral.GetGZLightTypeByThing(t.Thing) != -1 && !fullbrightness)
|
||||||
{
|
{
|
||||||
wantedshaderpass += 4; // Render using one of passes, which uses World3D.VertexColor
|
wantedshaderpass += 4; // Render using one of passes, which uses World3D.VertexColor
|
||||||
vertexcolor = t.LightColor;
|
vertexcolor = t.LightColor;
|
||||||
|
|
|
@ -612,7 +612,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
protected void CheckLightState()
|
protected void CheckLightState()
|
||||||
{
|
{
|
||||||
//mxd. Check if thing is light
|
//mxd. Check if thing is light
|
||||||
int light_id = Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, thing.Type);
|
int light_id = GZBuilder.GZGeneral.GetGZLightTypeByThing(thing);
|
||||||
if (light_id != -1)
|
if (light_id != -1)
|
||||||
{
|
{
|
||||||
isGldefsLight = false;
|
isGldefsLight = false;
|
||||||
|
@ -644,7 +644,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
//mxd. Used in ColorPicker to update light
|
//mxd. Used in ColorPicker to update light
|
||||||
public void UpdateLight()
|
public void UpdateLight()
|
||||||
{
|
{
|
||||||
int light_id = Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, thing.Type);
|
int light_id = GZBuilder.GZGeneral.GetGZLightTypeByThing(thing);
|
||||||
if (light_id != -1)
|
if (light_id != -1)
|
||||||
{
|
{
|
||||||
UpdateLight(light_id);
|
UpdateLight(light_id);
|
||||||
|
@ -695,7 +695,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
thing.Args[1] / DYNLIGHT_INTENSITY_SCALER,
|
thing.Args[1] / DYNLIGHT_INTENSITY_SCALER,
|
||||||
thing.Args[2] / DYNLIGHT_INTENSITY_SCALER);
|
thing.Args[2] / DYNLIGHT_INTENSITY_SCALER);
|
||||||
}
|
}
|
||||||
lightType = (DynamicLightType)(thing.Type - 9800 - n);
|
lightType = (DynamicLightType)(thing.DynamicLightType - 9800 - n);
|
||||||
|
|
||||||
if(lightType == DynamicLightType.SECTOR)
|
if(lightType == DynamicLightType.SECTOR)
|
||||||
{
|
{
|
||||||
|
@ -712,7 +712,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
else //it's one of vavoom lights
|
else //it's one of vavoom lights
|
||||||
{
|
{
|
||||||
lightRenderStyle = DynamicLightRenderStyle.VAVOOM;
|
lightRenderStyle = DynamicLightRenderStyle.VAVOOM;
|
||||||
lightType = (DynamicLightType)thing.Type;
|
lightType = (DynamicLightType)thing.DynamicLightType;
|
||||||
if(lightType == DynamicLightType.VAVOOM_COLORED)
|
if(lightType == DynamicLightType.VAVOOM_COLORED)
|
||||||
{
|
{
|
||||||
lightColor = new Color4((float)lightRenderStyle / 100.0f,
|
lightColor = new Color4((float)lightRenderStyle / 100.0f,
|
||||||
|
|
|
@ -58,6 +58,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
//mxd. Categories
|
//mxd. Categories
|
||||||
internal DecorateCategoryInfo catinfo;
|
internal DecorateCategoryInfo catinfo;
|
||||||
|
|
||||||
|
// [ZZ] direct ArgumentInfos (from game configuration), or own ArgumentInfos (from props)
|
||||||
|
internal ArgumentInfo[] args = new ArgumentInfo[5];
|
||||||
|
|
||||||
// States
|
// States
|
||||||
internal Dictionary<string, StateStructure> states;
|
internal Dictionary<string, StateStructure> states;
|
||||||
|
|
||||||
|
@ -301,6 +304,31 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This method parses $argN into argumentinfos.
|
||||||
|
/// </summary>
|
||||||
|
public void ParseCustomArguments()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
if (HasProperty("$arg" + i))
|
||||||
|
args[i] = new ArgumentInfo(this, i);
|
||||||
|
else args[i] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArgumentInfo GetArgumentInfo(int idx)
|
||||||
|
{
|
||||||
|
if (args[idx] != null)
|
||||||
|
return args[idx];
|
||||||
|
// if we have $clearargs, don't inherit anything!
|
||||||
|
if (props.ContainsKey("$clearargs"))
|
||||||
|
return null;
|
||||||
|
if (baseclass != null)
|
||||||
|
return baseclass.GetArgumentInfo(idx);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using CodeImp.DoomBuilder.Config;
|
using CodeImp.DoomBuilder.Config;
|
||||||
|
using CodeImp.DoomBuilder.Data;
|
||||||
using CodeImp.DoomBuilder.Types;
|
using CodeImp.DoomBuilder.Types;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -392,8 +393,11 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
previoustoken = token;
|
previoustoken = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// parsing done, process thing arguments
|
||||||
|
ParseCustomArguments();
|
||||||
|
|
||||||
//mxd. Check if baseclass is valid
|
//mxd. Check if baseclass is valid
|
||||||
if (inheritclass.ToLowerInvariant() != "actor" && doomednum > -1 && baseclass == null)
|
if (inheritclass.ToLowerInvariant() != "actor" && doomednum > -1)
|
||||||
{
|
{
|
||||||
//check if this class inherits from a class defined in game configuration
|
//check if this class inherits from a class defined in game configuration
|
||||||
Dictionary<int, ThingTypeInfo> things = General.Map.Config.GetThingTypes();
|
Dictionary<int, ThingTypeInfo> things = General.Map.Config.GetThingTypes();
|
||||||
|
@ -404,9 +408,12 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
if (!string.IsNullOrEmpty(ti.Value.ClassName) && ti.Value.ClassName.ToLowerInvariant() == inheritclasscheck)
|
if (!string.IsNullOrEmpty(ti.Value.ClassName) && ti.Value.ClassName.ToLowerInvariant() == inheritclasscheck)
|
||||||
{
|
{
|
||||||
//states
|
//states
|
||||||
|
// [ZZ] allow internal prefix here. it can inherit MapSpot, light, or other internal stuff.
|
||||||
if (states.Count == 0 && !string.IsNullOrEmpty(ti.Value.Sprite))
|
if (states.Count == 0 && !string.IsNullOrEmpty(ti.Value.Sprite))
|
||||||
states.Add("spawn", new StateStructure(ti.Value.Sprite.Substring(0, 5)));
|
states.Add("spawn", new StateStructure(ti.Value.Sprite.StartsWith(DataManager.INTERNAL_PREFIX) ? ti.Value.Sprite : ti.Value.Sprite.Substring(0, 5)));
|
||||||
|
|
||||||
|
if (baseclass == null)
|
||||||
|
{
|
||||||
//flags
|
//flags
|
||||||
if (ti.Value.Hangs && !flags.ContainsKey("spawnceiling"))
|
if (ti.Value.Hangs && !flags.ContainsKey("spawnceiling"))
|
||||||
flags["spawnceiling"] = true;
|
flags["spawnceiling"] = true;
|
||||||
|
@ -420,11 +427,28 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
|
|
||||||
if (!props.ContainsKey("radius"))
|
if (!props.ContainsKey("radius"))
|
||||||
props["radius"] = new List<string> { ti.Value.Radius.ToString() };
|
props["radius"] = new List<string> { ti.Value.Radius.ToString() };
|
||||||
|
}
|
||||||
|
|
||||||
|
// [ZZ] inherit arguments from game configuration
|
||||||
|
//
|
||||||
|
if (!props.ContainsKey("$clearargs"))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
if (args[i] != null)
|
||||||
|
continue; // don't touch it if we already have overrides
|
||||||
|
|
||||||
|
ArgumentInfo arg = ti.Value.Args[i];
|
||||||
|
if (arg != null && arg.Used)
|
||||||
|
args[i] = arg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (baseclass == null)
|
||||||
parser.LogWarning("Unable to find \"" + inheritclass + "\" class to inherit from, while parsing \"" + classname + ":" + doomednum + "\"");
|
parser.LogWarning("Unable to find \"" + inheritclass + "\" class to inherit from, while parsing \"" + classname + ":" + doomednum + "\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -673,6 +673,9 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// parsing done, process thing arguments
|
||||||
|
ParseCustomArguments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -896,20 +896,32 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
{
|
{
|
||||||
actor.baseclass = GetArchivedActorByName(cls.ParentName, true);
|
actor.baseclass = GetArchivedActorByName(cls.ParentName, true);
|
||||||
string inheritclass = cls.ParentName;
|
string inheritclass = cls.ParentName;
|
||||||
if (actor.baseclass == null)
|
|
||||||
{
|
|
||||||
//check if this class inherits from a class defined in game configuration
|
//check if this class inherits from a class defined in game configuration
|
||||||
string inheritclasscheck = inheritclass.ToLowerInvariant();
|
string inheritclasscheck = inheritclass.ToLowerInvariant();
|
||||||
|
|
||||||
|
// inherit args from base class
|
||||||
|
if (actor.baseclass != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
if (actor.args[i] == null)
|
||||||
|
actor.args[i] = actor.baseclass.args[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool thingfound = false;
|
bool thingfound = false;
|
||||||
foreach (KeyValuePair<int, ThingTypeInfo> ti in things)
|
foreach (KeyValuePair<int, ThingTypeInfo> ti in things)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(ti.Value.ClassName) && ti.Value.ClassName.ToLowerInvariant() == inheritclasscheck)
|
if (!string.IsNullOrEmpty(ti.Value.ClassName) && ti.Value.ClassName.ToLowerInvariant() == inheritclasscheck)
|
||||||
{
|
{
|
||||||
//states
|
//states
|
||||||
|
// [ZZ] allow internal prefix here. it can inherit MapSpot, light, or other internal stuff.
|
||||||
if (actor.states.Count == 0 && !string.IsNullOrEmpty(ti.Value.Sprite))
|
if (actor.states.Count == 0 && !string.IsNullOrEmpty(ti.Value.Sprite))
|
||||||
actor.states.Add("spawn", new StateStructure(ti.Value.Sprite.Substring(0, 5)));
|
actor.states.Add("spawn", new StateStructure(ti.Value.Sprite.StartsWith(DataManager.INTERNAL_PREFIX) ? ti.Value.Sprite : ti.Value.Sprite.Substring(0, 5)));
|
||||||
|
|
||||||
|
if (actor.baseclass == null)
|
||||||
|
{
|
||||||
//flags
|
//flags
|
||||||
if (ti.Value.Hangs && !actor.flags.ContainsKey("spawnceiling"))
|
if (ti.Value.Hangs && !actor.flags.ContainsKey("spawnceiling"))
|
||||||
actor.flags["spawnceiling"] = true;
|
actor.flags["spawnceiling"] = true;
|
||||||
|
@ -923,13 +935,29 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
|
|
||||||
if (!actor.props.ContainsKey("radius"))
|
if (!actor.props.ContainsKey("radius"))
|
||||||
actor.props["radius"] = new List<string> { ti.Value.Radius.ToString() };
|
actor.props["radius"] = new List<string> { ti.Value.Radius.ToString() };
|
||||||
|
}
|
||||||
|
|
||||||
|
// [ZZ] inherit arguments from game configuration
|
||||||
|
//
|
||||||
|
if (!actor.props.ContainsKey("$clearargs"))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
if (actor.args[i] != null)
|
||||||
|
continue; // don't touch it if we already have overrides
|
||||||
|
|
||||||
|
ArgumentInfo arg = ti.Value.Args[i];
|
||||||
|
if (arg != null && arg.Used)
|
||||||
|
actor.args[i] = arg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
thingfound = true;
|
thingfound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!thingfound) LogWarning("Unable to find \"" + inheritclass + "\" class to inherit from, while parsing \"" + cls.ClassName + "\"");
|
if (actor.baseclass == null && !thingfound)
|
||||||
|
LogWarning("Unable to find \"" + inheritclass + "\" class to inherit from, while parsing \"" + cls.ClassName + "\"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
|
|
||||||
private static bool RELATIVE_MODE;
|
private static bool RELATIVE_MODE;
|
||||||
|
|
||||||
private static readonly int[] LIGHT_USES_ANGLE_VALUE = { 9801, 9802, 9804, 9811, 9812, 9814, 9821, 9822, 9824 };
|
private static readonly int[] LIGHT_USES_ANGLE_VALUE = { 9801, 9802, 9804, 9811, 9812, 9814, 9821, 9822, 9824, 9831, 9832, 9834 };
|
||||||
|
|
||||||
private List<Thing> selection;
|
private List<Thing> selection;
|
||||||
private List<VisualThing> visualSelection;
|
private List<VisualThing> visualSelection;
|
||||||
|
@ -102,7 +102,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
|
|
||||||
foreach(VisualThing t in selectedVisualThings)
|
foreach(VisualThing t in selectedVisualThings)
|
||||||
{
|
{
|
||||||
if(Array.IndexOf(GZGeneral.GZ_LIGHTS, t.Thing.Type) != -1)
|
if(GZGeneral.GetGZLightTypeByThing(t.Thing) != -1)
|
||||||
{
|
{
|
||||||
selection.Add(t.Thing);
|
selection.Add(t.Thing);
|
||||||
visualSelection.Add(t);
|
visualSelection.Add(t);
|
||||||
|
@ -114,7 +114,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
ICollection<Thing> list = General.Map.Map.GetSelectedThings(true);
|
ICollection<Thing> list = General.Map.Map.GetSelectedThings(true);
|
||||||
foreach(Thing t in list)
|
foreach(Thing t in list)
|
||||||
{
|
{
|
||||||
if(Array.IndexOf(GZGeneral.GZ_LIGHTS, t.Type) != -1)
|
if(GZGeneral.GetGZLightTypeByThing(t) != -1)
|
||||||
selection.Add(t);
|
selection.Add(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,9 +124,9 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
//this is called only once
|
//this is called only once
|
||||||
private void SetupSliders(Thing referenceThing)
|
private void SetupSliders(Thing referenceThing)
|
||||||
{
|
{
|
||||||
ThingTypeInfo typeInfo = General.Map.Data.GetThingInfoEx(referenceThing.Type);
|
ThingTypeInfo typeInfo = General.Map.Data.GetThingInfoEx(referenceThing.DynamicLightType);
|
||||||
int firstArg = 3;
|
int firstArg = 3;
|
||||||
if(referenceThing.Type == 1502 || referenceThing.Type == 1503)
|
if(referenceThing.DynamicLightType == 1502 || referenceThing.DynamicLightType == 1503)
|
||||||
firstArg = 0;
|
firstArg = 0;
|
||||||
|
|
||||||
//first slider is always used
|
//first slider is always used
|
||||||
|
@ -134,7 +134,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
colorPickerSlider1.OnValueChanged += OnSliderValueChanged;
|
colorPickerSlider1.OnValueChanged += OnSliderValueChanged;
|
||||||
|
|
||||||
//either both of them or none are used
|
//either both of them or none are used
|
||||||
if(Array.IndexOf(LIGHT_USES_ANGLE_VALUE, referenceThing.Type) != -1)
|
if(Array.IndexOf(LIGHT_USES_ANGLE_VALUE, referenceThing.DynamicLightType) != -1)
|
||||||
{
|
{
|
||||||
showAllControls = true;
|
showAllControls = true;
|
||||||
colorPickerSlider2.Label = typeInfo.Args[4].Title + ":";
|
colorPickerSlider2.Label = typeInfo.Args[4].Title + ":";
|
||||||
|
@ -170,13 +170,13 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
|
|
||||||
//size
|
//size
|
||||||
int firstArg = 3;
|
int firstArg = 3;
|
||||||
if(referenceThing.Type == 1502 || referenceThing.Type == 1503)
|
if(referenceThing.DynamicLightType == 1502 || referenceThing.DynamicLightType == 1503)
|
||||||
firstArg = 0;
|
firstArg = 0;
|
||||||
|
|
||||||
lightProps.PrimaryRadius = referenceThing.Args[firstArg];
|
lightProps.PrimaryRadius = referenceThing.Args[firstArg];
|
||||||
|
|
||||||
//either both of them or none are used
|
//either both of them or none are used
|
||||||
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, referenceThing.Type) != -1)
|
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, referenceThing.DynamicLightType) != -1)
|
||||||
{
|
{
|
||||||
lightProps.SecondaryRadius = referenceThing.Args[4];
|
lightProps.SecondaryRadius = referenceThing.Args[4];
|
||||||
lightProps.Interval = referenceThing.AngleDoom;
|
lightProps.Interval = referenceThing.AngleDoom;
|
||||||
|
@ -216,13 +216,13 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
//update color
|
//update color
|
||||||
if(colorChanged) //need this check to allow relative mode to work properly
|
if(colorChanged) //need this check to allow relative mode to work properly
|
||||||
{
|
{
|
||||||
if(t.Type == 1503) //Vavoom Light Color
|
if(t.DynamicLightType == 1503) //Vavoom Light Color
|
||||||
{
|
{
|
||||||
t.Args[1] = lightProps.Red;
|
t.Args[1] = lightProps.Red;
|
||||||
t.Args[2] = lightProps.Green;
|
t.Args[2] = lightProps.Green;
|
||||||
t.Args[3] = lightProps.Blue;
|
t.Args[3] = lightProps.Blue;
|
||||||
}
|
}
|
||||||
else if(t.Type != 1502) //vavoom light has no color settings
|
else if(t.DynamicLightType != 1502) //vavoom light has no color settings
|
||||||
{
|
{
|
||||||
t.Args[0] = lightProps.Red;
|
t.Args[0] = lightProps.Red;
|
||||||
t.Args[1] = lightProps.Green;
|
t.Args[1] = lightProps.Green;
|
||||||
|
@ -231,7 +231,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
}
|
}
|
||||||
|
|
||||||
int firstArg = 3;
|
int firstArg = 3;
|
||||||
if(t.Type == 1502 || t.Type == 1503) firstArg = 0;
|
if(t.DynamicLightType == 1502 || t.DynamicLightType == 1503) firstArg = 0;
|
||||||
|
|
||||||
//update radius and intensity
|
//update radius and intensity
|
||||||
if(RELATIVE_MODE)
|
if(RELATIVE_MODE)
|
||||||
|
@ -241,7 +241,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
t.Args[firstArg] = fixedVal.PrimaryRadius + lightProps.PrimaryRadius;
|
t.Args[firstArg] = fixedVal.PrimaryRadius + lightProps.PrimaryRadius;
|
||||||
if(t.Args[firstArg] < 0) t.Args[firstArg] = 0;
|
if(t.Args[firstArg] < 0) t.Args[firstArg] = 0;
|
||||||
|
|
||||||
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, t.Type) != -1)
|
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, t.DynamicLightType) != -1)
|
||||||
{
|
{
|
||||||
t.Args[4] = fixedVal.SecondaryRadius + lightProps.SecondaryRadius;
|
t.Args[4] = fixedVal.SecondaryRadius + lightProps.SecondaryRadius;
|
||||||
if(t.Args[4] < 0) t.Args[4] = 0;
|
if(t.Args[4] < 0) t.Args[4] = 0;
|
||||||
|
@ -254,7 +254,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
if(lightProps.PrimaryRadius != -1)
|
if(lightProps.PrimaryRadius != -1)
|
||||||
t.Args[firstArg] = lightProps.PrimaryRadius;
|
t.Args[firstArg] = lightProps.PrimaryRadius;
|
||||||
|
|
||||||
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, t.Type) != -1)
|
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, t.DynamicLightType) != -1)
|
||||||
{
|
{
|
||||||
t.Args[4] = lightProps.SecondaryRadius;
|
t.Args[4] = lightProps.SecondaryRadius;
|
||||||
t.Rotate(General.ClampAngle(lightProps.Interval));
|
t.Rotate(General.ClampAngle(lightProps.Interval));
|
||||||
|
@ -322,8 +322,8 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
//this is called only once
|
//this is called only once
|
||||||
private static Color GetThingColor(Thing thing)
|
private static Color GetThingColor(Thing thing)
|
||||||
{
|
{
|
||||||
if(thing.Type == 1502) return Color.White; //vavoom light
|
if(thing.DynamicLightType == 1502) return Color.White; //vavoom light
|
||||||
if(thing.Type == 1503) return Color.FromArgb((byte)thing.Args[1], (byte)thing.Args[2], (byte)thing.Args[3]); //vavoom colored light
|
if(thing.DynamicLightType == 1503) return Color.FromArgb((byte)thing.Args[1], (byte)thing.Args[2], (byte)thing.Args[3]); //vavoom colored light
|
||||||
return Color.FromArgb((byte)thing.Args[0], (byte)thing.Args[1], (byte)thing.Args[2]);
|
return Color.FromArgb((byte)thing.Args[0], (byte)thing.Args[1], (byte)thing.Args[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,11 +337,11 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows
|
||||||
Thing t = selection[i];
|
Thing t = selection[i];
|
||||||
LightProps lp = new LightProps();
|
LightProps lp = new LightProps();
|
||||||
int firstArg = 3;
|
int firstArg = 3;
|
||||||
if(t.Type == 1502 || t.Type == 1503) firstArg = 0;
|
if(t.DynamicLightType == 1502 || t.DynamicLightType == 1503) firstArg = 0;
|
||||||
lp.PrimaryRadius = t.Args[firstArg];
|
lp.PrimaryRadius = t.Args[firstArg];
|
||||||
|
|
||||||
//either both of them or none are used
|
//either both of them or none are used
|
||||||
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, t.Type) != -1)
|
if(showAllControls && Array.IndexOf(LIGHT_USES_ANGLE_VALUE, t.DynamicLightType) != -1)
|
||||||
{
|
{
|
||||||
lp.SecondaryRadius = t.Args[4];
|
lp.SecondaryRadius = t.Args[4];
|
||||||
lp.Interval = t.AngleDoom;
|
lp.Interval = t.AngleDoom;
|
||||||
|
|
Loading…
Reference in a new issue