diff --git a/CHANGELOG.md b/CHANGELOG.md index 6153d748..7470a6d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog +#### Version - 3.0.1.3 - 9/??/2022 +* Auto-include splash.png files when compiling +* Fix support for `WABBAJACK_NOMATCH_INCLUDE_FILES.txt` and other variants + #### Version - 3.0.1.2 - 9/19/2022 * Fix error with FNV BSAs not building properly when files are in the root folder * Fix for UnknownError in the Launcher (will require the Wabbajack.exe launcher to be re-downloaded) diff --git a/Wabbajack.Compiler/CompilationSteps/IncludeRegex.cs b/Wabbajack.Compiler/CompilationSteps/IncludeRegex.cs index 82006f10..26ec0781 100644 --- a/Wabbajack.Compiler/CompilationSteps/IncludeRegex.cs +++ b/Wabbajack.Compiler/CompilationSteps/IncludeRegex.cs @@ -14,7 +14,7 @@ public class IncludeRegex : ACompilationStep public IncludeRegex(ACompiler compiler, string pattern) : base(compiler) { _pattern = pattern; - _regex = new Regex(pattern, RegexOptions.Compiled); + _regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); } public override async ValueTask Run(RawSourceFile source) diff --git a/Wabbajack.Compiler/CompilerSettingsInferencer.cs b/Wabbajack.Compiler/CompilerSettingsInferencer.cs index 6145ed7b..83c84126 100644 --- a/Wabbajack.Compiler/CompilerSettingsInferencer.cs +++ b/Wabbajack.Compiler/CompilerSettingsInferencer.cs @@ -67,13 +67,13 @@ public class CompilerSettingsInferencer cs.Include = Array.Empty(); foreach (var file in mo2Folder.EnumerateFiles()) { - if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_INCLUDE) + if (MatchesVariants(file, Consts.WABBAJACK_INCLUDE)) cs.Include = cs.Include.Add(file.Parent.RelativeTo(mo2Folder)); - if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_NOMATCH_INCLUDE) + if (MatchesVariants(file, Consts.WABBAJACK_NOMATCH_INCLUDE)) cs.NoMatchInclude = cs.NoMatchInclude.Add(file.Parent.RelativeTo(mo2Folder)); - if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_IGNORE) + if (MatchesVariants(file, Consts.WABBAJACK_IGNORE)) cs.Ignore = cs.Ignore.Add(file.Parent.RelativeTo(mo2Folder)); } @@ -120,4 +120,12 @@ public class CompilerSettingsInferencer return null; } + + private static bool MatchesVariants(AbsolutePath file, string baseVariant) + { + var withoutExt = file.FileName.WithoutExtension().ToString(); + + return withoutExt == baseVariant || + withoutExt == baseVariant + "_FILES"; + } } \ No newline at end of file diff --git a/Wabbajack.Compiler/MO2Compiler.cs b/Wabbajack.Compiler/MO2Compiler.cs index 45c91260..614c507d 100644 --- a/Wabbajack.Compiler/MO2Compiler.cs +++ b/Wabbajack.Compiler/MO2Compiler.cs @@ -292,8 +292,9 @@ public class MO2Compiler : ACompiler new IgnoreFilename(this, "portable.txt".ToRelativePath()), new IgnoreExtension(this, Ext.Bin), new IgnoreFilename(this, ".refcache".ToRelativePath()), - //Include custom categories - new IncludeRegex(this, "categories.dat$"), + //Include custom categories / splash screens + new IncludeRegex(this, @"categories\.dat$"), + new IncludeRegex(this, @"splash\.png"), new IncludeAllConfigs(this), // TODO