From 43dc3c13b6c3ac694227e59e83b50534c031ff3e Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 8 Jun 2016 21:07:51 +0100 Subject: [PATCH 1/4] Fixed @ resolution --- VMFInstanceInserter/VMFStructure.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/VMFInstanceInserter/VMFStructure.cs b/VMFInstanceInserter/VMFStructure.cs index c4db67e..d157edb 100644 --- a/VMFInstanceInserter/VMFStructure.cs +++ b/VMFInstanceInserter/VMFStructure.cs @@ -282,14 +282,18 @@ private static TransformType ParseTransformType(String str) private static String FixupName(String name, TargetNameFixupStyle fixupStyle, String targetName) { - if (fixupStyle == TargetNameFixupStyle.None || targetName == null || name.StartsWith("@") || name.StartsWith("!")) - return name; + if (name.StartsWith("@")) + { // undocumented ! behaviour || name.StartsWith("!")) { + return name.Substring(1); + } + else if (targetName == null) return name; - switch (fixupStyle) { + switch (fixupStyle) + { case TargetNameFixupStyle.Postfix: - return name + targetName; + return name + '-' + targetName; case TargetNameFixupStyle.Prefix: - return targetName + name; + return targetName + '-' + name; default: return name; } From 064a2c960ffba1790be1ee1c3d06b9be93314a33 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 8 Jun 2016 22:28:28 +0100 Subject: [PATCH 2/4] Fixed Connections not getting name fixups when a replacement was made --- VMFInstanceInserter/VMFStructure.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VMFInstanceInserter/VMFStructure.cs b/VMFInstanceInserter/VMFStructure.cs index d157edb..66cf5db 100644 --- a/VMFInstanceInserter/VMFStructure.cs +++ b/VMFInstanceInserter/VMFStructure.cs @@ -372,7 +372,7 @@ private VMFStructure(VMFStructure clone, int idOffset, int nodeOffset, TargetNam } if (Type == VMFStructureType.Connections) { - if (fixup && fixupStyle != TargetNameFixupStyle.None && targetName != null) { + if (fixupStyle != TargetNameFixupStyle.None && targetName != null) { String[] split = kvClone.Value.String.Split(','); split[0] = FixupName(split[0], fixupStyle, targetName); if (stInputsDict.ContainsKey(split[1])) { From 9f4602a2e8ea361dfe4c70beb8cc816b85351e8c Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 21 Jun 2016 22:08:10 +0100 Subject: [PATCH 3/4] Added back in !targets --- VMFInstanceInserter/VMFStructure.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/VMFInstanceInserter/VMFStructure.cs b/VMFInstanceInserter/VMFStructure.cs index 66cf5db..3451dfb 100644 --- a/VMFInstanceInserter/VMFStructure.cs +++ b/VMFInstanceInserter/VMFStructure.cs @@ -282,12 +282,8 @@ private static TransformType ParseTransformType(String str) private static String FixupName(String name, TargetNameFixupStyle fixupStyle, String targetName) { - if (name.StartsWith("@")) - { // undocumented ! behaviour || name.StartsWith("!")) { - return name.Substring(1); - } - else if (targetName == null) return name; - + if (targetName == null || name.StartsWith("!") return name; + else if (name.StartsWith("@")) return name.Substring(1); switch (fixupStyle) { case TargetNameFixupStyle.Postfix: From e1b543df1f80d61731fb7665c0ff0b026eb74642 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 21 Jun 2016 22:09:13 +0100 Subject: [PATCH 4/4] missing bracket added back --- VMFInstanceInserter/VMFStructure.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VMFInstanceInserter/VMFStructure.cs b/VMFInstanceInserter/VMFStructure.cs index 3451dfb..84c850c 100644 --- a/VMFInstanceInserter/VMFStructure.cs +++ b/VMFInstanceInserter/VMFStructure.cs @@ -282,7 +282,7 @@ private static TransformType ParseTransformType(String str) private static String FixupName(String name, TargetNameFixupStyle fixupStyle, String targetName) { - if (targetName == null || name.StartsWith("!") return name; + if (targetName == null || name.StartsWith("!")) return name; else if (name.StartsWith("@")) return name.Substring(1); switch (fixupStyle) {