diff --git a/Installer/Changes.txt b/Installer/Changes.txt index e3dcb8a2e..11dbf6ff1 100644 --- a/Installer/Changes.txt +++ b/Installer/Changes.txt @@ -1,6 +1,9 @@ Version 1.10.2 ============== +TombIDE: + * Updated TR1X and TR2X presets to TRX 1.0.3 + TEN nodes: * Added nodes to check the color of a moveable or static mesh. * Added node to add an interaction highlight to a moveable" diff --git a/TombIDE/TombIDE.ProjectMaster/Forms/FormGameArchive.cs b/TombIDE/TombIDE.ProjectMaster/Forms/FormGameArchive.cs index 7e22befcc..2027a15da 100644 --- a/TombIDE/TombIDE.ProjectMaster/Forms/FormGameArchive.cs +++ b/TombIDE/TombIDE.ProjectMaster/Forms/FormGameArchive.cs @@ -81,12 +81,14 @@ public void GenerateTR1Archive(string filePath, string readmeText) Path.Combine(engineDirectory, "music"), Path.Combine(engineDirectory, "cfg"), Path.Combine(engineDirectory, "data"), - Path.Combine(engineDirectory, "shaders") + Path.Combine(engineDirectory, "shaders"), + Path.Combine(engineDirectory, "scripting"), }; string[] importantFiles = new string[] { Path.Combine(engineDirectory, "splash.bmp"), + Path.Combine(engineDirectory, "TRX.exe"), Path.Combine(engineDirectory, "TR1X.exe"), Path.Combine(engineDirectory, "Tomb1Main.exe"), Path.Combine(engineDirectory, "TR1X_ConfigTool.exe"), @@ -106,12 +108,14 @@ public void GenerateTR2XArchive(string filePath, string readmeText) Path.Combine(engineDirectory, "music"), Path.Combine(engineDirectory, "cfg"), Path.Combine(engineDirectory, "data"), - Path.Combine(engineDirectory, "shaders") + Path.Combine(engineDirectory, "shaders"), + Path.Combine(engineDirectory, "scripting"), }; string[] importantFiles = new string[] { Path.Combine(engineDirectory, "splash.bmp"), + Path.Combine(engineDirectory, "TRX.exe"), Path.Combine(engineDirectory, "TR2X.exe"), Path.Combine(engineDirectory, "TR2X_ConfigTool.exe"), Path.Combine(engineDirectory, "splash.xml") diff --git a/TombIDE/TombIDE.ProjectMaster/LevelManager.cs b/TombIDE/TombIDE.ProjectMaster/LevelManager.cs index 15894cff3..777bcdfe1 100644 --- a/TombIDE/TombIDE.ProjectMaster/LevelManager.cs +++ b/TombIDE/TombIDE.ProjectMaster/LevelManager.cs @@ -98,21 +98,10 @@ private void UpdateVersionLabel() { button_Update.Visible = true; - // 3.0 is the first version that supports auto-updating - 4.8 introduced breaking changes - if (engineVersion.Major <= 4 && engineVersion.Minor <= 7) + // Auto-update ability resets at TRX 1.0 + if (engineVersion.Major < 1) { - button_Update.Text = engineVersion.Major <= 2 - ? "Cannot Auto-Update engine. Current version is too old." - : "Cannot Auto-Update engine. TR1X 4.8 introduced breaking changes, which require manual migration."; - - button_Update.Enabled = false; - button_Update.Width = 300; - } - - if (engineVersion.Major <= 4 && engineVersion.Minor <= 14) - { - button_Update.Text = "Cannot Auto-Update engine. TR1X 4.15 introduced breaking changes, which require manual migration."; - + button_Update.Text = "Cannot Auto-Update engine. TRX 1.0 introduced breaking changes, which require manual migration."; button_Update.Enabled = false; button_Update.Width = 300; } @@ -122,10 +111,10 @@ private void UpdateVersionLabel() { button_Update.Visible = true; - if (engineVersion.Major <= 1 && engineVersion.Minor <= 4) + // Auto-update ability resets at TRX 1.0 + if (engineVersion.Major < 1) { - button_Update.Text = "Cannot Auto-Update engine. TR2X 1.5 introduced breaking changes, which require manual migration."; - + button_Update.Text = "Cannot Auto-Update engine. TRX 1.0 introduced breaking changes, which require manual migration."; button_Update.Enabled = false; button_Update.Width = 300; } @@ -307,19 +296,10 @@ private void UpdateTR1X() { var prevVersion = _ide.Project.GetCurrentEngineVersion(); - // 4.8 had breaking changes - if (prevVersion.Major <= 4 && prevVersion.Minor <= 7) - { - MessageBox.Show(this, "Cannot Auto-Update engine. TR1X 4.8 introduced breaking changes, which require manual migration.", - "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - - return; - } - - // 4.15 also had breaking changes - if (prevVersion.Major <= 4 && prevVersion.Minor <= 14) + // Auto-update ability resets at TRX 1.0 + if (prevVersion.Major < 1) { - MessageBox.Show(this, "Cannot Auto-Update engine. TR1X 4.15 introduced breaking changes, which require manual migration.", + MessageBox.Show(this, "Cannot Auto-Update engine. TRX 1.0 introduced breaking changes, which require manual migration.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; @@ -329,8 +309,7 @@ private void UpdateTR1X() "This update will replace the following directories and files:\n\n" + "- Engine/shaders/\n" + - "- Engine/TR1X.exe\n" + - "- Engine/TR1X_ConfigTool.exe\n\n" + + "- Engine/TRX.exe\n\n" + "If any of these directories / files are important to you, please update the engine manually or create a copy of these files before performing this update.\n\n" + @@ -374,10 +353,10 @@ private void UpdateTR2X() { var prevVersion = _ide.Project.GetCurrentEngineVersion(); - // 1.5 had breaking changes - if (prevVersion.Major <= 1 && prevVersion.Minor <= 4) + // Auto-update ability resets at TRX 1.0 + if (prevVersion.Major < 1) { - MessageBox.Show(this, "Cannot Auto-Update engine. TR2X 1.5 introduced breaking changes, which require manual migration.", + MessageBox.Show(this, "Cannot Auto-Update engine. TRX 1.0 introduced breaking changes, which require manual migration.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; @@ -387,8 +366,7 @@ private void UpdateTR2X() "This update will replace the following directories and files:\n\n" + "- Engine/shaders/\n" + - "- Engine/TR2X.exe\n" + - "- Engine/TR2X_ConfigTool.exe\n\n" + + "- Engine/TRX.exe\n\n" + "If any of these directories / files are important to you, please update the engine manually or create a copy of these files before performing this update.\n\n" + diff --git a/TombIDE/TombIDE.Shared/NewStructure/GameProjectIdentifier.cs b/TombIDE/TombIDE.Shared/NewStructure/GameProjectIdentifier.cs index b039c374b..ff2cbb8e7 100644 --- a/TombIDE/TombIDE.Shared/NewStructure/GameProjectIdentifier.cs +++ b/TombIDE/TombIDE.Shared/NewStructure/GameProjectIdentifier.cs @@ -13,7 +13,7 @@ public static class GameProjectIdentifier private static readonly string[] ValidEngineExecutableNames = new string[] { - "Tomb1Main.exe", "TR1X.exe", "TR2X.exe", "Tomb2.exe", "tomb3.exe", "tomb4.exe", "TombEngine.exe" // Only the ones TIDE currently supports + "Tomb1Main.exe", "TR1X.exe", "TR2X.exe", "TRX.exe", "Tomb2.exe", "tomb3.exe", "tomb4.exe", "TombEngine.exe" // Only the ones TIDE currently supports }; private static readonly string[] PlatformSpecificDirectories = new string[] // TEN only diff --git a/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR1XGameProject.cs b/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR1XGameProject.cs index 8d03a1be3..7d56d948f 100644 --- a/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR1XGameProject.cs +++ b/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR1XGameProject.cs @@ -20,12 +20,15 @@ public override string EngineExecutableFileName { get { - string tomb1MainPath = Path.Combine(GetEngineRootDirectoryPath(), "Tomb1Main.exe"); - - if (File.Exists(tomb1MainPath)) - return "Tomb1Main.exe"; - - return "TR1X.exe"; // Default + var rootDir = GetEngineRootDirectoryPath(); + foreach (var exe in new[] { "TRX.exe", "TR1X.exe", "Tomb1Main.exe" }) + { + var path = Path.Combine(rootDir, exe); + if (File.Exists(path)) + return exe; + } + + return "TRX.exe"; // Default } } @@ -79,7 +82,7 @@ public override Version GetCurrentEngineVersion() { string engineExecutablePath = GetEngineExecutableFilePath(); string versionInfo = FileVersionInfo.GetVersionInfo(engineExecutablePath).ProductVersion; - versionInfo = versionInfo.Replace("TR1X ", string.Empty); + versionInfo = versionInfo.Replace("TRX ", string.Empty); return new Version(versionInfo); } @@ -98,14 +101,14 @@ public override Version GetLatestEngineVersion() string enginePresetPath = Path.Combine(DefaultPaths.PresetsDirectory, "TR1.zip"); using ZipArchive archive = ZipFile.OpenRead(enginePresetPath); - ZipArchiveEntry entry = archive.Entries.FirstOrDefault(e => e.Name == "TR1X.exe"); + ZipArchiveEntry entry = archive.Entries.FirstOrDefault(e => e.Name == "TRX.exe"); if (entry == null) return null; entry.ExtractToFile(tempFileName, true); string productVersion = FileVersionInfo.GetVersionInfo(tempFileName).ProductVersion; - productVersion = productVersion.Replace("TR1X ", string.Empty); + productVersion = productVersion.Replace("TRX ", string.Empty); return new Version(productVersion); } diff --git a/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR2XGameProject.cs b/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR2XGameProject.cs index a4b68df24..7e9eea78d 100644 --- a/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR2XGameProject.cs +++ b/TombIDE/TombIDE.Shared/NewStructure/Implementations/TR2XGameProject.cs @@ -16,7 +16,21 @@ public class TR2XGameProject : GameProjectBase public override TRVersion.Game GameVersion => TRVersion.Game.TR2X; public override string DataFileExtension => ".tr2"; - public override string EngineExecutableFileName => "TR2X.exe"; + public override string EngineExecutableFileName + { + get + { + var rootDir = GetEngineRootDirectoryPath(); + foreach (var exe in new[] { "TRX.exe", "TR2X.exe" }) + { + var path = Path.Combine(rootDir, exe); + if (File.Exists(path)) + return exe; + } + + return "TRX.exe"; // Default + } + } public override string MainScriptFilePath => Directory .GetFiles(GetScriptRootDirectory(), MainScriptFileNameFilter, SearchOption.AllDirectories) @@ -68,6 +82,13 @@ public override Version GetCurrentEngineVersion() { string engineExecutablePath = GetEngineExecutableFilePath(); string versionInfo = FileVersionInfo.GetVersionInfo(engineExecutablePath).ProductVersion; + if (!versionInfo.StartsWith("TR", StringComparison.InvariantCultureIgnoreCase)) + { + // Legacy TR2X builds did not have similar version strings to TR1X. + // This ensures such exes are marked as being outdated. + versionInfo = $"TR2X {versionInfo}"; + } + versionInfo = versionInfo.Replace("TRX ", string.Empty); return new Version(versionInfo); } @@ -86,14 +107,14 @@ public override Version GetLatestEngineVersion() string enginePresetPath = Path.Combine(DefaultPaths.PresetsDirectory, "TR2X.zip"); using ZipArchive archive = ZipFile.OpenRead(enginePresetPath); - ZipArchiveEntry entry = archive.Entries.FirstOrDefault(e => e.Name == "TR2X.exe"); + ZipArchiveEntry entry = archive.Entries.FirstOrDefault(e => e.Name == "TRX.exe"); if (entry == null) return null; entry.ExtractToFile(tempFileName, true); string productVersion = FileVersionInfo.GetVersionInfo(tempFileName).ProductVersion; - productVersion = productVersion.Replace("TR2X ", string.Empty); + productVersion = productVersion.Replace("TRX ", string.Empty); return new Version(productVersion); } diff --git a/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR1.zip b/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR1.zip index cd60ecea8..32ed6701f 100644 Binary files a/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR1.zip and b/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR1.zip differ diff --git a/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR2X.zip b/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR2X.zip index 0d72a10dc..eb0d37102 100644 Binary files a/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR2X.zip and b/TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR2X.zip differ diff --git a/TombIDE/TombIDE.Shared/TIDE/Templates/Shared/PLAY.exe b/TombIDE/TombIDE.Shared/TIDE/Templates/Shared/PLAY.exe index ff1619e51..aa6a61ed4 100644 Binary files a/TombIDE/TombIDE.Shared/TIDE/Templates/Shared/PLAY.exe and b/TombIDE/TombIDE.Shared/TIDE/Templates/Shared/PLAY.exe differ