Linedef flags were not translated properly when a map format was changed to/from UDMF.

Linedef colors were not updated properly when a map format was changed and were causing an exception in some cases.
Vertices mode: linedef in split linedefs range was redreawn incorrectly in some cases.
Updated "Sector 3D Floor" (160) action: set default Type to Solid (1), added "Use Arg5 as Line ID" flag to Types, changed arg5 name to "Line ID / Hi-Tag".
Added "GetUserCVar", "SetCVar" and "SetUserCVar" functions to ACS configuration.
Set width and height of several actors to 0 in game configutrations (non-zero sizes were added as a workaround when GZDB was not displaying actors with 0 width and height in Visual mode).
Added several sprites to game configurations.
This commit is contained in:
MaxED 2013-05-27 12:20:15 +00:00
parent ae8780f4ea
commit 7f6c6a1122
12 changed files with 77 additions and 32 deletions

View file

@ -4,8 +4,8 @@ boom
color = 8; // Grey
arrow = 1;
title = "Boom Items";
width = 8;
height = 16;
width = 0;
height = 0;
sort = 1;
fixedsize = true;

View file

@ -25,8 +25,8 @@ eternity
color = 8; // Grey
arrow = 1;
title = "Eternity";
width = 10;
height = 20;
width = 0;
height = 0;
sort = 1;
fixedsize = true;
sprite = "internal:arrow";

View file

@ -6,8 +6,8 @@ gzdoom_lights
arrow = 0;
title = "Dynamic Lights";
sort = 1;
width = 8;
height = 16;
width = 0;
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;

View file

@ -1463,10 +1463,12 @@ sounds
color = 5; // Purple
arrow = 1;
title = "Sounds";
width = 0;
width = 8;
height = 16;
sort = 1;
fixedsize = true;
blocking = 0;
sprite = "internal:sound";
1403 = "Creak";
1408 = "Earth Crack";
@ -1487,9 +1489,11 @@ other
arrow = 1;
title = "Other";
width = 0;
height = 0;
sort = 1;
fixedsize = true;
blocking = 0;
sprite = "internal:actor";
118
{

View file

@ -350,6 +350,16 @@ mapformat_udmf
include("UDMF_misc.cfg", "linedefactivations");
include("ZDoom_misc.cfg", "linedefactivations_udmf");
}
//mxd. Linedef flags UDMF translation table
// This is needed for copy/paste and prefabs to work properly
// When the UDMF field name is prefixed with ! it is inverted
linedefflagstranslation
{
include("Doom_misc.cfg", "linedefflagstranslation");
include("Hexen_misc.cfg", "linedefflagstranslation");
include("ZDoom_misc.cfg", "linedefflagstranslation");
}
// THING FLAGS
thingflags

View file

@ -2888,9 +2888,11 @@ zdoom
2 = "Swimmable";
3 = "Non-Solid";
4 = "Render-Inside";
8 = "Use Arg5 as Line ID";
16 = "Invert Visibility Rules";
32 = "Invert Shootability Rules";
}
default = 1;
}
arg2
{
@ -2914,7 +2916,7 @@ zdoom
}
arg4
{
title = "Hi-Tag";
title = "Line ID / Hi-Tag";
}
}
161

View file

