From 7691c65c9f405b77ea66d61ed8726765619e91e9 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Wed, 19 Jun 2024 06:49:21 -0400 Subject: [PATCH] More validation --- RecodeItGUI/GUI/Main.Designer.cs | 2 -- RecodeItGUI/GUI/Main.cs | 12 ++++++++++++ RecodeItLib/CrossCompiler/ProjectManager.cs | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/RecodeItGUI/GUI/Main.Designer.cs b/RecodeItGUI/GUI/Main.Designer.cs index 34c049a..39013e6 100644 --- a/RecodeItGUI/GUI/Main.Designer.cs +++ b/RecodeItGUI/GUI/Main.Designer.cs @@ -1103,7 +1103,6 @@ partial class ReCodeItForm AutoMapperTab.Size = new Size(1336, 953); AutoMapperTab.TabIndex = 3; AutoMapperTab.Text = "Auto Mapper"; - AutoMapperTab.Click += AutoMapperTab_Click; // // AutoMapperUnseal // @@ -1610,7 +1609,6 @@ partial class ReCodeItForm SettingsTab.Size = new Size(1336, 953); SettingsTab.TabIndex = 2; SettingsTab.Text = "Settings"; - SettingsTab.Click += SettingsTab_Click; // // groupBox2 // diff --git a/RecodeItGUI/GUI/Main.cs b/RecodeItGUI/GUI/Main.cs index 9d5e226..6c1e8d1 100644 --- a/RecodeItGUI/GUI/Main.cs +++ b/RecodeItGUI/GUI/Main.cs @@ -826,11 +826,23 @@ public partial class ReCodeItForm : Form private void CrossPatchRemapButton_Click(object sender, EventArgs e) { + if (CrossCompiler.ActiveProject.RemapModels.Count == 0) + { + MessageBox.Show("You cannot generate a remapped dll without creating remaps first"); + return; + } + CrossCompiler.StartRemap(); } private void CrossPatchRunButton_Click(object sender, EventArgs e) { + if (CrossCompiler.ActiveProject.RemapModels.Count == 0) + { + MessageBox.Show("You cannot compile without having created remaps first"); + return; + } + CrossCompiler.StartCrossCompile(); } diff --git a/RecodeItLib/CrossCompiler/ProjectManager.cs b/RecodeItLib/CrossCompiler/ProjectManager.cs index af53916..c9c151c 100644 --- a/RecodeItLib/CrossCompiler/ProjectManager.cs +++ b/RecodeItLib/CrossCompiler/ProjectManager.cs @@ -60,7 +60,7 @@ public static class ProjectManager private static void CopyVisualStudioProject(CrossCompilerProjectModel proj) { - var solutionDirPath = proj.VisualStudioSolutionPath; + var solutionDirPath = proj.VisualStudioSolutionDirectoryPath; var solutionFiles = Directory.GetFiles(solutionDirPath, "*.sln", SearchOption.AllDirectories); var solutionFile = string.Empty; @@ -129,7 +129,7 @@ public static class ProjectManager public static void SaveCrossCompilerProjectModel(CrossCompilerProjectModel model) { - var path = Path.Combine(model.VisualStudioSolutionPath, "ReCodeItProj.json"); + var path = Path.Combine(model.VisualStudioSolutionDirectoryPath, "ReCodeItProj.json"); JsonSerializerSettings settings = new() {