[fix] fix for new file naming convention
Some checks failed
Create release on tag push / Create mod release (push) Failing after 52s
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:
parent
a865d1b356
commit
35120ad6b8
2 changed files with 15 additions and 12 deletions
14
CHANGELOG.md
14
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 `<name>.4.1.binds`.
|
||||
|
||||
# 4.2.2 (2022-05-31)
|
||||
|
||||
## Fixed
|
||||
|
||||
|
|
13
bindED.cs
13
bindED.cs
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue