diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index b6472ff8..3e99c826 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 7cf1d63b..04509071 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index df267e3f..d60b8397 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 46822fa9..0a19d8f5 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index 1b82ca20..7d27d4c8 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Switch_Toolbox_Library/Config.cs b/Switch_Toolbox_Library/Config.cs index 3a164479..8cab483c 100644 --- a/Switch_Toolbox_Library/Config.cs +++ b/Switch_Toolbox_Library/Config.cs @@ -234,6 +234,9 @@ namespace Switch_Toolbox.Library case "UseDirectXTexDecoder": bool.TryParse(node.InnerText, out Runtime.UseDirectXTexDecoder); break; + case "AlwaysCompressOnSave": + bool.TryParse(node.InnerText, out Runtime.AlwaysCompressOnSave); + break; } } } @@ -357,6 +360,7 @@ namespace Switch_Toolbox.Library parentNode.AppendChild(mainSettingsNode); mainSettingsNode.AppendChild(createNode(doc, "UseDirectXTexDecoder", Runtime.UseDirectXTexDecoder.ToString())); + mainSettingsNode.AppendChild(createNode(doc, "AlwaysCompressOnSave", Runtime.AlwaysCompressOnSave.ToString())); mainSettingsNode.AppendChild(createNode(doc, "DisplayViewport", Runtime.DisplayViewport.ToString())); mainSettingsNode.AppendChild(createNode(doc, "UseOpenGL", Runtime.UseOpenGL.ToString())); mainSettingsNode.AppendChild(createNode(doc, "UseDebugDomainExceptionHandler", Runtime.UseDebugDomainExceptionHandler.ToString())); diff --git a/Switch_Toolbox_Library/IO/STFileSaver.cs b/Switch_Toolbox_Library/IO/STFileSaver.cs index c39af6b6..399552f4 100644 --- a/Switch_Toolbox_Library/IO/STFileSaver.cs +++ b/Switch_Toolbox_Library/IO/STFileSaver.cs @@ -209,9 +209,16 @@ namespace Switch_Toolbox.Library.IO if (EnableDialog && FileIsCompressed) { - DialogResult save = MessageBox.Show($"Compress file with {CompressionType}?", "File Save", MessageBoxButtons.YesNo); + bool CompressFile = false; + if (Runtime.AlwaysCompressOnSave) + CompressFile = true; + else + { + DialogResult save = MessageBox.Show($"Compress file with {CompressionType}?", "File Save", MessageBoxButtons.YesNo); + CompressFile = (save == DialogResult.Yes); + } - if (save == DialogResult.Yes) + if (CompressFile) { switch (CompressionType) { diff --git a/Switch_Toolbox_Library/Runtime.cs b/Switch_Toolbox_Library/Runtime.cs index 88de49e4..d8cedbfd 100644 --- a/Switch_Toolbox_Library/Runtime.cs +++ b/Switch_Toolbox_Library/Runtime.cs @@ -19,6 +19,8 @@ namespace Switch_Toolbox.Library public static bool DEVELOPER_DEBUG_MODE = false; + public static bool AlwaysCompressOnSave = false; + public static class ResourceTables { public static bool TpTable = false; diff --git a/Toolbox/GUI/Settings.Designer.cs b/Toolbox/GUI/Settings.Designer.cs index c4b49c63..ce2a3e78 100644 --- a/Toolbox/GUI/Settings.Designer.cs +++ b/Toolbox/GUI/Settings.Designer.cs @@ -80,6 +80,8 @@ this.stTabControl1 = new Switch_Toolbox.Library.Forms.STTabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.chkAlwaysCompressOnSave = new Switch_Toolbox.Library.Forms.STCheckBox(); + this.chkFrameCamera = new Switch_Toolbox.Library.Forms.STCheckBox(); this.modelLoadArchive = new Switch_Toolbox.Library.Forms.STCheckBox(); this.gridCellCountUD = new Switch_Toolbox.Library.Forms.NumericUpDownUint(); this.stLabel7 = new Switch_Toolbox.Library.Forms.STLabel(); @@ -117,7 +119,6 @@ this.chkTpFileTable = new Switch_Toolbox.Library.Forms.STCheckBox(); this.stLabel17 = new Switch_Toolbox.Library.Forms.STLabel(); this.chkBotwFileTable = new Switch_Toolbox.Library.Forms.STCheckBox(); - this.chkFrameCamera = new Switch_Toolbox.Library.Forms.STCheckBox(); this.contentContainer.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.cameraMaxSpeedUD)).BeginInit(); @@ -832,6 +833,7 @@ // // tabPage2 // + this.tabPage2.Controls.Add(this.chkAlwaysCompressOnSave); this.tabPage2.Controls.Add(this.chkFrameCamera); this.tabPage2.Controls.Add(this.modelLoadArchive); this.tabPage2.Controls.Add(this.gridCellCountUD); @@ -854,6 +856,30 @@ this.tabPage2.Text = "Editor"; this.tabPage2.UseVisualStyleBackColor = true; // + // chkAlwaysCompressOnSave + // + this.chkAlwaysCompressOnSave.AutoSize = true; + this.chkAlwaysCompressOnSave.Location = new System.Drawing.Point(9, 210); + this.chkAlwaysCompressOnSave.Name = "chkAlwaysCompressOnSave"; + this.chkAlwaysCompressOnSave.Size = new System.Drawing.Size(219, 17); + this.chkAlwaysCompressOnSave.TabIndex = 19; + this.chkAlwaysCompressOnSave.Text = "Always compress on save (if used on file)"; + this.chkAlwaysCompressOnSave.TextAlign = System.Drawing.ContentAlignment.TopLeft; + this.chkAlwaysCompressOnSave.UseVisualStyleBackColor = true; + this.chkAlwaysCompressOnSave.CheckedChanged += new System.EventHandler(this.chkAlwaysCompressOnSave_CheckedChanged); + // + // chkFrameCamera + // + this.chkFrameCamera.AutoSize = true; + this.chkFrameCamera.Location = new System.Drawing.Point(9, 233); + this.chkFrameCamera.Name = "chkFrameCamera"; + this.chkFrameCamera.Size = new System.Drawing.Size(210, 17); + this.chkFrameCamera.TabIndex = 18; + this.chkFrameCamera.Text = "Center camera to model when selected"; + this.chkFrameCamera.TextAlign = System.Drawing.ContentAlignment.TopLeft; + this.chkFrameCamera.UseVisualStyleBackColor = true; + this.chkFrameCamera.CheckedChanged += new System.EventHandler(this.chkFrameCamera_CheckedChanged); + // // modelLoadArchive // this.modelLoadArchive.AutoSize = true; @@ -1254,18 +1280,6 @@ this.chkBotwFileTable.UseVisualStyleBackColor = true; this.chkBotwFileTable.CheckedChanged += new System.EventHandler(this.chkBotwFileTable_CheckedChanged); // - // chkFrameCamera - // - this.chkFrameCamera.AutoSize = true; - this.chkFrameCamera.Location = new System.Drawing.Point(9, 208); - this.chkFrameCamera.Name = "chkFrameCamera"; - this.chkFrameCamera.Size = new System.Drawing.Size(210, 17); - this.chkFrameCamera.TabIndex = 18; - this.chkFrameCamera.Text = "Center camera to model when selected"; - this.chkFrameCamera.TextAlign = System.Drawing.ContentAlignment.TopLeft; - this.chkFrameCamera.UseVisualStyleBackColor = true; - this.chkFrameCamera.CheckedChanged += new System.EventHandler(this.chkFrameCamera_CheckedChanged); - // // Settings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1401,5 +1415,6 @@ private Switch_Toolbox.Library.Forms.STLabel stLabel17; private Switch_Toolbox.Library.Forms.STCheckBox chkBotwFileTable; private Switch_Toolbox.Library.Forms.STCheckBox chkFrameCamera; + private Switch_Toolbox.Library.Forms.STCheckBox chkAlwaysCompressOnSave; } } \ No newline at end of file diff --git a/Toolbox/GUI/Settings.cs b/Toolbox/GUI/Settings.cs index f8101745..bcde9dd4 100644 --- a/Toolbox/GUI/Settings.cs +++ b/Toolbox/GUI/Settings.cs @@ -88,6 +88,7 @@ namespace Toolbox chkBotwFileTable.Checked = Runtime.ResourceTables.BotwTable; chkTpFileTable.Checked = Runtime.ResourceTables.TpTable; chkFrameCamera.Checked = Runtime.FrameCamera; + chkAlwaysCompressOnSave.Checked = Runtime.AlwaysCompressOnSave; displayBoundingBoxeChk.Checked = Runtime.renderBoundingBoxes; @@ -656,5 +657,9 @@ namespace Toolbox private void chkFrameCamera_CheckedChanged(object sender, EventArgs e) { Runtime.FrameCamera = chkFrameCamera.Checked; } + + private void chkAlwaysCompressOnSave_CheckedChanged(object sender, EventArgs e) { + Runtime.AlwaysCompressOnSave = chkAlwaysCompressOnSave.Checked; + } } }