Fix conflicts not sorting because dumb.

This commit is contained in:
Ottermandias 2022-05-12 18:42:53 +02:00
parent 17f9c2ee6f
commit aa0584078b
2 changed files with 12 additions and 1 deletions

View file

@ -55,6 +55,15 @@ public struct ConflictCache
_ => 0,
};
}
public override string ToString()
=> ( Mod1Priority, Solved ) switch
{
(true, true) => $"{Penumbra.ModManager[ Mod1 ].Name} > {Penumbra.ModManager[ Mod2 ].Name} ({Data})",
(true, false) => $"{Penumbra.ModManager[ Mod1 ].Name} >= {Penumbra.ModManager[ Mod2 ].Name} ({Data})",
(false, true) => $"{Penumbra.ModManager[ Mod1 ].Name} < {Penumbra.ModManager[ Mod2 ].Name} ({Data})",
(false, false) => $"{Penumbra.ModManager[ Mod1 ].Name} <= {Penumbra.ModManager[ Mod2 ].Name} ({Data})",
};
}
private readonly List< Conflict > _conflicts = new();
@ -75,6 +84,7 @@ public struct ConflictCache
// Find all mod conflicts concerning the specified mod (in both directions).
public SubList< Conflict > ModConflicts( int modIdx )
{
Sort();
var start = _conflicts.FindIndex( c => c.Mod1 == modIdx );
if( start < 0 )
{
@ -90,6 +100,7 @@ public struct ConflictCache
if( !_isSorted )
{
_conflicts?.Sort();
_isSorted = true;
}
}

View file

@ -105,7 +105,7 @@ public partial class ConfigWindow
return;
}
using var box = ImRaii.ListBox( "##conflicts" );
using var box = ImRaii.ListBox( "##conflicts", -Vector2.One );
if( !box )
{
return;