Update IPC to use better mechanisms for temporary collections without breaking backwards compatibility.

This commit is contained in:
Ottermandias 2022-11-21 16:57:17 +01:00
parent 16a56eb5d0
commit 74ed6edd6f
6 changed files with 106 additions and 19 deletions

View file

@ -151,9 +151,14 @@ public class TempModManager
return RedirectResult.Success;
}
public string CreateTemporaryCollection( string tag, string customName )
public string CreateTemporaryCollection( string name )
{
var collection = ModCollection.CreateNewTemporary( tag, customName );
if( Penumbra.CollectionManager.ByName( name, out _ ) )
{
return string.Empty;
}
var collection = ModCollection.CreateNewTemporary( name );
if( _customCollections.TryAdd( collection.Name.ToLowerInvariant(), collection ) )
{
return collection.Name;