mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix conflicts not sorting because dumb.
This commit is contained in:
parent
17f9c2ee6f
commit
aa0584078b
2 changed files with 12 additions and 1 deletions
|
|
@ -55,6 +55,15 @@ public struct ConflictCache
|
||||||
_ => 0,
|
_ => 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();
|
private readonly List< Conflict > _conflicts = new();
|
||||||
|
|
@ -75,6 +84,7 @@ public struct ConflictCache
|
||||||
// Find all mod conflicts concerning the specified mod (in both directions).
|
// Find all mod conflicts concerning the specified mod (in both directions).
|
||||||
public SubList< Conflict > ModConflicts( int modIdx )
|
public SubList< Conflict > ModConflicts( int modIdx )
|
||||||
{
|
{
|
||||||
|
Sort();
|
||||||
var start = _conflicts.FindIndex( c => c.Mod1 == modIdx );
|
var start = _conflicts.FindIndex( c => c.Mod1 == modIdx );
|
||||||
if( start < 0 )
|
if( start < 0 )
|
||||||
{
|
{
|
||||||
|
|
@ -90,6 +100,7 @@ public struct ConflictCache
|
||||||
if( !_isSorted )
|
if( !_isSorted )
|
||||||
{
|
{
|
||||||
_conflicts?.Sort();
|
_conflicts?.Sort();
|
||||||
|
_isSorted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public partial class ConfigWindow
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using var box = ImRaii.ListBox( "##conflicts" );
|
using var box = ImRaii.ListBox( "##conflicts", -Vector2.One );
|
||||||
if( !box )
|
if( !box )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue