Skip to content

Commit

Permalink
Add .pak generation
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Feb 6, 2021
1 parent 50c3fcc commit 0396da3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions LevelModMerger/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
Expand Down Expand Up @@ -87,6 +88,31 @@ static void Main(string[] args)
var temp2 = File.Create("./customlevels.json");
temp2.Close();
File.AppendAllText("./customlevels.json",JsonConvert.SerializeObject(loaderDict,Formatting.Indented));

if (File.Exists("./Tools/u4pak.py"))
{
run_cmd("python", $"{Directory.GetCurrentDirectory() + "/Tools/u4pak.py"} pack {Directory.GetCurrentDirectory() + "/MergedMods.pak"} Dungeons", path);
Console.WriteLine("Conversion successfully completed!");
}
else
{
Console.WriteLine("Conversion successful! As u4pak was not found, you need to create the .pak file yourself.");
Console.Read();
}
}

private static void run_cmd(string cmd, string args,string workingdirectory)
{
ProcessStartInfo start = new ProcessStartInfo
{
FileName = cmd,
Arguments = args,
WorkingDirectory = workingdirectory,
UseShellExecute = true
};

Process.Start(start);

}
}
}

0 comments on commit 0396da3

Please sign in to comment.