From 1612f444a922170978863c5d896b134986567f01 Mon Sep 17 00:00:00 2001 From: igorseabra4 Date: Sat, 6 Oct 2018 18:17:02 -0300 Subject: [PATCH] update project and settings --- .../ArchiveEditor/ArchiveEditor.Designer.cs | 48 ++------ IndustrialPark/ArchiveEditor/ArchiveEditor.cs | 31 +---- IndustrialPark/MainForm/AboutBox.Designer.cs | 2 +- IndustrialPark/MainForm/Json/ProjectJson.cs | 98 +++++++++++----- IndustrialPark/MainForm/MainForm.Designer.cs | 52 +++++++-- IndustrialPark/MainForm/MainForm.cs | 109 +++++++++++++----- IndustrialPark/SharpDX/SharpRenderer.cs | 3 +- 7 files changed, 205 insertions(+), 138 deletions(-) diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs index 7da94f31..cd2f4081 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs @@ -34,9 +34,6 @@ private void InitializeComponent() this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.displayModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.assetNameAssetIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.assetIDAssetNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportTexturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.importTXDArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); @@ -89,7 +86,6 @@ private void InitializeComponent() this.saveToolStripMenuItem, this.saveAsToolStripMenuItem, this.toolStripSeparator1, - this.displayModeToolStripMenuItem, this.exportTexturesToolStripMenuItem, this.importTXDArchiveToolStripMenuItem, this.toolStripSeparator2, @@ -102,7 +98,7 @@ private void InitializeComponent() // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // @@ -110,7 +106,7 @@ private void InitializeComponent() // this.saveToolStripMenuItem.Enabled = false; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // @@ -118,63 +114,38 @@ private void InitializeComponent() // this.saveAsToolStripMenuItem.Enabled = false; this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveAsToolStripMenuItem.Text = "Save As..."; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(178, 6); - // - // displayModeToolStripMenuItem - // - this.displayModeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.assetNameAssetIDToolStripMenuItem, - this.assetIDAssetNameToolStripMenuItem}); - this.displayModeToolStripMenuItem.Name = "displayModeToolStripMenuItem"; - this.displayModeToolStripMenuItem.Size = new System.Drawing.Size(181, 22); - this.displayModeToolStripMenuItem.Text = "Name Display Mode"; - // - // assetNameAssetIDToolStripMenuItem - // - this.assetNameAssetIDToolStripMenuItem.Checked = true; - this.assetNameAssetIDToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.assetNameAssetIDToolStripMenuItem.Name = "assetNameAssetIDToolStripMenuItem"; - this.assetNameAssetIDToolStripMenuItem.Size = new System.Drawing.Size(184, 22); - this.assetNameAssetIDToolStripMenuItem.Text = "AssetName [AssetID]"; - this.assetNameAssetIDToolStripMenuItem.Click += new System.EventHandler(this.assetNameAssetIDToolStripMenuItem_Click); - // - // assetIDAssetNameToolStripMenuItem - // - this.assetIDAssetNameToolStripMenuItem.Name = "assetIDAssetNameToolStripMenuItem"; - this.assetIDAssetNameToolStripMenuItem.Size = new System.Drawing.Size(184, 22); - this.assetIDAssetNameToolStripMenuItem.Text = "[AssetID] AssetName"; - this.assetIDAssetNameToolStripMenuItem.Click += new System.EventHandler(this.assetIDAssetNameToolStripMenuItem_Click); + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); // // exportTexturesToolStripMenuItem // this.exportTexturesToolStripMenuItem.Name = "exportTexturesToolStripMenuItem"; - this.exportTexturesToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.exportTexturesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.exportTexturesToolStripMenuItem.Text = "Export TXD Archive"; this.exportTexturesToolStripMenuItem.Click += new System.EventHandler(this.exportTexturesToolStripMenuItem_Click); // // importTXDArchiveToolStripMenuItem // this.importTXDArchiveToolStripMenuItem.Name = "importTXDArchiveToolStripMenuItem"; - this.importTXDArchiveToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.importTXDArchiveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.importTXDArchiveToolStripMenuItem.Text = "Import TXD Archive"; this.importTXDArchiveToolStripMenuItem.Click += new System.EventHandler(this.importTXDArchiveToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(178, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6); // // closeToolStripMenuItem // this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(181, 22); + this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // @@ -503,9 +474,6 @@ private void InitializeComponent() private System.Windows.Forms.Button buttonView; private System.Windows.Forms.ToolStripMenuItem clickThisToolStripMenuItem; private System.Windows.Forms.Button buttonInternalEdit; - private System.Windows.Forms.ToolStripMenuItem displayModeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem assetNameAssetIDToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem assetIDAssetNameToolStripMenuItem; private System.Windows.Forms.TextBox textBoxFindAsset; private System.Windows.Forms.Label label3; private System.Windows.Forms.ToolStripMenuItem importTXDArchiveToolStripMenuItem; diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs index 862ff283..cd40d2c2 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs @@ -90,8 +90,13 @@ private void closeToolStripMenuItem_Click(object sender, EventArgs e) if (result == DialogResult.Yes) archive.Save(); } + CloseArchiveEditor(); + } + + public void CloseArchiveEditor() + { archive.Dispose(); - + Program.MainForm.CloseAssetEditor(this); Close(); } @@ -546,30 +551,6 @@ private void textBoxFindAsset_TextChanged(object sender, EventArgs e) private void fileToolStripMenuItem_Click(object sender, EventArgs e) { clickThisToolStripMenuItem.Visible = false; - if (MainForm.alternateNamingMode) - { - assetIDAssetNameToolStripMenuItem.Checked = true; - assetNameAssetIDToolStripMenuItem.Checked = false; - } - else - { - assetIDAssetNameToolStripMenuItem.Checked = false; - assetNameAssetIDToolStripMenuItem.Checked = true; - } - } - - private void assetNameAssetIDToolStripMenuItem_Click(object sender, EventArgs e) - { - assetIDAssetNameToolStripMenuItem.Checked = false; - assetNameAssetIDToolStripMenuItem.Checked = true; - MainForm.alternateNamingMode = false; - } - - private void assetIDAssetNameToolStripMenuItem_Click(object sender, EventArgs e) - { - assetIDAssetNameToolStripMenuItem.Checked = true; - assetNameAssetIDToolStripMenuItem.Checked = false; - MainForm.alternateNamingMode = true; } private void exportTexturesToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/IndustrialPark/MainForm/AboutBox.Designer.cs b/IndustrialPark/MainForm/AboutBox.Designer.cs index 0e6f2d04..35944baa 100644 --- a/IndustrialPark/MainForm/AboutBox.Designer.cs +++ b/IndustrialPark/MainForm/AboutBox.Designer.cs @@ -103,7 +103,7 @@ private void InitializeComponent() this.labelVersion.Name = "labelVersion"; this.labelVersion.Size = new System.Drawing.Size(271, 17); this.labelVersion.TabIndex = 0; - this.labelVersion.Text = "Preview 13"; + this.labelVersion.Text = "Preview 14"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCopyright diff --git a/IndustrialPark/MainForm/Json/ProjectJson.cs b/IndustrialPark/MainForm/Json/ProjectJson.cs index c7c95ccf..7ab2ab63 100644 --- a/IndustrialPark/MainForm/Json/ProjectJson.cs +++ b/IndustrialPark/MainForm/Json/ProjectJson.cs @@ -28,32 +28,68 @@ public class ProjectJson public bool UseLegacyAssetIDFormat; public bool AlternateNameDisplayMode; - public bool renderLevelModel; - public bool renderBOUL; - public bool renderBUTN; - public bool renderCAM; - public bool renderDSTR; - public bool renderMRKR; - public bool renderMVPT; - public bool renderPKUP; - public bool renderPLAT; - public bool renderPLYR; - public bool renderSFX; - public bool renderSIMP; - public bool renderTRIG; - public bool renderVIL; + public bool dontRenderLevelModel; + public bool dontRenderBOUL; + public bool dontRenderBUTN; + public bool dontRenderCAM; + public bool dontRenderDSTR; + public bool dontRenderMRKR; + public bool dontRenderMVPT; + public bool dontRenderPKUP; + public bool dontRenderPLAT; + public bool dontRenderPLYR; + public bool dontRenderSFX; + public bool dontRenderSIMP; + public bool dontRenderTRIG; + public bool dontRenderVIL; public ProjectJson() { hipPaths = new List(); TextureFolderPaths = new List(); + + CamPos = new Vector3(); + Yaw = 0; + Pitch = 0; + Speed = 5f; + SpeedRot = 5f; + + FieldOfView = MathUtil.PiOverFour; + FarPlane = 10000F; + + NoCulling = false; + Wireframe = false; + + BackgroundColor = new Color4(0.05f, 0.05f, 0.15f, 1f); + WidgetColor = new Vector4(0.2f, 0.6f, 0.8f, 0.55f); + TrigColor = new Vector4(0.3f, 0.8f, 0.7f, 0.4f); + MvptColor = new Vector4(0.7f, 0.2f, 0.6f, 0.5f); + SfxColor = new Vector4(1f, 0.2f, 0.2f, 0.35f); + + UseLegacyAssetIDFormat = false; + AlternateNameDisplayMode = false; + + dontRenderLevelModel = false; + dontRenderBOUL = false; + dontRenderBUTN = false; + dontRenderCAM = false; + dontRenderDSTR = false; + dontRenderMRKR = false; + dontRenderMVPT = false; + dontRenderPKUP = false; + dontRenderPLAT = false; + dontRenderPLYR = false; + dontRenderSFX = false; + dontRenderSIMP = false; + dontRenderTRIG = false; + dontRenderVIL = false; } public ProjectJson(List hipPaths, List textureFolderPaths, Vector3 camPos, float yaw, float pitch, float speed, float speedRot, float fieldOfView, float farPlane, bool noCulling, bool wireframe, Color4 backgroundColor, Vector4 widgetColor, Vector4 trigColor, - Vector4 mvptColor, Vector4 sfxColor, bool useLegacyAssetIDFormat, bool alternateNameDisplayMode, bool renderLevelModel, - bool renderBOUL, bool renderBUTN, bool renderCAM, bool renderDSTR, bool renderMRKR, bool renderMVPT, bool renderPKUP, bool renderPLAT, - bool renderPLYR, bool renderSFX, bool renderSIMP, bool renderTRIG, bool renderVIL) + Vector4 mvptColor, Vector4 sfxColor, bool useLegacyAssetIDFormat, bool alternateNameDisplayMode, bool dontRenderLevelModel, + bool dontRenderBOUL, bool dontRenderBUTN, bool dontRenderCAM, bool dontRenderDSTR, bool dontRenderMRKR, bool dontRenderMVPT, bool dontRenderPKUP, bool dontRenderPLAT, + bool dontRenderPLYR, bool dontRenderSFX, bool dontRenderSIMP, bool dontRenderTRIG, bool dontRenderVIL) { this.hipPaths = hipPaths; TextureFolderPaths = textureFolderPaths; @@ -73,20 +109,20 @@ public ProjectJson(List hipPaths, List textureFolderPaths, Vecto SfxColor = sfxColor; UseLegacyAssetIDFormat = useLegacyAssetIDFormat; AlternateNameDisplayMode = alternateNameDisplayMode; - this.renderLevelModel = renderLevelModel; - this.renderBOUL = renderBOUL; - this.renderBUTN = renderBUTN; - this.renderCAM = renderCAM; - this.renderDSTR = renderDSTR; - this.renderMRKR = renderMRKR; - this.renderMVPT = renderMVPT; - this.renderPKUP = renderPKUP; - this.renderPLAT = renderPLAT; - this.renderPLYR = renderPLYR; - this.renderSFX = renderSFX; - this.renderSIMP = renderSIMP; - this.renderTRIG = renderTRIG; - this.renderVIL = renderVIL; + this.dontRenderLevelModel = dontRenderLevelModel; + this.dontRenderBOUL = dontRenderBOUL; + this.dontRenderBUTN = dontRenderBUTN; + this.dontRenderCAM = dontRenderCAM; + this.dontRenderDSTR = dontRenderDSTR; + this.dontRenderMRKR = dontRenderMRKR; + this.dontRenderMVPT = dontRenderMVPT; + this.dontRenderPKUP = dontRenderPKUP; + this.dontRenderPLAT = dontRenderPLAT; + this.dontRenderPLYR = dontRenderPLYR; + this.dontRenderSFX = dontRenderSFX; + this.dontRenderSIMP = dontRenderSIMP; + this.dontRenderTRIG = dontRenderTRIG; + this.dontRenderVIL = dontRenderVIL; } } } diff --git a/IndustrialPark/MainForm/MainForm.Designer.cs b/IndustrialPark/MainForm/MainForm.Designer.cs index ce348046..34ccfb38 100644 --- a/IndustrialPark/MainForm/MainForm.Designer.cs +++ b/IndustrialPark/MainForm/MainForm.Designer.cs @@ -36,6 +36,7 @@ private void InitializeComponent() this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.projectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -57,8 +58,10 @@ private void InitializeComponent() this.tRIGColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sFXInColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.selectionColorToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.useLegacyAssetIDFormatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.nameDisplayModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.assetNameAssetIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.assetIDAssetNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.displayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -121,6 +124,7 @@ private void InitializeComponent() // projectToolStripMenuItem // this.projectToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem1, this.openToolStripMenuItem, this.saveToolStripMenuItem, this.saveAsToolStripMenuItem, @@ -131,6 +135,13 @@ private void InitializeComponent() this.projectToolStripMenuItem.Size = new System.Drawing.Size(56, 20); this.projectToolStripMenuItem.Text = "Project"; // + // newToolStripMenuItem1 + // + this.newToolStripMenuItem1.Name = "newToolStripMenuItem1"; + this.newToolStripMenuItem1.Size = new System.Drawing.Size(191, 22); + this.newToolStripMenuItem1.Text = "New"; + this.newToolStripMenuItem1.Click += new System.EventHandler(this.newToolStripMenuItem1_Click); + // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; @@ -182,11 +193,11 @@ private void InitializeComponent() this.addTextureFolderToolStripMenuItem, this.clearTexturesToolStripMenuItem, this.toolStripSeparator4, + this.colorsToolStripMenuItem, this.noCullingCToolStripMenuItem, this.wireframeFToolStripMenuItem, - this.colorsToolStripMenuItem, - this.toolStripSeparator1, this.useLegacyAssetIDFormatToolStripMenuItem, + this.nameDisplayModeToolStripMenuItem, this.toolStripSeparator2, this.aboutToolStripMenuItem}); this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; @@ -296,11 +307,6 @@ private void InitializeComponent() this.selectionColorToolStripMenuItem1.Text = "Selection Color..."; this.selectionColorToolStripMenuItem1.Click += new System.EventHandler(this.selectionColorToolStripMenuItem_Click); // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(216, 6); - // // useLegacyAssetIDFormatToolStripMenuItem // this.useLegacyAssetIDFormatToolStripMenuItem.Name = "useLegacyAssetIDFormatToolStripMenuItem"; @@ -308,6 +314,31 @@ private void InitializeComponent() this.useLegacyAssetIDFormatToolStripMenuItem.Text = "Use Legacy Asset ID Format"; this.useLegacyAssetIDFormatToolStripMenuItem.Click += new System.EventHandler(this.useLegacyAssetIDFormatToolStripMenuItem_Click); // + // nameDisplayModeToolStripMenuItem + // + this.nameDisplayModeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.assetNameAssetIDToolStripMenuItem, + this.assetIDAssetNameToolStripMenuItem}); + this.nameDisplayModeToolStripMenuItem.Name = "nameDisplayModeToolStripMenuItem"; + this.nameDisplayModeToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.nameDisplayModeToolStripMenuItem.Text = "Name Display Mode"; + // + // assetNameAssetIDToolStripMenuItem + // + this.assetNameAssetIDToolStripMenuItem.Checked = true; + this.assetNameAssetIDToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.assetNameAssetIDToolStripMenuItem.Name = "assetNameAssetIDToolStripMenuItem"; + this.assetNameAssetIDToolStripMenuItem.Size = new System.Drawing.Size(184, 22); + this.assetNameAssetIDToolStripMenuItem.Text = "AssetName [AssetID]"; + this.assetNameAssetIDToolStripMenuItem.Click += new System.EventHandler(this.assetNameAssetIDToolStripMenuItem_Click); + // + // assetIDAssetNameToolStripMenuItem + // + this.assetIDAssetNameToolStripMenuItem.Name = "assetIDAssetNameToolStripMenuItem"; + this.assetIDAssetNameToolStripMenuItem.Size = new System.Drawing.Size(184, 22); + this.assetIDAssetNameToolStripMenuItem.Text = "[AssetID] AssetName"; + this.assetIDAssetNameToolStripMenuItem.Click += new System.EventHandler(this.assetIDAssetNameToolStripMenuItem_Click); + // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; @@ -535,7 +566,6 @@ private void InitializeComponent() private ToolStripMenuItem noCullingCToolStripMenuItem; private ToolStripMenuItem wireframeFToolStripMenuItem; private ToolStripMenuItem viewConfigToolStripMenuItem; - private ToolStripSeparator toolStripSeparator1; private ToolStripMenuItem archiveEditorToolStripMenuItem; private ToolStripMenuItem newToolStripMenuItem; private ToolStripSeparator toolStripSeparator3; @@ -575,6 +605,10 @@ private void InitializeComponent() private ToolStripMenuItem mVPTColorToolStripMenuItem; private ToolStripMenuItem tRIGColorToolStripMenuItem; private ToolStripMenuItem sFXInColorToolStripMenuItem; + private ToolStripMenuItem newToolStripMenuItem1; + private ToolStripMenuItem nameDisplayModeToolStripMenuItem; + private ToolStripMenuItem assetNameAssetIDToolStripMenuItem; + private ToolStripMenuItem assetIDAssetNameToolStripMenuItem; } } diff --git a/IndustrialPark/MainForm/MainForm.cs b/IndustrialPark/MainForm/MainForm.cs index 6369962e..33362a4e 100644 --- a/IndustrialPark/MainForm/MainForm.cs +++ b/IndustrialPark/MainForm/MainForm.cs @@ -22,7 +22,7 @@ public MainForm() } private string pathToSettings = "ip_settings.json"; - private string currentProjectPath = "default_project.json"; + private string currentProjectPath; private void MainForm_Load(object sender, EventArgs e) { @@ -47,7 +47,7 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (UnsavedChanges()) { - DialogResult result = MessageBox.Show("You appear to have unsaved changes in one of your Archive Editors. Do you still wish to close and lose unsaved data?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + DialogResult result = MessageBox.Show("You appear to have unsaved changes in one of your Archive Editors. Do you still wish to close them and lose unsaved data?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.No) { e.Cancel = true; @@ -65,11 +65,32 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e) File.WriteAllText(pathToSettings, JsonConvert.SerializeObject(settings, Formatting.Indented)); if (autoSaveOnClosingToolStripMenuItem.Checked & !string.IsNullOrWhiteSpace(currentProjectPath)) - SaveProject(); + { + SaveProject(currentProjectPath); + } + } + + private void newToolStripMenuItem1_Click(object sender, EventArgs e) + { + if (UnsavedChanges()) + { + DialogResult result = MessageBox.Show("You appear to have unsaved changes in one of your Archive Editors. Do you still wish to close the and lose unsaved data?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (result == DialogResult.No) + return; + } + + ApplySettings(new ProjectJson()); } private void openToolStripMenuItem_Click(object sender, EventArgs e) { + if (UnsavedChanges()) + { + DialogResult result = MessageBox.Show("You appear to have unsaved changes in one of your Archive Editors. Do you still wish to close the and lose unsaved data?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (result == DialogResult.No) + return; + } + OpenFileDialog openFile = new OpenFileDialog() { Filter = "JSON files|*.json" }; @@ -96,6 +117,8 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) private void SaveProject(string fileName) { + if (fileName == null) + fileName = "default_project.json"; currentProjectPath = fileName; SaveProject(); } @@ -138,12 +161,19 @@ private void ApplySettings(string ipSettingsPath) private void ApplySettings(ProjectJson ipSettings) { + TextureManager.ClearTextures(); + foreach (string s in ipSettings.TextureFolderPaths) if (Directory.Exists(s)) TextureManager.LoadTexturesFromFolder(s); else MessageBox.Show("Error loading textures from " + s + ": folder not found"); + List aeList = new List(); + aeList.AddRange(archiveEditors); + foreach (ArchiveEditor ae in aeList) + ae.CloseArchiveEditor(); + foreach (string s in ipSettings.hipPaths) if (s == "Empty") AddArchiveEditor(); @@ -184,47 +214,50 @@ private void ApplySettings(ProjectJson ipSettings) useLegacyAssetIDFormatToolStripMenuItem.Checked = ipSettings.UseLegacyAssetIDFormat; alternateNamingMode = ipSettings.AlternateNameDisplayMode; - levelModelToolStripMenuItem.Checked = !ipSettings.renderLevelModel; - AssetJSP.dontRender = ipSettings.renderLevelModel; + assetIDAssetNameToolStripMenuItem.Checked = alternateNamingMode; + assetNameAssetIDToolStripMenuItem.Checked = !alternateNamingMode; - bOULToolStripMenuItem.Checked = !ipSettings.renderBOUL; - AssetBOUL.dontRender = ipSettings.renderBOUL; + levelModelToolStripMenuItem.Checked = !ipSettings.dontRenderLevelModel; + AssetJSP.dontRender = ipSettings.dontRenderLevelModel; - bUTNToolStripMenuItem.Checked = !ipSettings.renderBUTN; - AssetBUTN.dontRender = ipSettings.renderBUTN; + bOULToolStripMenuItem.Checked = !ipSettings.dontRenderBOUL; + AssetBOUL.dontRender = ipSettings.dontRenderBOUL; - cAMToolStripMenuItem.Checked = !ipSettings.renderCAM; - AssetCAM.dontRender = ipSettings.renderCAM; + bUTNToolStripMenuItem.Checked = !ipSettings.dontRenderBUTN; + AssetBUTN.dontRender = ipSettings.dontRenderBUTN; - dSTRToolStripMenuItem.Checked = !ipSettings.renderDSTR; - AssetDSTR.dontRender = ipSettings.renderDSTR; + cAMToolStripMenuItem.Checked = !ipSettings.dontRenderCAM; + AssetCAM.dontRender = ipSettings.dontRenderCAM; - mRKRToolStripMenuItem.Checked = !ipSettings.renderMRKR; - AssetMRKR.dontRender = ipSettings.renderMRKR; + dSTRToolStripMenuItem.Checked = !ipSettings.dontRenderDSTR; + AssetDSTR.dontRender = ipSettings.dontRenderDSTR; - mVPTToolStripMenuItem.Checked = !ipSettings.renderMVPT; - AssetMVPT.dontRender = ipSettings.renderMVPT; + mRKRToolStripMenuItem.Checked = !ipSettings.dontRenderMRKR; + AssetMRKR.dontRender = ipSettings.dontRenderMRKR; - pKUPToolStripMenuItem.Checked = !ipSettings.renderPKUP; - AssetPKUP.dontRender = ipSettings.renderPKUP; + mVPTToolStripMenuItem.Checked = !ipSettings.dontRenderMVPT; + AssetMVPT.dontRender = ipSettings.dontRenderMVPT; - pLATToolStripMenuItem.Checked = !ipSettings.renderPLAT; - AssetPLAT.dontRender = ipSettings.renderPLAT; + pKUPToolStripMenuItem.Checked = !ipSettings.dontRenderPKUP; + AssetPKUP.dontRender = ipSettings.dontRenderPKUP; - pLYRToolStripMenuItem.Checked = !ipSettings.renderPLYR; - AssetPLYR.dontRender = ipSettings.renderPLYR; + pLATToolStripMenuItem.Checked = !ipSettings.dontRenderPLAT; + AssetPLAT.dontRender = ipSettings.dontRenderPLAT; - sFXToolStripMenuItem.Checked = !ipSettings.renderSFX; - AssetSFX.dontRender = ipSettings.renderSFX; + pLYRToolStripMenuItem.Checked = !ipSettings.dontRenderPLYR; + AssetPLYR.dontRender = ipSettings.dontRenderPLYR; - sIMPToolStripMenuItem.Checked = !ipSettings.renderSIMP; - AssetSIMP.dontRender = ipSettings.renderSIMP; + sFXToolStripMenuItem.Checked = !ipSettings.dontRenderSFX; + AssetSFX.dontRender = ipSettings.dontRenderSFX; - tRIGToolStripMenuItem.Checked = !ipSettings.renderTRIG; - AssetTRIG.dontRender = ipSettings.renderTRIG; + sIMPToolStripMenuItem.Checked = !ipSettings.dontRenderSIMP; + AssetSIMP.dontRender = ipSettings.dontRenderSIMP; - vILToolStripMenuItem.Checked = !ipSettings.renderVIL; - AssetVIL.dontRender = ipSettings.renderVIL; + tRIGToolStripMenuItem.Checked = !ipSettings.dontRenderTRIG; + AssetTRIG.dontRender = ipSettings.dontRenderTRIG; + + vILToolStripMenuItem.Checked = !ipSettings.dontRenderVIL; + AssetVIL.dontRender = ipSettings.dontRenderVIL; } public void SetToolStripStatusLabel(string Text) @@ -681,5 +714,19 @@ private void useLegacyAssetIDFormatToolStripMenuItem_Click(object sender, EventA useLegacyAssetIDFormatToolStripMenuItem.Checked = !useLegacyAssetIDFormatToolStripMenuItem.Checked; AssetIDTypeConverter.Legacy = useLegacyAssetIDFormatToolStripMenuItem.Checked; } + + private void assetNameAssetIDToolStripMenuItem_Click(object sender, EventArgs e) + { + assetIDAssetNameToolStripMenuItem.Checked = false; + assetNameAssetIDToolStripMenuItem.Checked = true; + alternateNamingMode = false; + } + + private void assetIDAssetNameToolStripMenuItem_Click(object sender, EventArgs e) + { + assetIDAssetNameToolStripMenuItem.Checked = true; + assetNameAssetIDToolStripMenuItem.Checked = false; + alternateNamingMode = true; + } } } diff --git a/IndustrialPark/SharpDX/SharpRenderer.cs b/IndustrialPark/SharpDX/SharpRenderer.cs index 64741b4b..451f9400 100644 --- a/IndustrialPark/SharpDX/SharpRenderer.cs +++ b/IndustrialPark/SharpDX/SharpRenderer.cs @@ -213,6 +213,7 @@ public void SetSfxColor(Vector4 widgetColor) public void ResetColors() { + backgroundColor = new Color4(0.05f, 0.05f, 0.15f, 1f); normalColor = new Vector4(0.2f, 0.6f, 0.8f, 0.55f); trigColor = new Vector4(0.3f, 0.8f, 0.7f, 0.4f); mvptColor = new Vector4(0.7f, 0.2f, 0.6f, 0.5f); @@ -274,7 +275,7 @@ public void DrawSphere(Matrix world, bool isSelected, Vector4 normalColor) } public Matrix viewProjection; - public Color4 backgroundColor = new Color4(0.05f, 0.05f, 0.15f, 1f); + public Color4 backgroundColor; public BoundingFrustum frustum; public void RunMainLoop(Panel Panel)