mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-03 14:23:43 +01:00
Use filterable combo in special collections selector.
This commit is contained in:
parent
1d6d696cb7
commit
bb06c27359
3 changed files with 54 additions and 33 deletions
|
|
@ -292,23 +292,28 @@ public partial class ModCollection
|
|||
public static void MigrateUngenderedCollections()
|
||||
{
|
||||
if( !ReadActiveCollections( out var jObject ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach( var (type, _, _) in CollectionTypeExtensions.Special.Where( t => t.Item2.StartsWith( "Male " ) ) )
|
||||
{
|
||||
var oldName = type.ToString()[ 5.. ];
|
||||
var value = jObject[oldName];
|
||||
var oldName = type.ToString()[ 4.. ];
|
||||
var value = jObject[ oldName ];
|
||||
if( value == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
jObject.Remove( oldName );
|
||||
jObject.Add( "Male" + oldName, value );
|
||||
jObject.Add( "Female" + oldName, value );
|
||||
jObject.Add( "Male" + oldName, value );
|
||||
jObject.Add( "Female" + oldName, value );
|
||||
}
|
||||
|
||||
using var stream = File.Open( ActiveCollectionFile, FileMode.Truncate );
|
||||
using var writer = new StreamWriter( stream );
|
||||
using var j = new JsonTextWriter( writer );
|
||||
j.Formatting = Formatting.Indented;
|
||||
jObject.WriteTo( j );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue