diff --git a/Build/Configurations/Includes/Boom_linedefs.cfg b/Build/Configurations/Includes/Boom_linedefs.cfg index 7bcd7cebdc36ba211da535274ae4e8e91aeadaa7..4dc23805053899d9b43d8ca1b7f5a54502fb68e6 100644 --- a/Build/Configurations/Includes/Boom_linedefs.cfg +++ b/Build/Configurations/Includes/Boom_linedefs.cfg @@ -107,7 +107,8 @@ floor 213 { - title = "Floor Change Brightness to this Brightness"; + title = "Change Floor Brightness to this Brightness"; + id = "Boom_Transfer_FloorLight"; prefix = ""; } @@ -641,7 +642,8 @@ ceiling 261 { - title = "Ceiling Brightness to this Brightness"; + title = "Change Ceiling Brightness to this Brightness"; + id = "Boom_Transfer_CeilingLight"; prefix = ""; } } diff --git a/Build/Scripting/ZDoom_ACS.cfg b/Build/Scripting/ZDoom_ACS.cfg index d808289b0e12e21984570c6ee8bba39e778bd07c..3bdd403adfb7f81a482979ba98c65139ddb3d863 100644 --- a/Build/Scripting/ZDoom_ACS.cfg +++ b/Build/Scripting/ZDoom_ACS.cfg @@ -551,6 +551,7 @@ constants APROP_Damage; APROP_DamageFactor; APROP_DamageMultiplier; + APROP_DamageType; APROP_DeathSound; APROP_Dormant; APROP_Dropped; diff --git a/Build/Scripting/ZDoom_DECORATE.cfg b/Build/Scripting/ZDoom_DECORATE.cfg index db7c0c9e644d2a9377bbad34ae88871d021e82eb..8c316998e92d82ccec4bacbf81a4b81cb7781106 100644 --- a/Build/Scripting/ZDoom_DECORATE.cfg +++ b/Build/Scripting/ZDoom_DECORATE.cfg @@ -1189,6 +1189,7 @@ constants DMSS_EXFILTER; DMSS_EXSPECIES; DMSS_EITHER; + DMSS_INFLICTORDMGTYPE; FMDF_NOPITCH; FMDF_NOANGLE; FMDF_INTERPOLATE; diff --git a/Source/Core/Data/Scripting/AccScriptHandler.cs b/Source/Core/Data/Scripting/AccScriptHandler.cs index fc0d6b004a63c9c193e46f2a848ef48c1e619c66..0b851e2cd69bad22a6e172b506f04fab5bfc53ef 100644 --- a/Source/Core/Data/Scripting/AccScriptHandler.cs +++ b/Source/Core/Data/Scripting/AccScriptHandler.cs @@ -25,7 +25,7 @@ namespace CodeImp.DoomBuilder.Data.Scripting target.Items.Clear(); AcsParserSE parser = new AcsParserSE { AddArgumentsToScriptNames = true, IsMapScriptsLump = tab is ScriptLumpDocumentTab, IgnoreErrors = true }; - DataLocation dl = new DataLocation(DataLocation.RESOURCE_DIRECTORY, Path.GetDirectoryName(tab.Filename), false, false, false); + DataLocation dl = new DataLocation(DataLocation.RESOURCE_DIRECTORY, Path.GetDirectoryName(string.IsNullOrEmpty(tab.Filename)? tab.Title : tab.Filename), false, false, false); TextResourceData data = new TextResourceData(stream, dl, (parser.IsMapScriptsLump ? "?SCRIPTS" : tab.Filename), false); if(parser.Parse(data, false)) diff --git a/Source/Core/Geometry/Tools.cs b/Source/Core/Geometry/Tools.cs index 8be3b259871b96bf2e45fa268abd1580a5bebcc2..e897a31795250887567276749e002e43e8e2058d 100644 --- a/Source/Core/Geometry/Tools.cs +++ b/Source/Core/Geometry/Tools.cs @@ -2314,8 +2314,12 @@ namespace CodeImp.DoomBuilder.Geometry { foreach(Linedef l in frontlines) { - l.FlipVertices(); - l.FlipSidedefs(); + // Skip single-sided lines with only front side + if(l.Back != null) + { + l.FlipVertices(); + l.FlipSidedefs(); + } } } } diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs index 9ac625327504666d3e866d2dc1c211e1d28819ab..6fd42b5ee7632e4e7597148548455d8c81c82c8f 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs @@ -2524,13 +2524,13 @@ namespace CodeImp.DoomBuilder.BuilderModes // Make undo if(selected.Count > 1) { - General.Map.UndoRedo.CreateUndo("Align linedefs of " + selected.Count + " sectors"); - General.Interface.DisplayStatus(StatusType.Action, "Aligned linedefs of " + selected.Count + "sectors."); + General.Map.UndoRedo.CreateUndo("Flip linedefs of " + selected.Count + " sectors"); + General.Interface.DisplayStatus(StatusType.Action, "Flipped linedefs of " + selected.Count + "sectors."); } else { - General.Map.UndoRedo.CreateUndo("Align sector linedefs"); - General.Interface.DisplayStatus(StatusType.Action, "Aligned sector linedefs."); + General.Map.UndoRedo.CreateUndo("Flip sector linedefs"); + General.Interface.DisplayStatus(StatusType.Action, "Flipped sector linedefs."); } HashSet<Linedef> selectedlines = new HashSet<Linedef>(); @@ -2538,7 +2538,9 @@ namespace CodeImp.DoomBuilder.BuilderModes { foreach(Sidedef side in s.Sidedefs) { - if(!selectedlines.Contains(side.Line)) selectedlines.Add(side.Line); + // Skip single-sided lines with only front side + if(!selectedlines.Contains(side.Line) && (side.Line.Back != null || side.Line.Front == null)) + selectedlines.Add(side.Line); } } diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 33af459b0f6e239ccc0405c71eb58ffc80668c9c..88ae06980a47be669bd01a988993f265fcd50777 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -745,19 +745,15 @@ namespace CodeImp.DoomBuilder.BuilderModes // This requires that the blockmap is up-to-date! internal void RebuildElementData() { - //mxd - Sector[] sectorsWithEffects = null; + HashSet<Sector> effectsectors = null; //mxd - if(!General.Settings.GZDoomRenderingEffects) + if(!General.Settings.GZDoomRenderingEffects) //mxd { - //store all sectors with effects + // Store all sectors with effects if(sectordata != null && sectordata.Count > 0) - { - sectorsWithEffects = new Sector[sectordata.Count]; - sectordata.Keys.CopyTo(sectorsWithEffects, 0); - } + effectsectors = new HashSet<Sector>(sectordata.Keys); - //remove all vertex handles from selection + // Remove all vertex handles from selection if(vertices != null && vertices.Count > 0) { foreach(IVisualEventReceiver i in selectedobjects) @@ -771,17 +767,16 @@ namespace CodeImp.DoomBuilder.BuilderModes sectordata = new Dictionary<Sector, SectorData>(General.Map.Map.Sectors.Count); thingdata = new Dictionary<Thing, ThingData>(General.Map.Map.Things.Count); - //mxd. rebuild all sectors with effects - if(sectorsWithEffects != null) + //mxd. Rebuild all sectors with effects + if(effectsectors != null) { - for(int i = 0; i < sectorsWithEffects.Length; i++) + foreach(Sector s in effectsectors) { + if(!VisualSectorExists(s)) continue; + // The visual sector associated is now outdated - if(VisualSectorExists(sectorsWithEffects[i])) - { - BaseVisualSector vs = (BaseVisualSector)GetVisualSector(sectorsWithEffects[i]); - vs.UpdateSectorGeometry(true); - } + BaseVisualSector vs = (BaseVisualSector)GetVisualSector(s); + vs.UpdateSectorGeometry(true); } } @@ -793,7 +788,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(!General.Settings.GZDoomRenderingEffects) return; //mxd - // Find all sector who's tag is not 0 and hash them so that we can find them quicly + // Find all sector who's tag is not 0 and hash them so that we can find them quickly foreach(Sector s in General.Map.Map.Sectors) { foreach(int tag in s.Tags) @@ -852,10 +847,13 @@ namespace CodeImp.DoomBuilder.BuilderModes // Find interesting linedefs (such as line slopes) foreach(Linedef l in General.Map.Map.Linedefs) { - switch(l.Action) + //mxd. Rewritten to use action ID instead of number + if(l.Action == 0 || !General.Map.Config.LinedefActions.ContainsKey(l.Action)) continue; + + switch(General.Map.Config.LinedefActions[l.Action].Id.ToLowerInvariant()) { - // ========== Plane Align (see http://zdoom.org/wiki/Plane_Align) ========== - case 181: + // ========== Plane Align (181) (see http://zdoom.org/wiki/Plane_Align) ========== + case "plane_align": if(((l.Args[0] == 1) || (l.Args[1] == 1)) && (l.Front != null)) { SectorData sd = GetSectorData(l.Front.Sector); @@ -868,8 +866,8 @@ namespace CodeImp.DoomBuilder.BuilderModes } break; - // ========== Plane Copy (mxd) (see http://zdoom.org/wiki/Plane_Copy) ========== - case 118: + // ========== Plane Copy (118) (mxd) (see http://zdoom.org/wiki/Plane_Copy) ========== + case "plane_copy": { //check the flags... bool floorCopyToBack = false; @@ -907,8 +905,8 @@ namespace CodeImp.DoomBuilder.BuilderModes } break; - // ========== Sector 3D floor (see http://zdoom.org/wiki/Sector_Set3dFloor) ========== - case 160: + // ========== Sector 3D floor (160) (see http://zdoom.org/wiki/Sector_Set3dFloor) ========== + case "sector_set3dfloor": if(l.Front != null) { //mxd. Added hi-tag/line ID check @@ -925,8 +923,8 @@ namespace CodeImp.DoomBuilder.BuilderModes } break; - // ========== Transfer Brightness (see http://zdoom.org/wiki/ExtraFloor_LightOnly) ========= - case 50: + // ========== Transfer Brightness (50) (see http://zdoom.org/wiki/ExtraFloor_LightOnly) ========= + case "extrafloor_lightonly": if(l.Front != null && sectortags.ContainsKey(l.Args[0])) { List<Sector> sectors = sectortags[l.Args[0]]; @@ -938,8 +936,8 @@ namespace CodeImp.DoomBuilder.BuilderModes } break; - // ========== mxd. Transfer Floor Brightness (see http://www.zdoom.org/w/index.php?title=Transfer_FloorLight) ========= - case 210: + // ========== mxd. Transfer Floor Brightness (210) (see http://www.zdoom.org/w/index.php?title=Transfer_FloorLight) ========= + case "transfer_floorlight": if(l.Front != null && sectortags.ContainsKey(l.Args[0])) { List<Sector> sectors = sectortags[l.Args[0]]; @@ -951,8 +949,8 @@ namespace CodeImp.DoomBuilder.BuilderModes } break; - // ========== mxd. Transfer Ceiling Brightness (see http://www.zdoom.org/w/index.php?title=Transfer_CeilingLight) ========= - case 211: + // ========== mxd. Transfer Ceiling Brightness (211) (see http://www.zdoom.org/w/index.php?title=Transfer_CeilingLight) ========= + case "transfer_ceilinglight": if(l.Front != null && sectortags.ContainsKey(l.Args[0])) { List<Sector> sectors = sectortags[l.Args[0]]; @@ -963,10 +961,37 @@ namespace CodeImp.DoomBuilder.BuilderModes } } break; + + // ========== mxd. BOOM: Set Tagged Floor Lighting to Lighting on 1st Sidedef's Sector (213) ========= + case "boom_transfer_floorlight": + if(l.Front != null && sectortags.ContainsKey(l.Tag)) + { + List<Sector> sectors = sectortags[l.Tag]; + foreach(Sector s in sectors) + { + SectorData sd = GetSectorData(s); + sd.AddEffectTransferFloorBrightness(l); + } + } + break; + + // ========== mxd. BOOM: Set Tagged Ceiling Lighting to Lighting on 1st Sidedef's Sector (261) ========= + case "boom_transfer_ceilinglight": + if(l.Front != null && sectortags.ContainsKey(l.Tag)) + { + List<Sector> sectors = sectortags[l.Tag]; + foreach(Sector s in sectors) + { + SectorData sd = GetSectorData(s); + sd.AddEffectTransferCeilingBrightness(l); + } + } + break; } } // Find interesting things (such as sector slopes) + //TODO: rewrite using classnames instead of numbers foreach(Thing t in General.Map.Map.Things) { switch(t.Type)