@ -332,8 +332,8 @@ zdoom
color = 7; // Light Grey
arrow = 1;
title = "Cameras and Interpolation";
width = 8;
height = 16;
width = 0;
height = 0;
sort = 1;
hangs = 0;
blocking = 0;
@ -611,13 +611,13 @@ zdoom
color = 8; // Grey
arrow = 0;
title = "Slopes";
width = 8;
width = 0;
sort = 1;
height = 16;
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
sprite = "internal:slope";
sprite = "internal:slope";
9511
{
@ -834,9 +834,9 @@ zdoom
color = 7;
arrow = 0;
title = "Portals";
width = 8;
width = 0;
sort = 1;
height = 16;
height = 0;
hangs = 0;
blocking = 0;
fixedsize = true;
@ -1105,6 +1105,7 @@ doom
height = 56;
hangs = 0;
blocking = 0;
sprite = "PLAYA2A8";
9100 = "Scripted Marine";
9101 = "Marine Fist";

View file

@ -197,6 +197,7 @@ keywords
GetThingUDMFInt = "GetThingUDMFInt(tid, fieldname)";
GetThingUDMFFixed = "GetThingUDMFFixed(tid, fieldname)";
GetUserArray = "GetUserArray(tid, name, pos)";
GetUserCVar = "int GetUserCVar(int playernum, string cvarname)";
GetUserVariable = "GetUserVariable(tid, name)";
GiveActorInventory = "GiveActorInventory(tid, type, amount)";
GiveInventory = "GiveInventory(type, amount)";
@ -309,6 +310,7 @@ keywords
SetAirSupply = "SetAirSupply(playernumber, tics)";
SetCameraToTexture = "SetCameraToTexture(tag, texture, fov)";
SetCeilingTrigger = "SetCeilingTrigger(tag, height, special, arg1, arg2, arg3, arg4, arg5)";
SetCVar = "bool SetCVar(string cvarname, int newvalue)";
SetFloorTrigger = "SetFloorTrigger(tag, height, special, arg1, arg2, arg3, arg4, arg5)";
SetFont = "SetFont(fontname)";
SetGravity = "SetGravity(amount)";
@ -326,6 +328,7 @@ keywords
SetResultValue = "SetResultValue(value)";
SetSkyScrollSpeed = "SetSkyScrollSpeed(skynumber, speed)";
SetThingSpecial = "SetThingSpecial(tid, special, arg1, arg2, arg3, arg4, arg5)";
SetUserCVar = "bool SetUserCVar(int playernum, string cvarname, int newvalue)";
SetWeapon = "SetWeapon(weaponname)";
sin = "sin(angle)";
SoundSequence = "SoundSequence(sndseq)";

BIN
Build/Sprites/Actor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

View file

@ -1602,6 +1602,7 @@ namespace CodeImp.DoomBuilder {
// Load new game configuration
General.WriteLogLine("Loading game configuration...");
configinfo = General.GetConfigurationInfo(options.ConfigFile);
string oldFormatInterface = config.FormatInterface; //mxd
config = new GameConfiguration(General.LoadGameConfiguration(options.ConfigFile));
configinfo.ApplyDefaults(config);
General.Editing.UpdateCurrentEditModes();
@ -1616,6 +1617,19 @@ namespace CodeImp.DoomBuilder {
// Let the plugins know
General.Plugins.MapReconfigure();
//mxd. Update linedef color presets and flags if required
if(General.Map != null && General.Map.Map != null) {
if(oldFormatInterface == "UniversalMapSetIO" && config.FormatInterface != "UniversalMapSetIO") {
foreach(Linedef l in General.Map.Map.Linedefs) l.TranslateFromUDMF();
foreach(Thing t in General.Map.Map.Things) t.TranslateFromUDMF();
} else if(oldFormatInterface != "UniversalMapSetIO" && config.FormatInterface == "UniversalMapSetIO") {
foreach(Linedef l in General.Map.Map.Linedefs) l.TranslateToUDMF();
foreach(Thing t in General.Map.Map.Things) t.TranslateToUDMF();
}
General.Map.Map.UpdateCustomLinedefColors();
}
// Update interface
General.MainWindow.SetupInterface();
General.MainWindow.UpdateThingsFilters();

View file

@ -64,7 +64,6 @@ namespace CodeImp.DoomBuilder.Map
private float lengthinv;
private float angle;
private RectangleF rect;
//private bool blocksoundflag;
private bool impassableflag;
// Properties
@ -104,9 +103,7 @@ namespace CodeImp.DoomBuilder.Map
internal int SerializedIndex { get { return serializedindex; } set { serializedindex = value; } }
internal bool FrontInterior { get { return frontinterior; } set { frontinterior = value; } }
internal bool ImpassableFlag { get { return impassableflag; } }
//internal bool BlockSoundFlag { get { return blocksoundflag; } }
//mxd
internal int ColorPresetIndex { get { return colorPresetIndex; } }
internal int ColorPresetIndex { get { return colorPresetIndex; } } //mxd
#endregion
@ -377,7 +374,6 @@ namespace CodeImp.DoomBuilder.Map
rect = new RectangleF(l, t, r - l, b - t);
// Cached flags
//blocksoundflag = IsFlagSet(General.Map.Config.SoundLinedefFlag); //mxd
impassableflag = IsFlagSet(General.Map.Config.ImpassableFlag);
//mxd. Color preset
@ -427,6 +423,9 @@ namespace CodeImp.DoomBuilder.Map
flags[f.Fields[i]] = !f.FieldValues[i];
}
}
//mxd. Update cached flags
impassableflag = IsFlagSet(General.Map.Config.ImpassableFlag);
}
// This translates UDMF fields back into the normal flags and activations
@ -499,6 +498,9 @@ namespace CodeImp.DoomBuilder.Map
}
if(foundactivation) break;
}
//mxd. Update cached flags
impassableflag = IsFlagSet(General.Map.Config.ImpassableFlag);
}
// Selected

View file

@ -171,14 +171,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(renderer.StartPlotter(false))
{
// Undraw previous highlight
if((highlighted != null) && !highlighted.IsDisposed)
if(highlighted != null && !highlighted.IsDisposed)
renderer.PlotVertex(highlighted, renderer.DetermineVertexColor(highlighted));
// Set new highlight
highlighted = v;
// Render highlighted item
if((highlighted != null) && !highlighted.IsDisposed)
if(highlighted != null && !highlighted.IsDisposed)
renderer.PlotVertex(highlighted, ColorCollection.HIGHLIGHT);
// Done
@ -200,8 +200,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Undraw previous highlight
if((highlightedLine != null) && !highlightedLine.IsDisposed) {
renderer.PlotLinedef(highlightedLine, renderer.DetermineLinedefColor(highlightedLine));
renderer.PlotVertex(highlightedLine.Start, renderer.DetermineVertexColor(highlightedLine.Start));
renderer.PlotVertex(highlightedLine.End, renderer.DetermineVertexColor(highlightedLine.End));
if(highlighted == null) {
renderer.PlotVertex(highlightedLine.Start, renderer.DetermineVertexColor(highlightedLine.Start));
renderer.PlotVertex(highlightedLine.End, renderer.DetermineVertexColor(highlightedLine.End));
}
}
// Set new highlight
@ -210,8 +213,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Render highlighted item
if((highlightedLine != null) && !highlightedLine.IsDisposed) {
renderer.PlotLinedef(highlightedLine, General.Colors.InfoLine);
renderer.PlotVertex(highlightedLine.Start, renderer.DetermineVertexColor(highlightedLine.Start));
renderer.PlotVertex(highlightedLine.End, renderer.DetermineVertexColor(highlightedLine.End));
if(highlighted != null && !highlighted.IsDisposed) {
renderer.PlotVertex(highlightedLine.Start, highlightedLine.Start == highlighted ? ColorCollection.HIGHLIGHT : renderer.DetermineVertexColor(highlightedLine.Start));
renderer.PlotVertex(highlightedLine.End, highlightedLine.End == highlighted ? ColorCollection.HIGHLIGHT : renderer.DetermineVertexColor(highlightedLine.End));
}else{
renderer.PlotVertex(highlightedLine.Start, renderer.DetermineVertexColor(highlightedLine.Start));
renderer.PlotVertex(highlightedLine.End, renderer.DetermineVertexColor(highlightedLine.End));
}
}
// Done
@ -450,18 +459,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
else if(e.Button == MouseButtons.None) // Not holding any buttons?
{
// Find the nearest vertex within highlight range
Vertex v = General.Map.Map.NearestVertexSquareRange(mousemappos, BuilderPlug.Me.HighlightRange / renderer.Scale);
// Highlight if not the same
if(v != highlighted) Highlight(v);
//mxd
// Find the nearest linedef within split linedefs range
Linedef l = General.Map.Map.NearestLinedefRange(mousemappos, BuilderPlug.Me.SplitLinedefsRange / renderer.Scale);
// Highlight if not the same
if(l != highlightedLine) HighlightLine(l);
// Find the nearest vertex within highlight range
Vertex v = General.Map.Map.NearestVertexSquareRange(mousemappos, BuilderPlug.Me.HighlightRange / renderer.Scale);
// Highlight if not the same
if(v != highlighted) Highlight(v);
}
}