Skip to content

Commit

Permalink
Merge pull request #34 from 0matyesz0/main
Browse files Browse the repository at this point in the history
Fixed issues regarding to searching and packing encoded w3strings.
  • Loading branch information
nikich340 authored Feb 17, 2023
2 parents 8036799 + a90a380 commit ed8b1d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions WolvenKit.App/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 12 additions & 6 deletions WolvenKit/Forms/frmStringsGuiImporter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
Expand Down Expand Up @@ -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());
}
Expand All @@ -214,4 +220,4 @@ private void Import()
}
}

}
}

0 comments on commit ed8b1d8

Please sign in to comment.