Fix build issue
This commit is contained in:
parent
9eb3780eaa
commit
a8f496d34e
26
RecodeItGUI/GUI/Main.Designer.cs
generated
26
RecodeItGUI/GUI/Main.Designer.cs
generated
@ -145,6 +145,7 @@ partial class ReCodeItForm
|
||||
CCMappingTreeView = new TreeView();
|
||||
CrossPatchRunButton = new Button();
|
||||
groupBox3 = new GroupBox();
|
||||
CCAutoLoadLastProj = new CheckBox();
|
||||
CCLoadProjButton = new Button();
|
||||
CCRemappedOutputButton = new Button();
|
||||
CCRemappedOutputText = new TextBox();
|
||||
@ -160,7 +161,6 @@ partial class ReCodeItForm
|
||||
groupBox2 = new GroupBox();
|
||||
SilentModeCheckbox = new CheckBox();
|
||||
DebugLoggingCheckbox = new CheckBox();
|
||||
CCAutoLoadLastProj = new CheckBox();
|
||||
TabPageRemapper.SuspendLayout();
|
||||
groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)ConstuctorCountUpDown).BeginInit();
|
||||
@ -262,6 +262,7 @@ partial class ReCodeItForm
|
||||
ActiveProjectMappingsCheckbox.TabIndex = 39;
|
||||
ActiveProjectMappingsCheckbox.Text = "Use Active Project Mappings";
|
||||
ActiveProjectMappingsCheckbox.UseVisualStyleBackColor = true;
|
||||
ActiveProjectMappingsCheckbox.CheckedChanged += ActiveProjectMappingsCheckbox_CheckedChanged;
|
||||
//
|
||||
// LoadedMappingFilePath
|
||||
//
|
||||
@ -1481,6 +1482,19 @@ partial class ReCodeItForm
|
||||
groupBox3.TabStop = false;
|
||||
groupBox3.Text = "ReCodeIt Proj Settings";
|
||||
//
|
||||
// CCAutoLoadLastProj
|
||||
//
|
||||
CCAutoLoadLastProj.AutoSize = true;
|
||||
CCAutoLoadLastProj.Checked = true;
|
||||
CCAutoLoadLastProj.CheckState = CheckState.Checked;
|
||||
CCAutoLoadLastProj.Location = new Point(6, 247);
|
||||
CCAutoLoadLastProj.Name = "CCAutoLoadLastProj";
|
||||
CCAutoLoadLastProj.Size = new Size(259, 29);
|
||||
CCAutoLoadLastProj.TabIndex = 34;
|
||||
CCAutoLoadLastProj.Text = "Auto load last active project";
|
||||
CCAutoLoadLastProj.UseVisualStyleBackColor = true;
|
||||
CCAutoLoadLastProj.CheckedChanged += CCAutoLoadLastProj_CheckedChanged_1;
|
||||
//
|
||||
// CCLoadProjButton
|
||||
//
|
||||
CCLoadProjButton.Location = new Point(475, 247);
|
||||
@ -1632,16 +1646,6 @@ partial class ReCodeItForm
|
||||
DebugLoggingCheckbox.UseVisualStyleBackColor = true;
|
||||
DebugLoggingCheckbox.CheckedChanged += DebugLoggingCheckbox_CheckedChanged;
|
||||
//
|
||||
// CCAutoLoadLastProj
|
||||
//
|
||||
CCAutoLoadLastProj.AutoSize = true;
|
||||
CCAutoLoadLastProj.Location = new Point(6, 247);
|
||||
CCAutoLoadLastProj.Name = "CCAutoLoadLastProj";
|
||||
CCAutoLoadLastProj.Size = new Size(259, 29);
|
||||
CCAutoLoadLastProj.TabIndex = 34;
|
||||
CCAutoLoadLastProj.Text = "Auto load last active project";
|
||||
CCAutoLoadLastProj.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// ReCodeItForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
||||
|
@ -28,13 +28,15 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
DataProvider.LoadMappingFile(DataProvider.Settings.Remapper.MappingPath);
|
||||
LoadedMappingFilePath.Text = DataProvider.Settings.Remapper.MappingPath;
|
||||
|
||||
PopulateDomainUpDowns();
|
||||
RefreshSettingsPage();
|
||||
RefreshAutoMapperPage();
|
||||
RefreshCrossPatchPage();
|
||||
RemapTreeView.NodeMouseDoubleClick += EditSelectedRemap;
|
||||
RefreshCrossCompilerPage();
|
||||
|
||||
RemapTreeView.NodeMouseDoubleClick += EditSelectedRemap;
|
||||
Remapper.OnComplete += ReloadTreeView;
|
||||
|
||||
ReloadTreeView(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
@ -641,8 +643,29 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
#region CROSS_COMPILER
|
||||
|
||||
private void RefreshCrossPatchPage()
|
||||
private void RefreshCrossCompilerPage()
|
||||
{
|
||||
var ccSettings = DataProvider.Settings.CrossCompiler;
|
||||
|
||||
CCAutoLoadLastProj.Checked = ccSettings.AutoLoadLastActiveProject;
|
||||
|
||||
if (ccSettings.AutoLoadLastActiveProject)
|
||||
{
|
||||
// Dont continue if its an empty string, it hasnt been set yet
|
||||
if (ccSettings.LastLoadedProject == string.Empty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!File.Exists(ccSettings.LastLoadedProject))
|
||||
{
|
||||
MessageBox.Show("Couldnt find last loaded project");
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectManager.LoadProject(ccSettings.LastLoadedProject);
|
||||
}
|
||||
|
||||
if (CrossCompiler.ActiveProject == null)
|
||||
{
|
||||
return;
|
||||
@ -663,7 +686,6 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
if (result != string.Empty)
|
||||
{
|
||||
DataProvider.Settings.CrossCompiler.OriginalAssemblyPath = result;
|
||||
CCOriginalAssemblyText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
@ -675,7 +697,6 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
if (result != string.Empty)
|
||||
{
|
||||
DataProvider.Settings.CrossCompiler.RemappedOutput = result;
|
||||
CCRemappedOutputText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
@ -687,7 +708,6 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
if (result != string.Empty)
|
||||
{
|
||||
DataProvider.Settings.CrossCompiler.VisualStudioSolutionPath = result;
|
||||
CCVisualStudioProjDirText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
@ -699,7 +719,6 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
if (result != string.Empty)
|
||||
{
|
||||
DataProvider.Settings.CrossCompiler.BuildPath = result;
|
||||
CCBuildDirText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
@ -745,6 +764,18 @@ public partial class ReCodeItForm : Form
|
||||
}
|
||||
}
|
||||
|
||||
private void CCAutoLoadLastProj_CheckedChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.CrossCompiler.AutoLoadLastActiveProject = CCAutoLoadLastProj.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
// Use the projects remap list on the remap tab
|
||||
private void ActiveProjectMappingsCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
#endregion CROSS_COMPILER
|
||||
|
||||
// Reset All UI elements to default
|
||||
@ -904,7 +935,7 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
private void tabPage5_Click(object sender, EventArgs e)
|
||||
{
|
||||
RefreshCrossPatchPage();
|
||||
RefreshCrossCompilerPage();
|
||||
}
|
||||
|
||||
private void SettingsTab_Click(object sender, EventArgs e)
|
||||
|
@ -6,21 +6,9 @@ namespace ReCodeIt.CrossCompiler;
|
||||
|
||||
public static class ProjectManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Key: Path of the project, Value: Project file
|
||||
/// </summary>
|
||||
public static Dictionary<string, CrossCompilerProjectModel> Projects { get; private set; } = [];
|
||||
|
||||
public static CrossCompilerProjectModel ActiveProject { get; private set; }
|
||||
|
||||
private static CrossCompilerSettings Settings => DataProvider.Settings.CrossCompiler;
|
||||
|
||||
private static HashSet<string> CopyIgnoreDirectories { get; } =
|
||||
[
|
||||
".vs",
|
||||
".git"
|
||||
];
|
||||
|
||||
public static void CreateProject(
|
||||
string OrigAssemblyPath,
|
||||
string RemappedAssemblyOutputPath,
|
||||
@ -55,7 +43,7 @@ public static class ProjectManager
|
||||
|
||||
Logger.Log($"Found Solution: {ActiveProject.SolutionName}", ConsoleColor.Yellow);
|
||||
Logger.Log($"Original Assembly Checksum: {ActiveProject.OriginalAssemblyHash}", ConsoleColor.Yellow);
|
||||
Logger.Log($"Project Generated to: {DataProvider.Settings.CrossCompiler.LastActiveProjectPath}", ConsoleColor.Green);
|
||||
Logger.Log($"Project Generated to: {DataProvider.Settings.CrossCompiler.LastLoadedProject}", ConsoleColor.Green);
|
||||
Logger.Log("-----------------------------------------------", ConsoleColor.Yellow);
|
||||
}
|
||||
|
||||
@ -119,9 +107,16 @@ public static class ProjectManager
|
||||
file.CopyTo(tempPath, true);
|
||||
}
|
||||
|
||||
// We dont want git and vs directories they are often locked leading to problems
|
||||
List<string> copyIgnoreDirectories =
|
||||
[
|
||||
".vs",
|
||||
".git"
|
||||
];
|
||||
|
||||
foreach (DirectoryInfo subdir in dirs)
|
||||
{
|
||||
if (CopyIgnoreDirectories.Contains(subdir.Name)) { continue; }
|
||||
if (copyIgnoreDirectories.Contains(subdir.Name)) { continue; }
|
||||
|
||||
string tempPath = Path.Combine(destinationDirPath, subdir.Name);
|
||||
CopyProjectRecursive(subdir.FullName, tempPath);
|
||||
@ -141,7 +136,7 @@ public static class ProjectManager
|
||||
|
||||
File.WriteAllText(path, jsonText);
|
||||
|
||||
DataProvider.Settings.CrossCompiler.LastActiveProjectPath = path;
|
||||
DataProvider.Settings.CrossCompiler.LastLoadedProject = path;
|
||||
DataProvider.SaveAppSettings();
|
||||
|
||||
Logger.Log($"Cross Compiler project json generated to {path}", ConsoleColor.Green);
|
||||
@ -158,7 +153,7 @@ public static class ProjectManager
|
||||
|
||||
var model = JsonConvert.DeserializeObject<CrossCompilerProjectModel>(jsonText);
|
||||
|
||||
DataProvider.Settings.CrossCompiler.LastActiveProjectPath = path;
|
||||
DataProvider.Settings.CrossCompiler.LastLoadedProject = path;
|
||||
DataProvider.SaveAppSettings();
|
||||
|
||||
Logger.Log($"Loaded Cross Compiler Project: {model?.RemappedAssemblyPath}");
|
||||
|
@ -24,7 +24,7 @@ public class ReCodeItCrossCompiler
|
||||
public void StartRemap()
|
||||
{
|
||||
ChangedTypes.Clear();
|
||||
Remapper.InitializeRemap(Settings.OriginalAssemblyPath, Settings.RemappedOutput, true);
|
||||
Remapper.InitializeRemap(ActiveProject.OriginalAssemblyPath, ActiveProject.RemappedAssemblyPath, true);
|
||||
|
||||
if (ActiveProject == null)
|
||||
{
|
||||
|
@ -107,7 +107,12 @@ public class CrossCompilerSettings
|
||||
/// <summary>
|
||||
/// Last Loaded Project Path
|
||||
/// </summary>
|
||||
public string LastActiveProjectPath { get; set; }
|
||||
public string LastLoadedProject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Should the last active project be auto loaded
|
||||
/// </summary>
|
||||
public bool AutoLoadLastActiveProject { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -66,6 +66,7 @@
|
||||
]
|
||||
},
|
||||
"CrossCompiler": {
|
||||
"AutoLoadLastActiveProject": true, // Autoload last active project
|
||||
"LastLoadedProject": "" // Last loaded project path
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user