Merge pull request #279 from wabbajack-tools/duplicate-key-ini-fix

Implement fix for duplicate key error in FNV
This commit is contained in:
Timothy Baldridge 2019-12-16 13:31:50 -07:00 committed by GitHub
commit 9bae8a9c22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ using System.Threading;
using System.Windows;
using Alphaleonis.Win32.Filesystem;
using IniParser;
using IniParser.Model.Configuration;
using IniParser.Parser;
using Wabbajack.Common;
using Wabbajack.Lib.CompilationSteps.CompilationErrors;
@ -283,10 +284,11 @@ namespace Wabbajack.Lib
private void SetScreenSizeInPrefs()
{
var config = new IniParserConfiguration {AllowDuplicateKeys = true};
foreach (var file in Directory.EnumerateFiles(Path.Combine(OutputFolder, "profiles"), "*refs.ini",
DirectoryEnumerationOptions.Recursive))
{
var parser = new FileIniDataParser();
var parser = new FileIniDataParser(new IniDataParser(config));
var data = parser.ReadFile(file);
if (data.Sections["Display"]["iSize W"] != null && data.Sections["Display"]["iSize H"] != null)
{

View File

@ -143,6 +143,8 @@ namespace Wabbajack.Test
new List<string>
{
"[Display]",
"STestFile=f",
"STestFile=",
"iSize H=3",
"iSize W=-200"
});