From 35120ad6b8bacb3345bb54fb09af1706ce027416 Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Fri, 3 May 2024 14:05:46 +0200 Subject: [PATCH] =?UTF-8?q?=EF=BB=BF[fix]=20fix=20for=20new=20file=20namin?= =?UTF-8?q?g=20convention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also drops legacy support. fixes #42 --- CHANGELOG.md | 14 +++++++++++++- bindED.cs | 13 ++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ee032..a3e9a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,16 @@ -# 4.2.2 (2022-05-31) +# 5.0.0 (2024-05-03) + +## Removed + +* Will no longer copy Odyssey (live) binds to Horizons (legacy) binds. I doubt + anyone still plays the latter; if you do, don’t upgrade the pulgin. + +## Fixed + +* Will now find binds files again for the latest Elite update which changed + the format to `.4.1.binds`. + +# 4.2.2 (2022-05-31) ## Fixed diff --git a/bindED.cs b/bindED.cs index 224f277..973eb44 100644 --- a/bindED.cs +++ b/bindED.cs @@ -402,7 +402,7 @@ private static string DetectBindsFile(string preset) { DirectoryInfo dirInfo = new (BindingsDir); FileInfo[] bindFiles = dirInfo.GetFiles() - .Where(i => Regex.Match(i.Name, $@"^{Regex.Escape(preset)}\.[34]\.0\.binds$").Success) + .Where(i => Regex.Match(i.Name, $@"^{Regex.Escape(preset)}\.4\.\d\.binds$").Success) .OrderByDescending(p => p.Name).ToArray(); if (bindFiles.Count() == 0) @@ -503,20 +503,11 @@ private static void FileChangedHandler(string name) Preset = null; LoadBinds(Binds); } - else if (Regex.Match(name, $@"{Preset}(\.[34]\.0)?\.binds$").Success) + else if (Regex.Match(name, $@"^{Regex.Escape(preset)}\.4\.\d\.binds$").Success) { LogInfo($"Bindings file '{name}' has changed, reloading …"); Binds = null; LoadBinds(Binds); - - // copy Odyssey -> Horizons - if (name == $"{Preset}.4.0.binds" && !VA!.GetBoolean("bindED.disableHorizonsSync#")) - { - File.WriteAllText( - Path.Combine(BindingsDir, $"{Preset}.3.0.binds"), - File.ReadAllText(Path.Combine(BindingsDir, name)) - .Replace("MajorVersion=\"4\" MinorVersion=\"0\">", "MajorVersion=\"3\" MinorVersion=\"0\">")); - } } } catch (Exception e)