diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index d84de86a..71b63074 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 11025980..6da59415 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 9ccf06c4..80f0b0fc 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/FileFormats/Archives/TMPK.cs b/Switch_FileFormatsMain/FileFormats/Archives/TMPK.cs index 8d042bbe..96df034e 100644 --- a/Switch_FileFormatsMain/FileFormats/Archives/TMPK.cs +++ b/Switch_FileFormatsMain/FileFormats/Archives/TMPK.cs @@ -53,6 +53,9 @@ namespace FirstPlugin public void Load(System.IO.Stream stream) { + TPFileSizeTable table = new TPFileSizeTable(); + table.Read(new FileReader("G:\\Wii U\\DATA\\USA\\GAMES\\THE LEGEND OF ZELDA Twilight Princess HD[000500001019E500]\\content\\FileSizeList.txt")); + Text = FileName; CanSave = true; diff --git a/Switch_FileFormatsMain/FileFormats/SizeLists/TPFileSizeTable.cs b/Switch_FileFormatsMain/FileFormats/SizeLists/TPFileSizeTable.cs new file mode 100644 index 00000000..1ddaf8c2 --- /dev/null +++ b/Switch_FileFormatsMain/FileFormats/SizeLists/TPFileSizeTable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Switch_Toolbox.Library.IO; +using Syroot.BinaryData; + +namespace FirstPlugin +{ + public class TPFileSizeTable + { + public Dictionary FileSizes = new Dictionary(); + + public void Read(FileReader reader) + { + while (reader.Position < reader.BaseStream.Length) + { + string FileName = reader.ReadString(BinaryStringFormat.ZeroTerminated); + string Size = reader.ReadString(BinaryStringFormat.ZeroTerminated); + + uint sizeNum = 0; + uint.TryParse(Size, out sizeNum); + FileSizes.Add(FileName, sizeNum); + + Console.WriteLine(FileName + " " + Size); + } + } + } +} diff --git a/Switch_FileFormatsMain/Switch_FileFormatsMain.csproj b/Switch_FileFormatsMain/Switch_FileFormatsMain.csproj index 9361dca6..a43ecf90 100644 --- a/Switch_FileFormatsMain/Switch_FileFormatsMain.csproj +++ b/Switch_FileFormatsMain/Switch_FileFormatsMain.csproj @@ -212,6 +212,7 @@ + diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.CoreCompileInputs.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.CoreCompileInputs.cache index a68e9fe8..c2a39097 100644 --- a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.CoreCompileInputs.cache +++ b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -00baaa26ab24ed622a4872ef7187472151f2eea3 +3b03006b7b29c0b0451fd6a30a22d1a6e904e30f diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index 9538b6e5..0c2a2448 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 b1daf7ae..72db7b1d 100644 --- a/Switch_Toolbox_Library/Config.cs +++ b/Switch_Toolbox_Library/Config.cs @@ -163,6 +163,12 @@ namespace Switch_Toolbox.Library case "Mk8dGamePath": Runtime.Mk8dGamePath = node.InnerText; break; + case "TpGamePath": + Runtime.TpGamePath = node.InnerText; + break; + case "BotwGamePath": + Runtime.BotwGamePath = node.InnerText; + break; case "renderBoundingBoxes": bool.TryParse(node.InnerText, out Runtime.renderBoundingBoxes); break; @@ -309,6 +315,8 @@ namespace Switch_Toolbox.Library PathsNode.AppendChild(createNode(doc, "SmoGamePath", Runtime.SmoGamePath.ToString())); PathsNode.AppendChild(createNode(doc, "Mk8GamePath", Runtime.Mk8GamePath.ToString())); PathsNode.AppendChild(createNode(doc, "Mk8dGamePath", Runtime.Mk8dGamePath.ToString())); + PathsNode.AppendChild(createNode(doc, "TpGamePath", Runtime.TpGamePath.ToString())); + PathsNode.AppendChild(createNode(doc, "BotwGamePath", Runtime.BotwGamePath.ToString())); } private static void AppendEditorSettings(XmlDocument doc, XmlNode parentNode) { diff --git a/Switch_Toolbox_Library/Runtime.cs b/Switch_Toolbox_Library/Runtime.cs index 2416d38f..b922647b 100644 --- a/Switch_Toolbox_Library/Runtime.cs +++ b/Switch_Toolbox_Library/Runtime.cs @@ -18,6 +18,8 @@ namespace Switch_Toolbox.Library public static string Mk8GamePath = ""; public static string Mk8dGamePath = ""; public static string SmoGamePath = ""; + public static string TpGamePath = ""; + public static string BotwGamePath = ""; public class ImageEditor { diff --git a/Toolbox/GUI/Settings.Designer.cs b/Toolbox/GUI/Settings.Designer.cs index f1259ef9..0037b024 100644 --- a/Toolbox/GUI/Settings.Designer.cs +++ b/Toolbox/GUI/Settings.Designer.cs @@ -33,6 +33,7 @@ this.chkBoxNormalMap = new Switch_Toolbox.Library.Forms.STCheckBox(); this.shadingComboBox = new System.Windows.Forms.ComboBox(); this.panel2 = new Switch_Toolbox.Library.Forms.STPanel(); + this.displayBoundingBoxeChk = new Switch_Toolbox.Library.Forms.STCheckBox(); this.boneXRayChk = new Switch_Toolbox.Library.Forms.STCheckBox(); this.stLabel9 = new Switch_Toolbox.Library.Forms.STLabel(); this.cameraMaxSpeedUD = new Switch_Toolbox.Library.Forms.NumericUpDownFloat(); @@ -94,7 +95,10 @@ this.mk8DPathTB = new Switch_Toolbox.Library.Forms.STTextBox(); this.stLabel10 = new Switch_Toolbox.Library.Forms.STLabel(); this.mk8PathTB = new Switch_Toolbox.Library.Forms.STTextBox(); - this.displayBoundingBoxeChk = new Switch_Toolbox.Library.Forms.STCheckBox(); + this.stLabel13 = new Switch_Toolbox.Library.Forms.STLabel(); + this.botwGamePathTB = new Switch_Toolbox.Library.Forms.STTextBox(); + this.stLabel14 = new Switch_Toolbox.Library.Forms.STLabel(); + this.tpGamePathTB = new Switch_Toolbox.Library.Forms.STTextBox(); this.contentContainer.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.cameraMaxSpeedUD)).BeginInit(); @@ -205,6 +209,16 @@ this.panel2.Size = new System.Drawing.Size(534, 293); this.panel2.TabIndex = 4; // + // displayBoundingBoxeChk + // + this.displayBoundingBoxeChk.AutoSize = true; + this.displayBoundingBoxeChk.Location = new System.Drawing.Point(252, 183); + this.displayBoundingBoxeChk.Name = "displayBoundingBoxeChk"; + this.displayBoundingBoxeChk.Size = new System.Drawing.Size(140, 17); + this.displayBoundingBoxeChk.TabIndex = 31; + this.displayBoundingBoxeChk.Text = "Display Bounding Boxes"; + this.displayBoundingBoxeChk.CheckedChanged += new System.EventHandler(this.displayBoundingBoxeChk_CheckedChanged); + // // boneXRayChk // this.boneXRayChk.AutoSize = true; @@ -910,6 +924,10 @@ // // tabPage3 // + this.tabPage3.Controls.Add(this.stLabel13); + this.tabPage3.Controls.Add(this.botwGamePathTB); + this.tabPage3.Controls.Add(this.stLabel14); + this.tabPage3.Controls.Add(this.tpGamePathTB); this.tabPage3.Controls.Add(this.stLabel12); this.tabPage3.Controls.Add(this.SMOPathTB); this.tabPage3.Controls.Add(this.stLabel11); @@ -978,15 +996,41 @@ this.mk8PathTB.TabIndex = 0; this.mk8PathTB.Click += new System.EventHandler(this.mk8PathTB_Click); // - // displayBoundingBoxeChk + // stLabel13 // - this.displayBoundingBoxeChk.AutoSize = true; - this.displayBoundingBoxeChk.Location = new System.Drawing.Point(252, 183); - this.displayBoundingBoxeChk.Name = "displayBoundingBoxeChk"; - this.displayBoundingBoxeChk.Size = new System.Drawing.Size(140, 17); - this.displayBoundingBoxeChk.TabIndex = 31; - this.displayBoundingBoxeChk.Text = "Display Bounding Boxes"; - this.displayBoundingBoxeChk.CheckedChanged += new System.EventHandler(this.displayBoundingBoxeChk_CheckedChanged); + this.stLabel13.AutoSize = true; + this.stLabel13.Location = new System.Drawing.Point(6, 122); + this.stLabel13.Name = "stLabel13"; + this.stLabel13.Size = new System.Drawing.Size(98, 13); + this.stLabel13.TabIndex = 9; + this.stLabel13.Text = "Breath Of The Wild"; + // + // botwGamePathTB + // + this.botwGamePathTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.botwGamePathTB.Location = new System.Drawing.Point(112, 120); + this.botwGamePathTB.Name = "botwGamePathTB"; + this.botwGamePathTB.Size = new System.Drawing.Size(258, 20); + this.botwGamePathTB.TabIndex = 8; + this.botwGamePathTB.TextChanged += new System.EventHandler(this.botwGamePathTB_TextChanged); + // + // stLabel14 + // + this.stLabel14.AutoSize = true; + this.stLabel14.Location = new System.Drawing.Point(6, 96); + this.stLabel14.Name = "stLabel14"; + this.stLabel14.Size = new System.Drawing.Size(105, 13); + this.stLabel14.TabIndex = 7; + this.stLabel14.Text = "Twilight Princess HD"; + // + // tpGamePathTB + // + this.tpGamePathTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.tpGamePathTB.Location = new System.Drawing.Point(112, 94); + this.tpGamePathTB.Name = "tpGamePathTB"; + this.tpGamePathTB.Size = new System.Drawing.Size(258, 20); + this.tpGamePathTB.TabIndex = 6; + this.tpGamePathTB.TextChanged += new System.EventHandler(this.tpGamePathTB_TextChanged); // // Settings // @@ -1095,5 +1139,9 @@ private Switch_Toolbox.Library.Forms.STLabel stLabel10; private Switch_Toolbox.Library.Forms.STTextBox mk8PathTB; private Switch_Toolbox.Library.Forms.STCheckBox displayBoundingBoxeChk; + private Switch_Toolbox.Library.Forms.STLabel stLabel13; + private Switch_Toolbox.Library.Forms.STTextBox botwGamePathTB; + private Switch_Toolbox.Library.Forms.STLabel stLabel14; + private Switch_Toolbox.Library.Forms.STTextBox tpGamePathTB; } } \ No newline at end of file diff --git a/Toolbox/GUI/Settings.cs b/Toolbox/GUI/Settings.cs index a3882beb..edc0b9d2 100644 --- a/Toolbox/GUI/Settings.cs +++ b/Toolbox/GUI/Settings.cs @@ -72,6 +72,9 @@ namespace Toolbox mk8DPathTB.Text = Runtime.Mk8dGamePath; mk8PathTB.Text = Runtime.Mk8GamePath; SMOPathTB.Text = Runtime.SmoGamePath; + botwGamePathTB.Text = Runtime.BotwGamePath; + tpGamePathTB.Text = Runtime.TpGamePath; + displayBoundingBoxeChk.Checked = Runtime.renderBoundingBoxes; mk8DPathTB.ReadOnly = true; @@ -409,6 +412,24 @@ namespace Toolbox } } + private void tpGamePathTB_TextChanged(object sender, EventArgs e) { + FolderSelectDialog sfd = new FolderSelectDialog(); + if (sfd.ShowDialog() == DialogResult.OK) + { + SMOPathTB.Text = sfd.SelectedPath; + Runtime.TpGamePath = SMOPathTB.Text; + } + } + + private void botwGamePathTB_TextChanged(object sender, EventArgs e) { + FolderSelectDialog sfd = new FolderSelectDialog(); + if (sfd.ShowDialog() == DialogResult.OK) + { + SMOPathTB.Text = sfd.SelectedPath; + Runtime.BotwGamePath = SMOPathTB.Text; + } + } + private void displayBoundingBoxeChk_CheckedChanged(object sender, EventArgs e) { Runtime.renderBoundingBoxes = displayBoundingBoxeChk.Checked;