From 3df53bb28eff573f934d90805c9b8df483fbe747 Mon Sep 17 00:00:00 2001 From: Matyas Basa <49882580+0matyesz0@users.noreply.github.com> Date: Fri, 17 Feb 2023 14:40:03 +0100 Subject: [PATCH 1/2] Fix for #32 Fix for After loading the game strings, searching for specific strings will result in a NullReferenceException inside frmStringsGuiImporter.cs. issue ref: #32 --- WolvenKit/Forms/frmStringsGuiImporter.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/WolvenKit/Forms/frmStringsGuiImporter.cs b/WolvenKit/Forms/frmStringsGuiImporter.cs index 930b39ca9..ea17a0d9f 100644 --- a/WolvenKit/Forms/frmStringsGuiImporter.cs +++ b/WolvenKit/Forms/frmStringsGuiImporter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -182,14 +182,20 @@ private void Search() if (matchCaseSearch) foreach (var str in strings) { - if (str[2].Contains(textBoxSearch.Text)) - results.Add(str); + if (str[2] != null) + { + if (str[2].Contains(textBoxSearch.Text)) + results.Add(str); + } } else foreach (var str in strings) { - if (str[2].ToUpper().Contains(textBoxSearch.Text.ToUpper())) - results.Add(str); + if (str[2] != null) + { + if (str[2].ToUpper().Contains(textBoxSearch.Text.ToUpper())) + results.Add(str); + } } FillListView(results.ToList()); } @@ -214,4 +220,4 @@ private void Import() } } -} \ No newline at end of file +} From a90a3804343b08c464ce7a5e0a903242504c8db6 Mon Sep 17 00:00:00 2001 From: Matyas Basa <49882580+0matyesz0@users.noreply.github.com> Date: Fri, 17 Feb 2023 15:29:24 +0100 Subject: [PATCH 2/2] Fix for #33 Fixed #33 issue so packing and copying strings now works like this: If the MOD option is selected, the application should copy the files to the PackedModDirectory not the DLC. --- WolvenKit.App/ViewModels/MainViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WolvenKit.App/ViewModels/MainViewModel.cs b/WolvenKit.App/ViewModels/MainViewModel.cs index 8321a5d0c..00c3970c0 100644 --- a/WolvenKit.App/ViewModels/MainViewModel.cs +++ b/WolvenKit.App/ViewModels/MainViewModel.cs @@ -845,9 +845,9 @@ await t.ContinueWith(antecedent => var files = Directory.GetFiles((ActiveMod.ProjectDirectory + "\\strings")).Where(s => Path.GetExtension(s) == ".w3strings").ToList(); if (packsettings.Strings.Item1) - files.ForEach(x => File.Copy(x, Path.Combine(ActiveMod.PackedDlcDirectory, Path.GetFileName(x)))); - if (packsettings.Strings.Item2) files.ForEach(x => File.Copy(x, Path.Combine(ActiveMod.PackedModDirectory, Path.GetFileName(x)))); + if (packsettings.Strings.Item2) + files.ForEach(x => File.Copy(x, Path.Combine(ActiveMod.PackedDlcDirectory, Path.GetFileName(x)))); } #endregion MainController.Get().StatusProgress = 90;