From 18af297d9d49efc79d1082c8b9c4e8cb2af2ae3e Mon Sep 17 00:00:00 2001 From: MaxED Date: Thu, 6 Aug 2015 21:54:15 +0000 Subject: [PATCH] Added, Things mode: target tags are now automatically assigned when duplicating (shift-dragging) PatrolPoints and InterpolationPoints. Fixed, ThingsMode: fixed highlighted thing disappearing when using paste action while highlighting a thing. --- .../BuilderModes/ClassicModes/ThingsMode.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs index a43d97e9..674ff7c6 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs @@ -566,6 +566,30 @@ namespace CodeImp.DoomBuilder.BuilderModes { Thing clone = InsertThing(t.Position); t.CopyPropertiesTo(clone); + + // If the cloned item is an interpolation point or patrol point, then insert the point in the path + ThingTypeInfo info = General.Map.Data.GetThingInfo(t.Type); + int nextpointtagargnum = -1; + + // Thing type can be changed in MAPINFO DoomEdNums block... + switch (info.ClassName.ToLowerInvariant()) + { + case "interpolationpoint": + nextpointtagargnum = 3; + break; + + case "patrolpoint": + nextpointtagargnum = 0; + break; + } + + // Apply changes? + if(nextpointtagargnum != -1) + { + if(t.Tag == 0) t.Tag = General.Map.Map.GetNewTag(); + t.Args[nextpointtagargnum] = clone.Tag = General.Map.Map.GetNewTag(); + } + t.Selected = false; clone.Selected = true; } @@ -682,6 +706,14 @@ namespace CodeImp.DoomBuilder.BuilderModes return base.OnCopyBegin(); } + //mxd. Needs more highlight management... + public override bool OnPasteBegin(PasteOptions options) + { + bool result = base.OnPasteBegin(options); + if(result && highlighted != null) highlighted.Highlighted = false; + return result; + } + //mxd public override void UpdateSelectionInfo() {