Some mod movement.

This commit is contained in:
Ottermandias 2023-04-01 14:24:12 +02:00
parent c12dbf3f8a
commit 577669b21f
26 changed files with 726 additions and 732 deletions

View file

@ -33,14 +33,14 @@ public partial class TexToolsImporter
var modList = modListRaw.Select( m => JsonConvert.DeserializeObject< SimpleMod >( m, JsonSettings )! ).ToList();
_currentModDirectory = Mod.Creator.CreateModFolder( _baseDirectory, Path.GetFileNameWithoutExtension( modPackFile.Name ) );
_currentModDirectory = ModCreator.CreateModFolder( _baseDirectory, Path.GetFileNameWithoutExtension( modPackFile.Name ) );
// Create a new ModMeta from the TTMP mod list info
_modManager.DataEditor.CreateMeta( _currentModDirectory, _currentModName, DefaultTexToolsData.Author, DefaultTexToolsData.Description, null, null );
// Open the mod data file from the mod pack as a SqPackStream
_streamDisposer = GetSqPackStreamStream( extractedModPack, "TTMPD.mpd" );
ExtractSimpleModList( _currentModDirectory, modList );
Mod.Creator.CreateDefaultFiles( _currentModDirectory );
ModCreator.CreateDefaultFiles( _currentModDirectory );
ResetStreamDisposer();
return _currentModDirectory;
}
@ -89,7 +89,7 @@ public partial class TexToolsImporter
_currentOptionName = DefaultTexToolsData.DefaultOption;
Penumbra.Log.Information( " -> Importing Simple V2 ModPack" );
_currentModDirectory = Mod.Creator.CreateModFolder( _baseDirectory, _currentModName );
_currentModDirectory = ModCreator.CreateModFolder( _baseDirectory, _currentModName );
_modManager.DataEditor.CreateMeta( _currentModDirectory, _currentModName, modList.Author, string.IsNullOrEmpty( modList.Description )
? "Mod imported from TexTools mod pack"
: modList.Description, modList.Version, modList.Url );
@ -97,7 +97,7 @@ public partial class TexToolsImporter
// Open the mod data file from the mod pack as a SqPackStream
_streamDisposer = GetSqPackStreamStream( extractedModPack, "TTMPD.mpd" );
ExtractSimpleModList( _currentModDirectory, modList.SimpleModsList );
Mod.Creator.CreateDefaultFiles( _currentModDirectory );
ModCreator.CreateDefaultFiles( _currentModDirectory );
ResetStreamDisposer();
return _currentModDirectory;
}
@ -134,7 +134,7 @@ public partial class TexToolsImporter
_currentNumOptions = GetOptionCount( modList );
_currentModName = modList.Name;
_currentModDirectory = Mod.Creator.CreateModFolder( _baseDirectory, _currentModName );
_currentModDirectory = ModCreator.CreateModFolder( _baseDirectory, _currentModName );
_modManager.DataEditor.CreateMeta( _currentModDirectory, _currentModName, modList.Author, modList.Description, modList.Version, modList.Url );
if( _currentNumOptions == 0 )
@ -172,7 +172,7 @@ public partial class TexToolsImporter
{
var name = numGroups == 1 ? _currentGroupName : $"{_currentGroupName}, Part {groupId + 1}";
options.Clear();
var groupFolder = Mod.Creator.NewSubFolderName( _currentModDirectory, name )
var groupFolder = ModCreator.NewSubFolderName( _currentModDirectory, name )
?? new DirectoryInfo( Path.Combine( _currentModDirectory.FullName,
numGroups == 1 ? $"Group {groupPriority + 1}" : $"Group {groupPriority + 1}, Part {groupId + 1}" ) );
@ -182,10 +182,10 @@ public partial class TexToolsImporter
var option = allOptions[ i + optionIdx ];
_token.ThrowIfCancellationRequested();
_currentOptionName = option.Name;
var optionFolder = Mod.Creator.NewSubFolderName( groupFolder, option.Name )
var optionFolder = ModCreator.NewSubFolderName( groupFolder, option.Name )
?? new DirectoryInfo( Path.Combine( groupFolder.FullName, $"Option {i + optionIdx + 1}" ) );
ExtractSimpleModList( optionFolder, option.ModsJsons );
options.Add( Mod.Creator.CreateSubMod( _currentModDirectory, optionFolder, option ) );
options.Add( ModCreator.CreateSubMod( _currentModDirectory, optionFolder, option ) );
if( option.IsChecked )
{
defaultSettings = group.SelectionType == GroupType.Multi
@ -206,12 +206,12 @@ public partial class TexToolsImporter
if( empty != null )
{
_currentOptionName = empty.Name;
options.Insert( 0, Mod.Creator.CreateEmptySubMod( empty.Name ) );
options.Insert( 0, ModCreator.CreateEmptySubMod( empty.Name ) );
defaultSettings = defaultSettings == null ? 0 : defaultSettings.Value + 1;
}
}
Mod.Creator.CreateOptionGroup( _currentModDirectory, group.SelectionType, name, groupPriority, groupPriority,
ModCreator.CreateOptionGroup( _currentModDirectory, group.SelectionType, name, groupPriority, groupPriority,
defaultSettings ?? 0, group.Description, options );
++groupPriority;
}
@ -219,7 +219,7 @@ public partial class TexToolsImporter
}
ResetStreamDisposer();
Mod.Creator.CreateDefaultFiles( _currentModDirectory );
ModCreator.CreateDefaultFiles( _currentModDirectory );
return _currentModDirectory;
}