From 864053c008e6f556cbca1c8c10d078e5f57dd5c1 Mon Sep 17 00:00:00 2001 From: MaxED Date: Fri, 22 Jan 2016 12:21:32 +0000 Subject: [PATCH] Fixed, Vertex Edit form: relative X/Y position values were applied incorrectly. Updated ZDoom ACC. Updated ZDoom_ACS.cfg. Updated ZDoom_DECORATE.cfg. --- Build/Compilers/ZDoom/zdefs.acs | 6 +++ Build/Compilers/ZDoom/zspecial.acs | 6 ++- Build/Scripting/ZDoom_ACS.cfg | 7 ++++ Build/Scripting/ZDoom_DECORATE.cfg | 1 + Source/Core/Windows/VertexEditForm.cs | 60 +++++++++++---------------- 5 files changed, 42 insertions(+), 38 deletions(-) diff --git a/Build/Compilers/ZDoom/zdefs.acs b/Build/Compilers/ZDoom/zdefs.acs index e5ea3b20..ac8fc815 100644 --- a/Build/Compilers/ZDoom/zdefs.acs +++ b/Build/Compilers/ZDoom/zdefs.acs @@ -958,6 +958,12 @@ #define SECF_NOFALLINGDAMAGE 2 #define SECF_FLOORDROP 4 #define SECF_NORESPAWN 8 +#define SECF_FRICTION 16 +#define SECF_PUSH 32 +#define SECF_SILENTMOVE 64 +#define SECF_DMGTERRAINFX 128 +#define SECF_DMGENDGODMODE 256 +#define SECF_DMGENDLEVEL 512 #define BLOCKF_CREATURES 1 #define BLOCKF_MONSTERS 2 diff --git a/Build/Compilers/ZDoom/zspecial.acs b/Build/Compilers/ZDoom/zspecial.acs index 023f1b3c..0030ff5c 100644 --- a/Build/Compilers/ZDoom/zspecial.acs +++ b/Build/Compilers/ZDoom/zspecial.acs @@ -337,8 +337,10 @@ special -91:QuakeEx(8,12), -92:Warp(6,11), -93:GetMaxInventory(2), - -94:SetSectorDamage(2,6), - + -94:SetSectorDamage(2,5), + -95:SetSectorTerrain(3), + -96:SpawnParticle(1,15), + // Zandronum's -100:ResetMap(0), -101:PlayerIsSpectator(1), diff --git a/Build/Scripting/ZDoom_ACS.cfg b/Build/Scripting/ZDoom_ACS.cfg index ea8a23b4..e932dad6 100644 --- a/Build/Scripting/ZDoom_ACS.cfg +++ b/Build/Scripting/ZDoom_ACS.cfg @@ -409,6 +409,7 @@ keywords Spawn = "int Spawn(str classname, fixed x, fixed y, fixed z[, int tid[, int angle]])\nSpawns an actor at the given X, Y and Z coordinates.\nOptionally a TID and a byte angle can be specified."; SpawnForced = "int SpawnForced(str classname, fixed x, fixed y, fixed z[, int tid[, int angle]])\nForces the actor to spawn, even in conditions where the spawning would normally fail.\nThe return value is the number of things spawned."; SpawnDecal = "int SpawnDecal(int tid, str decalname, int flags[, fixed angle = 0.0[, fixed zoffset = 0.0[, fixed distance = 64.0]]])\nCreates a decal on a wall by tracing a line from the actor with the\nspecified tid until hitting said wall, on which the decal is then created.\nIf tid is 0, the tracing is done from the activator of the script.\ndecalname: The name of the decal to create, as defined in DECALDEF.\nflags: use SDF_ flags\nThe return value of the function is the number of decals spawned."; + SpawnParticle = "void SpawnParticle(float offx, float offy, float offz, float velx, float vely, float velz, color color1, int lifetime[, bool fullbright = false[, float startalpha = 1.0[, int size = 1[, float fadestep = -1[, float accelx = 0[, float accely = 0[, float accelz = 0]]]]]]])"; SpawnProjectile = "void SpawnProjectile(int tid, str type, int angle, int speed, int vspeed, int gravity, int newtid)"; SpawnSpot = "int SpawnSpot(str classname, int spottid[, int tid[, int angle]])\nRequires a MapSpot at the location where you want the Actor to spawn.\nThe return value is the number of things spawned."; SpawnSpotFacing = "int SpawnSpotFacing(str classname, int spottid[, int tid])\nRequires a MapSpot at the location where you want the Actor to spawn.\nThe thing will assume the angle of the mapspot it is spawned to.\nThe return value is the number of things spawned."; @@ -954,10 +955,16 @@ constants SCROLL_AND_CARRY; SDF_ABSANGLE; SDF_PERMANENT; + SECF_DMGENDGODMODE; + SECF_DMGENDLEVEL; + SECF_DMGTERRAINFX; SECF_FLOORDROP; + SECF_FRICTION; SECF_NOFALLINGDAMAGE; SECF_NORESPAWN; + SECF_PUSH; SECF_SILENT; + SECF_SILENTMOVE; SECSEQ_CEILING; SECSEQ_FLOOR; SECSEQ_FULLHEIGHT; diff --git a/Build/Scripting/ZDoom_DECORATE.cfg b/Build/Scripting/ZDoom_DECORATE.cfg index 6f302555..712c31a8 100644 --- a/Build/Scripting/ZDoom_DECORATE.cfg +++ b/Build/Scripting/ZDoom_DECORATE.cfg @@ -120,6 +120,7 @@ keywords A_SpawnDebris = "A_SpawnDebris(str type[, bool translation = false[, float horizontal_vel = 1.0[, float vertical_vel = 1.0]]])"; A_SpawnItem = "A_SpawnItem(str type, int distance, float zpos, bool useammo, bool translation)"; A_SpawnItemEx = "A_SpawnItemEx(str type[, float xoffset = 0.0[, float yoffset = 0.0[, float zoffset = 0.0[, float xvelocity = 0.0[, float yvelocity = 0.0[, float zvelocity = 0.0[, float angle = 0.0[, int flags = 0[, int skipchance = 0[, int tid = 0]]]]]]]]]])"; + A_SpawnParticle = "A_SpawnParticle(float offx, float offy, float offz, float velx, float vely, float velz, color color1, int lifetime[, bool fullbright = false[, float startalpha = 1.0[, int size = 1[, float fadestep = -1[, float accelx = 0[, float accely = 0[, float accelz = 0]]]]]]])"; //State jumps A_CheckBlock = "A_CheckBlock(str block[, int flags = 0[, int pointer = AAPTR_TARGET]])"; A_CheckCeiling = "A_CheckCeiling(int offset OR str state)"; diff --git a/Source/Core/Windows/VertexEditForm.cs b/Source/Core/Windows/VertexEditForm.cs index ff5306e8..3630163a 100644 --- a/Source/Core/Windows/VertexEditForm.cs +++ b/Source/Core/Windows/VertexEditForm.cs @@ -211,32 +211,26 @@ namespace CodeImp.DoomBuilder.Windows { if(preventchanges) return; MakeUndo(); - int i = 0; - //restore values + // Restore values if(string.IsNullOrEmpty(positionx.Text)) { // Apply position + int i = 0; foreach(Vertex v in vertices) v.Move(new Vector2D(vertexprops[i++].X, v.Position.y)); - } - else //update values + } + // Update values + else { - // Verify the coordinates - float px = positionx.GetResultFloat(vertexprops[i].X); - if(px < General.Map.FormatInterface.MinCoordinate) + int i = 0; + foreach(Vertex v in vertices) { - positionx.Text = General.Map.FormatInterface.MinCoordinate.ToString(); - return; - } - - if(px > General.Map.FormatInterface.MaxCoordinate) - { - positionx.Text = General.Map.FormatInterface.MaxCoordinate.ToString(); - return; - } + // Verify the coordinates + float px = positionx.GetResultFloat(vertexprops[i++].X); - // Apply position - foreach(Vertex v in vertices) v.Move(new Vector2D(px, v.Position.y)); + // Apply new position + v.Move(new Vector2D(Math.Max(General.Map.FormatInterface.MinCoordinate, Math.Min(General.Map.FormatInterface.MaxCoordinate, px)), v.Position.y)); + } } General.Map.IsChanged = true; @@ -247,32 +241,26 @@ namespace CodeImp.DoomBuilder.Windows { if(preventchanges) return; MakeUndo(); - int i = 0; - //restore values + // Restore values if(string.IsNullOrEmpty(positiony.Text)) { // Apply position + int i = 0; foreach(Vertex v in vertices) v.Move(new Vector2D(v.Position.x, vertexprops[i++].Y)); - } - else //update values + } + // Update values + else { - // Verify the coordinates - float py = positiony.GetResultFloat(vertexprops[i].Y); - if(py < General.Map.FormatInterface.MinCoordinate) + int i = 0; + foreach(Vertex v in vertices) { - positiony.Text = General.Map.FormatInterface.MinCoordinate.ToString(); - return; - } - - if(py > General.Map.FormatInterface.MaxCoordinate) - { - positiony.Text = General.Map.FormatInterface.MaxCoordinate.ToString(); - return; - } + // Verify the coordinates + float py = positiony.GetResultFloat(vertexprops[i++].Y); - // Apply position - foreach(Vertex v in vertices) v.Move(new Vector2D(v.Position.x, py)); + // Apply new position + v.Move(new Vector2D(v.Position.x, Math.Max(General.Map.FormatInterface.MinCoordinate, Math.Min(General.Map.FormatInterface.MaxCoordinate, py)))); + } } General.Map.IsChanged = true;