mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #292 from erri120/vortex-fixes-7
Deployment files are now included correctly
This commit is contained in:
commit
381b70a8df
@ -1,5 +1,8 @@
|
|||||||
using System.IO;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Wabbajack.Common;
|
||||||
|
|
||||||
namespace Wabbajack.Lib.CompilationSteps
|
namespace Wabbajack.Lib.CompilationSteps
|
||||||
{
|
{
|
||||||
@ -11,10 +14,21 @@ namespace Wabbajack.Lib.CompilationSteps
|
|||||||
|
|
||||||
public override async ValueTask<Directive> Run(RawSourceFile source)
|
public override async ValueTask<Directive> Run(RawSourceFile source)
|
||||||
{
|
{
|
||||||
if (!source.Path.EndsWith("vortex.deployment.msgpack") &&
|
var l = new List<string> {"vortex.deployment.msgpack", "vortex.deployment.json"};
|
||||||
!source.Path.EndsWith("\\vortex.deployment.json") && Path.GetExtension(source.Path) != ".meta") return null;
|
if (!l.Any(a => source.Path.Contains(a))) return null;
|
||||||
var inline = source.EvolveTo<InlineFile>();
|
var inline = source.EvolveTo<InlineFile>();
|
||||||
inline.SourceDataID = _compiler.IncludeFile(File.ReadAllBytes(source.AbsolutePath));
|
inline.SourceDataID = _compiler.IncludeFile(File.ReadAllBytes(source.AbsolutePath));
|
||||||
|
if (!source.Path.Contains("vortex.deployment.json"))
|
||||||
|
return inline;
|
||||||
|
|
||||||
|
var path = source.Path;
|
||||||
|
if (!path.StartsWith(Consts.GameFolderFilesDir))
|
||||||
|
return inline;
|
||||||
|
|
||||||
|
path = path.Substring(Consts.GameFolderFilesDir.Length + 1);
|
||||||
|
path = $"{Consts.ManualGameFilesDir}\\{path}";
|
||||||
|
inline.To = path;
|
||||||
|
|
||||||
return inline;
|
return inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ namespace Wabbajack.Lib
|
|||||||
|
|
||||||
UpdateTracker.NextStep("Finding Install Files");
|
UpdateTracker.NextStep("Finding Install Files");
|
||||||
var vortexStagingFiles = Directory.EnumerateFiles(StagingFolder, "*", SearchOption.AllDirectories)
|
var vortexStagingFiles = Directory.EnumerateFiles(StagingFolder, "*", SearchOption.AllDirectories)
|
||||||
.Where(p => p.FileExists() && p != StagingMarkerName)
|
.Where(p => p.FileExists() && p != StagingMarkerName && !p.Contains(Consts.ManualGameFilesDir))
|
||||||
.Select(p => new RawSourceFile(VFS.Index.ByRootPath[p])
|
.Select(p => new RawSourceFile(VFS.Index.ByRootPath[p])
|
||||||
{Path = p.RelativeTo(StagingFolder)});
|
{Path = p.RelativeTo(StagingFolder)});
|
||||||
|
|
||||||
@ -470,12 +470,12 @@ namespace Wabbajack.Lib
|
|||||||
return new List<ICompilationStep>
|
return new List<ICompilationStep>
|
||||||
{
|
{
|
||||||
new IncludePropertyFiles(this),
|
new IncludePropertyFiles(this),
|
||||||
|
new IncludeVortexDeployment(this),
|
||||||
|
|
||||||
new IncludeSteamWorkshopItems(this, _steamGame),
|
new IncludeSteamWorkshopItems(this, _steamGame),
|
||||||
_hasSteamWorkshopItems ? new IncludeRegex(this, "^steamWorkshopItem_\\d*\\.meta$") : null,
|
_hasSteamWorkshopItems ? new IncludeRegex(this, "^steamWorkshopItem_\\d*\\.meta$") : null,
|
||||||
|
|
||||||
new IgnoreDisabledVortexMods(this),
|
new IgnoreDisabledVortexMods(this),
|
||||||
new IncludeVortexDeployment(this),
|
|
||||||
new IgnoreVortex(this),
|
new IgnoreVortex(this),
|
||||||
new IgnoreRegex(this, $"^*{StagingMarkerName}$"),
|
new IgnoreRegex(this, $"^*{StagingMarkerName}$"),
|
||||||
|
|
||||||
|
@ -132,14 +132,14 @@ namespace Wabbajack.Lib
|
|||||||
var dirInfo = new DirectoryInfo(dir);
|
var dirInfo = new DirectoryInfo(dir);
|
||||||
dirInfo.GetDirectories("*", SearchOption.AllDirectories).Do(d =>
|
dirInfo.GetDirectories("*", SearchOption.AllDirectories).Do(d =>
|
||||||
{
|
{
|
||||||
var destPath = d.FullName.Replace(dir, gameFolder);
|
var destPath = d.FullName.Replace(manualFilesDir, gameFolder);
|
||||||
Status($"Creating directory {destPath}");
|
Status($"Creating directory {destPath}");
|
||||||
Directory.CreateDirectory(destPath);
|
Directory.CreateDirectory(destPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
dirInfo.GetFiles("*", SearchOption.AllDirectories).Do(f =>
|
dirInfo.GetFiles("*", SearchOption.AllDirectories).Do(f =>
|
||||||
{
|
{
|
||||||
var destPath = f.FullName.Replace(dir, gameFolder);
|
var destPath = f.FullName.Replace(manualFilesDir, gameFolder);
|
||||||
Status($"Copying file {f.FullName} to {destPath}");
|
Status($"Copying file {f.FullName} to {destPath}");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -207,7 +207,7 @@ namespace Wabbajack.Lib
|
|||||||
if (directive.To.EndsWith(".meta"))
|
if (directive.To.EndsWith(".meta"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Status($"Writing included file {directive.To}");
|
Info($"Writing included file {directive.To}");
|
||||||
var outPath = Path.Combine(OutputFolder, directive.To);
|
var outPath = Path.Combine(OutputFolder, directive.To);
|
||||||
if(File.Exists(outPath)) File.Delete(outPath);
|
if(File.Exists(outPath)) File.Delete(outPath);
|
||||||
File.WriteAllBytes(outPath, LoadBytesFromPath(directive.SourceDataID));
|
File.WriteAllBytes(outPath, LoadBytesFromPath(directive.SourceDataID));
|
||||||
|
Loading…
Reference in New Issue
Block a user