From 8ac3ffda680383a52ca73192dd4f9a1f7d8fe750 Mon Sep 17 00:00:00 2001 From: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:07:50 +0100 Subject: [PATCH] Fixes some more script issues --- tools/SnakeCaseUpdate/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/SnakeCaseUpdate/Program.cs b/tools/SnakeCaseUpdate/Program.cs index baea0f17bd181..5f0099a90c774 100644 --- a/tools/SnakeCaseUpdate/Program.cs +++ b/tools/SnakeCaseUpdate/Program.cs @@ -8,7 +8,8 @@ static string ToSnakeCase(string name) static bool UpdateFile(string filePath, string oldName, string newName) { var text = File.ReadAllText(filePath); - var updated = Regex.Replace(text, $@"\b{Regex.Escape(oldName)}\(", $"{newName}(", RegexOptions.Multiline); + var updated = Regex.Replace(text, $@"[^/]{Regex.Escape(oldName)}\(", $"{newName}(", RegexOptions.Multiline); + updated = Regex.Replace(text, $@"_REF\({Regex.Escape(oldName)}\)", @$"REF\({newName}\)", RegexOptions.Multiline); if (updated == text) return false; File.WriteAllText(filePath, updated); @@ -43,8 +44,11 @@ static bool UpdateFile(string filePath, string oldName, string newName) var funcName = match.Groups[1].Value; // Fine... you get the right to live - if (funcName == "Initialize" || funcName == "Destroy" || funcName == "Entered" || funcName == "Exited" || funcName == "Animate") + if (funcName == "Initialize" || funcName == "Destroy" || funcName == "Entered" || funcName == "Exited" || funcName == "Animate" || funcName == "Replace" || funcName == "Execute") + { + skippedFunctionNames.Add(funcName); continue; + } if (!string.IsNullOrEmpty(funcName) && funcName.Length >= minFunctionNameLength) {