From e5ace7d32524db3b7af6e7766501ea259f6fb761 Mon Sep 17 00:00:00 2001 From: Xferno2 Date: Wed, 24 Nov 2021 20:00:43 +0200 Subject: [PATCH] Fixed issue with new dlc not loading Apparently paradox changed a bit the way dlc data is stored or they just forgot to add quotes to the last dlc path file and that bricked a bit the launcher: - Fixed dlc load for No step back (Requested by: #8 ) --- Hoi4 Launcher/Form1.Designer.cs | 1 - Hoi4 Launcher/Form1.cs | 9 ++------- Hoi4 Launcher/Parser/modParser.cs | 10 ---------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Hoi4 Launcher/Form1.Designer.cs b/Hoi4 Launcher/Form1.Designer.cs index 098654a..c7da3fd 100644 --- a/Hoi4 Launcher/Form1.Designer.cs +++ b/Hoi4 Launcher/Form1.Designer.cs @@ -245,7 +245,6 @@ private void InitializeComponent() this.userControl12.TabIndex = 6; this.userControl12.Text = "Clear"; this.userControl12.Click += new System.EventHandler(this.button1_Click); - this.userControl12.Load += new System.EventHandler(this.userControl12_Load); // // list_mods // diff --git a/Hoi4 Launcher/Form1.cs b/Hoi4 Launcher/Form1.cs index 7c84dd1..509de43 100644 --- a/Hoi4 Launcher/Form1.cs +++ b/Hoi4 Launcher/Form1.cs @@ -264,7 +264,7 @@ public void SerializeConfig(object x) var dlc = new dlcModel(); var x = File.ReadLines(dlcFullPath); dlc.name = x.First().Split('"')[1].Replace('"', ' '); - dlc.path = x.ElementAt(1).Split('"')[1].Replace('"', ' ').Split('.').First() + ".dlc"; + dlc.path = x.ElementAt(1).Split('=')[1].Replace('"', ' ').Replace(" ", "").Split('.').First() + ".dlc"; var party = x.ElementAt(x.Count() - 2).Split('=')[1].Replace(" ", ""); if (party == "yes") { dlc._3rdparty = true; userControl11._3rdParty = true; } @@ -506,7 +506,7 @@ private void button1_Click(object sender, EventArgs e) Logger("I'm clear button and I've been clicked"); //categoriesBox.DroppedDown = false; textBox2.Text = ""; - categoriesBox.SelectedIndex = 0; + categoriesBox.SelectedIndex = -1; } private void button2_Click(object sender, EventArgs e) @@ -555,11 +555,6 @@ private void list_mods_CellContentClick(object sender, DataGridViewCellEventArgs } - private void userControl12_Load(object sender, EventArgs e) - { - - } - private void panel1_Paint(object sender, PaintEventArgs e) { diff --git a/Hoi4 Launcher/Parser/modParser.cs b/Hoi4 Launcher/Parser/modParser.cs index 7797ad3..aa34ad7 100644 --- a/Hoi4 Launcher/Parser/modParser.cs +++ b/Hoi4 Launcher/Parser/modParser.cs @@ -68,16 +68,6 @@ public bool createDescriptorFile(string path, string savePath, string id) { try { - //using (ZipArchive archive = ZipFile.OpenRead(zipFile.FullName)) - //{ - // ZipArchiveEntry descriptor = archive.GetEntry("descriptor.mod"); - // descriptor.ExtractToFile(@"descriptor.mod"); - // var textStream = descriptor.Open(); - // StreamReader reader = new StreamReader(textStream); - // var descriptorFile = editDescriptor(reader.ReadToEnd(), zipFile.FullName); - // System.IO.File.WriteAllLines(savePath + "\\ugc_" + id + ".mod", descriptorFile); - //} - using (Stream stream = File.OpenRead(zipFile.FullName)) using (var reader = ReaderFactory.Open(stream)) {