Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Installer/Changes.txt
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 6 additions & 2 deletions TombIDE/TombIDE.ProjectMaster/Forms/FormGameArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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")
Expand Down
50 changes: 14 additions & 36 deletions TombIDE/TombIDE.ProjectMaster/LevelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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" +

Expand Down Expand Up @@ -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;
Expand All @@ -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" +

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
Binary file modified TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR1.zip
Binary file not shown.
Binary file modified TombIDE/TombIDE.Shared/TIDE/Templates/Presets/TR2X.zip
Binary file not shown.
Binary file modified TombIDE/TombIDE.Shared/TIDE/Templates/Shared/PLAY.exe
Binary file not shown.