diff --git a/HedgeModManager/res/codes/ForcesCodeLoader.dll b/HedgeModManager/res/codes/ForcesCodeLoader.dll index 7ff15896..c98e84af 100644 Binary files a/HedgeModManager/res/codes/ForcesCodeLoader.dll and b/HedgeModManager/res/codes/ForcesCodeLoader.dll differ diff --git a/HedgeModManager/src/MainForm.cs b/HedgeModManager/src/MainForm.cs index 2afc3126..d3343d99 100644 --- a/HedgeModManager/src/MainForm.cs +++ b/HedgeModManager/src/MainForm.cs @@ -197,108 +197,11 @@ public void SaveModDB() CodeLoader.SaveCodesAndPatches(ModsDb, LoadedCodes); // Saves and refreshes the mod list ModsDb.SaveModsDb(ModsDbPath); - // TODO - if (Program.CurrentGame == Games.SonicForces) - { - string CPKMakerDLLExecPath = Path.Combine(Program.StartDirectory, "CpkMaker.dll"); - string CPKMakerDLLDiskPath = Path.Combine($@"{Program.StartDirectory}\..\..\..\..\image\x64\disk\", "CpkMaker.dll"); - CPK cpk = null; - if (File.Exists(CPKMakerDLLExecPath) || File.Exists(CPKMakerDLLDiskPath)) - cpk = new CPKMakerCRI(File.Exists(CPKMakerDLLExecPath) ? CPKMakerDLLExecPath : CPKMakerDLLDiskPath); - else - cpk = new CPKSAL(); - - PrepareCPK(cpk); - if (cpk.FileCount > 0) - { - LogFile.AddMessage($@"Writing CPK to {Program.StartDirectory}\..\..\..\..\image\x64\disk\wars_mods.cpk"); - cpk.Pack($@"{Program.StartDirectory}\..\..\..\..\image\x64\disk\wars_mods.cpk"); - }else - { - if (File.Exists($@"{Program.StartDirectory}\..\..\..\..\image\x64\disk\wars_mods.cpk")) - File.Delete($@"{Program.StartDirectory}\..\..\..\..\image\x64\disk\wars_mods.cpk"); - } - } + if (File.Exists($@"{Program.StartDirectory}\..\..\..\..\image\x64\disk\wars_mods.cpk")) + File.Delete($@"{Program.StartDirectory}\..\..\..\..\image\x64\disk\wars_mods.cpk"); RefreshModsList(); } - // Sonic Forces Prepare CPK - public void PrepareCPK(CPK cpk) - { - // wars_0 - for (int i = 0; i < ModsList.CheckedItems.Count; ++i) - { - var mod = ModsList.CheckedItems[i].Tag as Mod; - string dir = $@"{Program.StartDirectory}/mods/{Path.GetFileName(mod.RootDirectory)}/disk/wars_0"; - if (!Directory.Exists(dir)) - continue; - cpk.AddFilesFromDirectory(dir); - } - // wars_1 - for (int i = 0; i < ModsList.CheckedItems.Count; ++i) - { - var mod = ModsList.CheckedItems[i].Tag as Mod; - string dir = $@"{Program.StartDirectory}/mods/{Path.GetFileName(mod.RootDirectory)}/disk/wars_1"; - if (!Directory.Exists(dir)) - continue; - cpk.AddFilesFromDirectory(dir); - } - // wars_patch - for (int i = 0; i < ModsList.CheckedItems.Count; ++i) - { - var mod = ModsList.CheckedItems[i].Tag as Mod; - string dir = $@"{Program.StartDirectory}/mods/{Path.GetFileName(mod.RootDirectory)}/disk/wars_patch"; - if (!Directory.Exists(dir)) - continue; - cpk.AddFilesFromDirectory(dir); - } - - for (int i = 0; i < ModsList.CheckedItems.Count; ++i) - { - var mod = ModsList.CheckedItems[i].Tag as Mod; - var ini = mod.GetIniFile(); - if (!ini.ContainsGroup("CPKs")) - continue; - for (int ii = 0; ii < ini["CPKs"].ParameterCount; ++ii) - { - // Don't really need this. - string cpkPath = Path.Combine($@"{Program.StartDirectory}\..\..\..\..\", - Path.ChangeExtension(ini["CPKs"][ii].Value, ".cpk")); - string iniPath = Path.Combine($@"{Program.StartDirectory}\mods\{Path.GetFileName(mod.RootDirectory)}\", ini["CPKs"][ii].Value); - var cpkIni = new IniFile(iniPath); - - // Commands stuff - var commands = new Dictionary(); - var main = cpkIni["Main"]; - int commandCount = int.Parse(main["CommandCount"]); - for (int iii = 0; iii < commandCount; ++iii) - { - string value = main[$"Command{iii}"]; - commands.Add(value.Split(':')[1], value.Split(':')[0]); - } - - // TODO - foreach (var pair in commands) - { - var group = cpkIni[pair.Key]; - for (int iiii = 0; iiii < group.ParameterCount; ++iiii) - { - if (pair.Value == "Add") - { - string modRootPath = $@"{Program.StartDirectory}\mods\{Path.GetFileName(mod.RootDirectory)}\"; - string filePath = Path.Combine($@"{Program.StartDirectory}\mods\{Path.GetFileName(mod.RootDirectory)}\", group[iiii].Key); - if (Path.HasExtension(filePath)) - cpk.AddFile(modRootPath, filePath); - else - cpk.AddFilesFromDirectory(new DirectoryInfo(filePath).Parent.FullName); - } - } - } - } - - } - } - public void LoadConfig() { // Writes "cpkredir.ini" if it doesn't exists as HedgeModManager uses it to store its config diff --git a/HedgeModManager/src/Program.cs b/HedgeModManager/src/Program.cs index 44ac2405..bf887a9e 100644 --- a/HedgeModManager/src/Program.cs +++ b/HedgeModManager/src/Program.cs @@ -6,6 +6,7 @@ using System.Net; using System.Runtime.InteropServices; using System.Windows.Forms; +using System.Windows.Input; namespace HedgeModManager { @@ -18,7 +19,7 @@ internal static class Program public static Game CurrentGame = Games.Unknown; public const string ProgramName = "Hedge Mod Manager"; public const string ProgramNameShort = "HedgeModManager"; - public const string VersionString = "6.1-013"; + public const string VersionString = "6.1-014"; public const string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"; public static bool Restart = false; @@ -85,9 +86,9 @@ private static void Main(string[] args) LogFile.Initialize(); LogFile.AddMessage($"Starting {ProgramName} (v{VersionString})..."); - #if DEBUG +#if DEBUG StartDirectory = @"C:\Program Files (x86)\Steam\steamapps\common\SonicForces\build\main\projects\exec"; - #endif +#endif LogFile.AddMessage($"Running {ProgramName} in {StartDirectory}"); diff --git a/appveyor.yml b/appveyor.yml index e8482f92..50f81da6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '6.1-013_r{build}' +version: '6.1-014_r{build}' environment: matrix: