formatting fixes

This commit is contained in:
Adam 2021-02-15 21:23:18 +11:00
parent 41b02abc2f
commit 729ef7fea7
2 changed files with 48 additions and 41 deletions

View file

@ -118,7 +118,8 @@ namespace Penumbra.Mods
// fixup path // fixup path
var baseDir = mod.ModBasePath.FullName; var baseDir = mod.ModBasePath.FullName;
if(settings.Conf == null) { if( settings.Conf == null )
{
settings.Conf = new(); settings.Conf = new();
_plugin.ModManager.Mods.Save(); _plugin.ModManager.Mods.Save();
} }
@ -128,12 +129,14 @@ namespace Penumbra.Mods
var relativeFilePath = file.FullName.Substring( baseDir.Length ).TrimStart( '\\' ); var relativeFilePath = file.FullName.Substring( baseDir.Length ).TrimStart( '\\' );
bool doNotAdd = false; bool doNotAdd = false;
void AddFiles( HashSet< string > gamePaths ) void AddFiles( HashSet< string > gamePaths )
{ {
doNotAdd = true; doNotAdd = true;
foreach( var gamePath in gamePaths ) foreach( var gamePath in gamePaths )
{ {
if( !ResolvedFiles.ContainsKey( gamePath ) ) { if( !ResolvedFiles.ContainsKey( gamePath ) )
{
ResolvedFiles[ gamePath.ToLowerInvariant() ] = file; ResolvedFiles[ gamePath.ToLowerInvariant() ] = file;
registeredFiles[ gamePath ] = mod.Meta.Name; registeredFiles[ gamePath ] = mod.Meta.Name;
} }
@ -179,6 +182,7 @@ namespace Penumbra.Mods
} }
} }
} }
break; break;
case SelectType.Multi: case SelectType.Multi:
for( var i = 0; i < group.Options.Count; ++i ) for( var i = 0; i < group.Options.Count; ++i )
@ -191,9 +195,11 @@ namespace Penumbra.Mods
else if( group.Options[ i ].OptionFiles.ContainsKey( relativeFilePath ) ) else if( group.Options[ i ].OptionFiles.ContainsKey( relativeFilePath ) )
doNotAdd = true; doNotAdd = true;
} }
break; break;
} }
} }
if( !doNotAdd ) if( !doNotAdd )
AddFiles( new() { relativeFilePath.Replace( '\\', '/' ) } ); AddFiles( new() { relativeFilePath.Replace( '\\', '/' ) } );
} }
@ -213,6 +219,7 @@ namespace Penumbra.Mods
} }
} }
} }
_plugin.GameUtils.ReloadPlayerResources(); _plugin.GameUtils.ReloadPlayerResources();
} }