From d9aab3cd20792e772afa2f390f85fbfd41abebd8 Mon Sep 17 00:00:00 2001 From: Anthony Webster Date: Wed, 12 Jul 2023 19:59:46 -0400 Subject: [PATCH 1/3] Improve efficiency of Saves.CurrentFolder method. --- AATool/Paths.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AATool/Paths.cs b/AATool/Paths.cs index 2cf051c..ad20e1e 100644 --- a/AATool/Paths.cs +++ b/AATool/Paths.cs @@ -100,6 +100,7 @@ public static string SpeedrunDotComRecordFile(bool rsg, bool aa, string version) public static class Saves { public const string AppDataShortcut = "%AppData%\\Roaming"; + private static readonly string AppDataFolderPath = GetFolderPath(SpecialFolder.ApplicationData); public static string CurrentFolder() { @@ -107,7 +108,7 @@ public static string CurrentFolder() return System.SftpWorldsFolder; return Tracker.Source is TrackerSource.CustomSavesPath - ? Config.Tracking.CustomSavesPath.Value.Replace(AppDataShortcut, GetFolderPath(SpecialFolder.ApplicationData)) + ? Config.Tracking.CustomSavesPath.Value.Replace(AppDataShortcut, AppDataFolderPath) : ActiveInstance.SavesPath; } From 25fd274f3780170d6226e803d245ada4194e77f5 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Mon, 4 Sep 2023 21:15:03 -0500 Subject: [PATCH 2/3] check for java instead of javaw --- AATool/Utilities/ActiveInstance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AATool/Utilities/ActiveInstance.cs b/AATool/Utilities/ActiveInstance.cs index be72052..0f23faa 100644 --- a/AATool/Utilities/ActiveInstance.cs +++ b/AATool/Utilities/ActiveInstance.cs @@ -105,7 +105,7 @@ private static bool TryGetActive(out Process instance) Debug.EndTiming("get_active_instance"); //verify that process is an instance of minecraft - if (active.ProcessName is "javaw" && active.MainWindowTitle.StartsWith("Minecraft")) + if (active.ProcessName is "java" && active.MainWindowTitle.StartsWith("Minecraft")) instance = active; } catch From 3fe35dd7fa7f474823b21d3c200fd596a75053f3 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:05:05 -0500 Subject: [PATCH 3/3] startswith instead of equality --- AATool/Utilities/ActiveInstance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AATool/Utilities/ActiveInstance.cs b/AATool/Utilities/ActiveInstance.cs index 0f23faa..96cba77 100644 --- a/AATool/Utilities/ActiveInstance.cs +++ b/AATool/Utilities/ActiveInstance.cs @@ -105,7 +105,7 @@ private static bool TryGetActive(out Process instance) Debug.EndTiming("get_active_instance"); //verify that process is an instance of minecraft - if (active.ProcessName is "java" && active.MainWindowTitle.StartsWith("Minecraft")) + if (active.ProcessName.StartsWith("java") && active.MainWindowTitle.StartsWith("Minecraft")) instance = active; } catch