Fix some bugs and start work on new collections tab.

This commit is contained in:
Ottermandias 2023-04-18 18:44:53 +02:00
parent e9fc57022e
commit fba5bc6820
26 changed files with 1346 additions and 717 deletions

View file

@ -8,16 +8,16 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Penumbra.GameData;
using Penumbra.Meta;
using Penumbra.Mods.Manager;
using Penumbra.Services;
namespace Penumbra.Mods.ItemSwap;
public class ItemSwapContainer
{
private readonly MetaFileManager _manager;
private readonly IObjectIdentifier _identifier;
private readonly IdentifierService _identifier;
private Dictionary< Utf8GamePath, FullPath > _modRedirections = new();
private HashSet< MetaManipulation > _modManipulations = new();
@ -114,7 +114,7 @@ public class ItemSwapContainer
}
}
public ItemSwapContainer(MetaFileManager manager, IObjectIdentifier identifier)
public ItemSwapContainer(MetaFileManager manager, IdentifierService identifier)
{
_manager = manager;
_identifier = identifier;
@ -136,7 +136,7 @@ public class ItemSwapContainer
{
Swaps.Clear();
Loaded = false;
var ret = EquipmentSwap.CreateItemSwap( _manager, _identifier, Swaps, PathResolver( collection ), MetaResolver( collection ), from, to, useRightRing, useLeftRing );
var ret = EquipmentSwap.CreateItemSwap( _manager, _identifier.AwaitedService, Swaps, PathResolver( collection ), MetaResolver( collection ), from, to, useRightRing, useLeftRing );
Loaded = true;
return ret;
}
@ -145,7 +145,7 @@ public class ItemSwapContainer
{
Swaps.Clear();
Loaded = false;
var ret = EquipmentSwap.CreateTypeSwap( _manager, _identifier, Swaps, PathResolver( collection ), MetaResolver( collection ), slotFrom, from, slotTo, to );
var ret = EquipmentSwap.CreateTypeSwap( _manager, _identifier.AwaitedService, Swaps, PathResolver( collection ), MetaResolver( collection ), slotFrom, from, slotTo, to );
Loaded = true;
return ret;
}

View file

@ -38,12 +38,6 @@ public class ModDataEditor
_communicatorService = communicatorService;
}
public string MetaFile(Mod mod)
=> _saveService.FileNames.ModMetaPath(mod);
public string DataFile(Mod mod)
=> _saveService.FileNames.LocalDataFile(mod);
/// <summary> Create the file containing the meta information about a mod from scratch. </summary>
public void CreateMeta(DirectoryInfo directory, string? name, string? author, string? description, string? version,
string? website)

View file

@ -220,7 +220,7 @@ public partial class ModCreator
if (!file.Exists)
continue;
var rgsp = TexToolsMeta.FromRgspFile(Penumbra.MetaFileManager, file.FullName, File.ReadAllBytes(file.FullName),
var rgsp = TexToolsMeta.FromRgspFile(_metaFileManager, file.FullName, File.ReadAllBytes(file.FullName),
_config.KeepDefaultMetaChanges);
Penumbra.Log.Verbose(
$"Incorporating {file} as racial scaling file of {rgsp.MetaManipulations.Count} manipulations {deleteString}");