[fix] fix for new file naming convention
Some checks failed
Create release on tag push / Create mod release (push) Failing after 52s

Also drops legacy support.

fixes #42
This commit is contained in:
alterNERDtive 2024-05-03 14:05:46 +02:00
parent a865d1b356
commit 35120ad6b8
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1
2 changed files with 15 additions and 12 deletions

View file

@ -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, dont upgrade the pulgin.
## Fixed
* Will now find binds files again for the latest Elite update which changed
the format to `<name>.4.1.binds`.
# 4.2.2 (2022-05-31)
## Fixed

View file

@ -402,7 +402,7 @@ namespace bindEDplugin
{
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 @@ namespace bindEDplugin
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)