diff --git a/bC7totif/App.config b/bC7totif/App.config index 3646e38..4554b4a 100644 --- a/bC7totif/App.config +++ b/bC7totif/App.config @@ -1,6 +1,8 @@  + +
@@ -8,13 +10,15 @@ + + - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools + diff --git a/bC7totif/MainForm.Designer.cs b/bC7totif/MainForm.Designer.cs index cb3e83a..2909d6a 100644 --- a/bC7totif/MainForm.Designer.cs +++ b/bC7totif/MainForm.Designer.cs @@ -52,6 +52,7 @@ private void InitializeComponent() this.btnRemove = new System.Windows.Forms.Button(); this.btnAdd = new System.Windows.Forms.Button(); this.lbStatus1 = new System.Windows.Forms.Label(); + this.resetSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -66,9 +67,9 @@ private void InitializeComponent() // // btnSelToolPath // - this.btnSelToolPath.Location = new System.Drawing.Point(227, 36); + this.btnSelToolPath.Location = new System.Drawing.Point(227, 39); this.btnSelToolPath.Name = "btnSelToolPath"; - this.btnSelToolPath.Size = new System.Drawing.Size(75, 23); + this.btnSelToolPath.Size = new System.Drawing.Size(75, 20); this.btnSelToolPath.TabIndex = 4; this.btnSelToolPath.Text = "Browse..."; this.btnSelToolPath.UseVisualStyleBackColor = true; @@ -80,13 +81,14 @@ private void InitializeComponent() this.lblToolPath1.ForeColor = System.Drawing.Color.Red; this.lblToolPath1.Location = new System.Drawing.Point(3, 24); this.lblToolPath1.Name = "lblToolPath1"; - this.lblToolPath1.Size = new System.Drawing.Size(53, 13); + this.lblToolPath1.Size = new System.Drawing.Size(97, 13); this.lblToolPath1.TabIndex = 6; - this.lblToolPath1.Text = "Tool Path"; + this.lblToolPath1.Text = "SEUT Tools Folder"; // // lbConsoleOutput // this.lbConsoleOutput.BackColor = System.Drawing.SystemColors.MenuText; + this.lbConsoleOutput.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbConsoleOutput.ForeColor = System.Drawing.Color.Lime; this.lbConsoleOutput.FormattingEnabled = true; this.lbConsoleOutput.Location = new System.Drawing.Point(6, 283); @@ -99,9 +101,9 @@ private void InitializeComponent() this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(7, 267); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(80, 13); + this.label2.Size = new System.Drawing.Size(84, 13); this.label2.TabIndex = 8; - this.label2.Text = "Console Output"; + this.label2.Text = "Console - Status"; // // tbOutputDir // @@ -126,7 +128,8 @@ private void InitializeComponent() // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.loadPresetsToolStripMenuItem}); + this.loadPresetsToolStripMenuItem, + this.resetSettingsToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; @@ -142,7 +145,7 @@ private void InitializeComponent() // this.btnBrowseGameDir.Location = new System.Drawing.Point(227, 117); this.btnBrowseGameDir.Name = "btnBrowseGameDir"; - this.btnBrowseGameDir.Size = new System.Drawing.Size(75, 23); + this.btnBrowseGameDir.Size = new System.Drawing.Size(75, 20); this.btnBrowseGameDir.TabIndex = 11; this.btnBrowseGameDir.Text = "Browse..."; this.btnBrowseGameDir.UseVisualStyleBackColor = true; @@ -151,6 +154,7 @@ private void InitializeComponent() // btnConvert // this.btnConvert.Enabled = false; + this.btnConvert.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnConvert.Location = new System.Drawing.Point(6, 488); this.btnConvert.Name = "btnConvert"; this.btnConvert.Size = new System.Drawing.Size(303, 60); @@ -165,9 +169,9 @@ private void InitializeComponent() this.lblOutputDir.ForeColor = System.Drawing.Color.Red; this.lblOutputDir.Location = new System.Drawing.Point(3, 62); this.lblOutputDir.Name = "lblOutputDir"; - this.lblOutputDir.Size = new System.Drawing.Size(84, 13); + this.lblOutputDir.Size = new System.Drawing.Size(112, 13); this.lblOutputDir.TabIndex = 13; - this.lblOutputDir.Text = "Output Directory"; + this.lblOutputDir.Text = "SEUT Textures Folder"; // // convertProgress // @@ -182,9 +186,9 @@ private void InitializeComponent() this.lblGameDirectory.ForeColor = System.Drawing.Color.Red; this.lblGameDirectory.Location = new System.Drawing.Point(3, 101); this.lblGameDirectory.Name = "lblGameDirectory"; - this.lblGameDirectory.Size = new System.Drawing.Size(80, 13); + this.lblGameDirectory.Size = new System.Drawing.Size(164, 13); this.lblGameDirectory.TabIndex = 15; - this.lblGameDirectory.Text = "Game Directory"; + this.lblGameDirectory.Text = "Space Engineers Textures Folder"; // // tbGameDirectory // @@ -197,9 +201,9 @@ private void InitializeComponent() // // btnBrowseOut // - this.btnBrowseOut.Location = new System.Drawing.Point(227, 76); + this.btnBrowseOut.Location = new System.Drawing.Point(227, 78); this.btnBrowseOut.Name = "btnBrowseOut"; - this.btnBrowseOut.Size = new System.Drawing.Size(75, 23); + this.btnBrowseOut.Size = new System.Drawing.Size(75, 20); this.btnBrowseOut.TabIndex = 17; this.btnBrowseOut.Text = "Browse..."; this.btnBrowseOut.UseVisualStyleBackColor = true; @@ -257,11 +261,18 @@ private void InitializeComponent() this.lbStatus1.TabIndex = 22; this.lbStatus1.Text = "lbStatus1"; // + // resetSettingsToolStripMenuItem + // + this.resetSettingsToolStripMenuItem.Name = "resetSettingsToolStripMenuItem"; + this.resetSettingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.resetSettingsToolStripMenuItem.Text = "Reset Settings "; + this.resetSettingsToolStripMenuItem.Click += new System.EventHandler(this.resetSettingsToolStripMenuItem_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(317, 571); + this.ClientSize = new System.Drawing.Size(317, 554); this.Controls.Add(this.lbStatus1); this.Controls.Add(this.btnAdd); this.Controls.Add(this.btnRemove); @@ -283,7 +294,7 @@ private void InitializeComponent() this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "MainForm"; - this.Text = "Bulk Texture Converter"; + this.Text = "SEUT - Texture Converter"; this.Load += new System.EventHandler(this.MainForm_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); @@ -316,6 +327,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnAdd; private System.Windows.Forms.ToolStripMenuItem loadPresetsToolStripMenuItem; private System.Windows.Forms.Label lbStatus1; + private System.Windows.Forms.ToolStripMenuItem resetSettingsToolStripMenuItem; } } diff --git a/bC7totif/MainForm.cs b/bC7totif/MainForm.cs index 1040099..8f6bfd5 100644 --- a/bC7totif/MainForm.cs +++ b/bC7totif/MainForm.cs @@ -158,6 +158,18 @@ private void btnBrowseGameDir_Click(object sender, EventArgs e) } } + private void resetSettingsToolStripMenuItem_Click(object sender, EventArgs e) + { + appSettings.Default.Reset(); + tbToolPath.Text = ""; + tbOutputDir.Text = ""; + //tbGameDirectory.Text = ""; + tbToolPath.Text = appSettings.Default.toolPath; + tbOutputDir.Text = appSettings.Default.outDir; + tbGameDirectory.Text = appSettings.Default.gamePath; + //appSettings.Default.Save(); + } + private void tbToolPath_TextChanged(object sender, EventArgs e) { toolPath = tbToolPath.Text; @@ -172,6 +184,7 @@ private void tbOutputDir_TextChanged(object sender, EventArgs e) private void tbGameDirectory_TextChanged(object sender, EventArgs e) { + gamePath = tbGameDirectory.Text; updateSettings(); } @@ -212,7 +225,7 @@ public static void doConvertAll() busy = true; // I hate this - var moveDirs = new List { "Models", "Particles", "Voxels", "Sprites", "Miscellaneous", "Lights", "Logo", "GUI", "HUD", "Gizmo", "Decals", "Debug", "BackgroundCube", "FactionLogo", "SunGlare"}; + //var moveDirs = new List { "Models", "Particles", "Voxels", "Sprites", "Miscellaneous", "Lights", "Logo", "GUI", "HUD", "Gizmo", "Decals", "Debug", "BackgroundCube", "FactionLogo", "SunGlare"}; var count = 0; foreach (string obj in Items) { @@ -271,7 +284,8 @@ public static void doConvertAll() var currentFilePath = fileList[i]; var DirName = Path.GetDirectoryName(currentFilePath); var relDir = DirName.Replace(gamePath,""); - var destDir = "temp/" + relDir; + var destDir = outDir + relDir; + //var destDir = "temp/" + relDir; var convFileName = Path.GetFileName(currentFilePath); Directory.CreateDirectory(destDir); currentfiles = i; @@ -283,11 +297,9 @@ public static void doConvertAll() { newProcess.WaitForExit(); } - // Console.WriteLine(cmdArgs); - - // Sorry in advance } + /* foreach (string dir in moveDirs) { try @@ -297,17 +309,20 @@ public static void doConvertAll() } catch { - consoleBuffer.Enqueue("Did not move " + dir + " as it had no converted textures"); + consoleBuffer.Enqueue("Skipped moving " + dir + ", it may already exist"); } } - MessageBox.Show("Done"); + */ + + //Directory.Delete("temp"); + MessageBox.Show("Finished!", "Conversion completed", MessageBoxButtons.OK, MessageBoxIcon.Information); busy = false; } private void btnConvert_Click(object sender, EventArgs e) { -#if !DEBUG + if (!File.Exists(toolPath + "/texconv.exe")) { MessageBox.Show("Cannot find texconv.exe under tool directory.\n\nPlease ensure ModSDK is installed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -318,7 +333,7 @@ private void btnConvert_Click(object sender, EventArgs e) MessageBox.Show("Game path is wrong.\n\nPlease ensure game is installed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } -#endif + Items = lbfolderList.Items; var asyncThreadParamInit = new ThreadStart(doConvertAll); //doConvertAll(); @@ -336,11 +351,12 @@ private void btnAdd_Click(object sender, EventArgs e) var diagRes = appFolderBrowser.ShowDialog(); if (diagRes == DialogResult.OK) { + var pth1 = appFolderBrowser.SelectedPath; var pth2 = pth1.Replace(gamePath + "\\", "\\"); if (pth2 == pth1) { - MessageBox.Show("Path must be inside game directory."); + MessageBox.Show("Path must be inside game directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } lbfolderList.Items.Add(pth2); @@ -365,6 +381,7 @@ private void LoadPresetsToolStripMenuItem_Click(object sender, EventArgs e) { if (File.Exists("presets.ini")) { + lbfolderList.Items.Clear(); var sparr = File.ReadAllLines("presets.ini"); for (int i = 0; i < sparr.Length; i++) @@ -382,8 +399,10 @@ private void LoadPresetsToolStripMenuItem_Click(object sender, EventArgs e) } } else { - MessageBox.Show("presets.ini not found in application directory."); + MessageBox.Show("presets.ini not found in application directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + + } } diff --git a/bC7totif/appSettings.Designer.cs b/bC7totif/appSettings.Designer.cs index 457f559..b7c90e8 100644 --- a/bC7totif/appSettings.Designer.cs +++ b/bC7totif/appSettings.Designer.cs @@ -12,7 +12,7 @@ namespace bulkTexConverter { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] internal sealed partial class appSettings : global::System.Configuration.ApplicationSettingsBase { private static appSettings defaultInstance = ((appSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new appSettings()))); @@ -25,7 +25,7 @@ public static appSettings Default { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("C:\\Program Files (x86)\\Steam\\steamapps\\common\\SpaceEngineers")] + [global::System.Configuration.DefaultSettingValueAttribute("C:\\Program Files (x86)\\Steam\\steamapps\\common\\SpaceEngineers\\Content\\Textures")] public string gamePath { get { return ((string)(this["gamePath"])); @@ -37,8 +37,7 @@ public string gamePath { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("C:\\Program Files (x86)\\Steam\\steamapps\\common\\SpaceEngineersModSDK\\Tools\\TextureP" + - "acking\\Tools")] + [global::System.Configuration.DefaultSettingValueAttribute("")] public string toolPath { get { return ((string)(this["toolPath"])); diff --git a/bC7totif/appSettings.settings b/bC7totif/appSettings.settings index 399141a..4c80180 100644 --- a/bC7totif/appSettings.settings +++ b/bC7totif/appSettings.settings @@ -3,10 +3,10 @@ - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools + diff --git a/bC7totif/bin/Debug/bulkTexConverter.exe b/bC7totif/bin/Debug/bulkTexConverter.exe index 01b5e4f..6c6b97d 100644 Binary files a/bC7totif/bin/Debug/bulkTexConverter.exe and b/bC7totif/bin/Debug/bulkTexConverter.exe differ diff --git a/bC7totif/bin/Debug/bulkTexConverter.exe.config b/bC7totif/bin/Debug/bulkTexConverter.exe.config index 3646e38..4554b4a 100644 --- a/bC7totif/bin/Debug/bulkTexConverter.exe.config +++ b/bC7totif/bin/Debug/bulkTexConverter.exe.config @@ -1,6 +1,8 @@  + +
@@ -8,13 +10,15 @@ + + - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools + diff --git a/bC7totif/bin/Release/bulkTexConverter.exe b/bC7totif/bin/Release/bulkTexConverter.exe index 7e26092..7da21e4 100644 Binary files a/bC7totif/bin/Release/bulkTexConverter.exe and b/bC7totif/bin/Release/bulkTexConverter.exe differ diff --git a/bC7totif/bin/Release/bulkTexConverter.exe.config b/bC7totif/bin/Release/bulkTexConverter.exe.config index 3646e38..4554b4a 100644 --- a/bC7totif/bin/Release/bulkTexConverter.exe.config +++ b/bC7totif/bin/Release/bulkTexConverter.exe.config @@ -1,6 +1,8 @@  + +
@@ -8,13 +10,15 @@ + + - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers + C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures - C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools +