Fix collection selectors not updating correctly.

This commit is contained in:
Ottermandias 2022-12-04 00:10:49 +01:00
parent 1887a785f5
commit 5f4351d4f1
2 changed files with 5 additions and 4 deletions

@ -1 +1 @@
Subproject commit cbf21c639f91d39422b2d4b7244bd8d8c5d5d4d7
Subproject commit 441d5f9b2943f8ab81501870314d9b1610cb3b51

View file

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
@ -114,7 +115,7 @@ public partial class ConfigWindow
private sealed class CollectionSelector : FilterComboCache< ModCollection >
{
public CollectionSelector( IEnumerable< ModCollection > items )
public CollectionSelector( Func<IReadOnlyList<ModCollection>> items )
: base( items )
{ }
@ -140,8 +141,8 @@ public partial class ConfigWindow
=> obj.Name;
}
private static readonly CollectionSelector CollectionsWithEmpty = new(Penumbra.CollectionManager.OrderBy( c => c.Name ).Prepend( ModCollection.Empty ));
private static readonly CollectionSelector Collections = new(Penumbra.CollectionManager.OrderBy( c => c.Name ));
private static readonly CollectionSelector CollectionsWithEmpty = new(() => Penumbra.CollectionManager.OrderBy( c => c.Name ).Prepend( ModCollection.Empty ).ToList());
private static readonly CollectionSelector Collections = new(() => Penumbra.CollectionManager.OrderBy( c => c.Name ).ToList());
// Draw a collection selector of a certain width for a certain type.
private static void DrawCollectionSelector( string label, float width, CollectionType collectionType, bool withEmpty )