mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Style] Implement CompareNumeric again, not external this time
This commit is contained in:
@@ -538,7 +538,6 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
try
|
||||
{
|
||||
NaturalComparer nc = new NaturalComparer();
|
||||
if (x.SystemID == y.SystemID)
|
||||
{
|
||||
if (x.SourceID == y.SourceID)
|
||||
@@ -549,9 +548,9 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
if (Path.GetDirectoryName(Style.RemovePathUnsafeCharacters(x.Name)) == Path.GetDirectoryName(Style.RemovePathUnsafeCharacters(y.Name)))
|
||||
{
|
||||
return nc.Compare(Path.GetFileName(Style.RemovePathUnsafeCharacters(x.Name)), Path.GetFileName(Style.RemovePathUnsafeCharacters(y.Name)));
|
||||
return Style.CompareNumeric(Path.GetFileName(Style.RemovePathUnsafeCharacters(x.Name)), Path.GetFileName(Style.RemovePathUnsafeCharacters(y.Name)));
|
||||
}
|
||||
return nc.Compare(Path.GetDirectoryName(Style.RemovePathUnsafeCharacters(x.Name)), Path.GetDirectoryName(Style.RemovePathUnsafeCharacters(y.Name)));
|
||||
return Style.CompareNumeric(Path.GetDirectoryName(Style.RemovePathUnsafeCharacters(x.Name)), Path.GetDirectoryName(Style.RemovePathUnsafeCharacters(y.Name)));
|
||||
}
|
||||
else if ((x.Type == ItemType.Rom || x.Type == ItemType.Disk) && (y.Type != ItemType.Rom && y.Type != ItemType.Disk))
|
||||
{
|
||||
@@ -565,16 +564,16 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
if (Path.GetDirectoryName(x.Name) == Path.GetDirectoryName(y.Name))
|
||||
{
|
||||
return nc.Compare(Path.GetFileName(x.Name), Path.GetFileName(y.Name));
|
||||
return Style.CompareNumeric(Path.GetFileName(x.Name), Path.GetFileName(y.Name));
|
||||
}
|
||||
return nc.Compare(Path.GetDirectoryName(x.Name), Path.GetDirectoryName(y.Name));
|
||||
return Style.CompareNumeric(Path.GetDirectoryName(x.Name), Path.GetDirectoryName(y.Name));
|
||||
}
|
||||
}
|
||||
return nc.Compare(x.Machine.Name, y.Machine.Name);
|
||||
return Style.CompareNumeric(x.Machine.Name, y.Machine.Name);
|
||||
}
|
||||
return (norename ? nc.Compare(x.Machine.Name, y.Machine.Name) : x.SourceID - y.SourceID);
|
||||
return (norename ? Style.CompareNumeric(x.Machine.Name, y.Machine.Name) : x.SourceID - y.SourceID);
|
||||
}
|
||||
return (norename ? nc.Compare(x.Machine.Name, y.Machine.Name) : x.SystemID - y.SystemID);
|
||||
return (norename ? Style.CompareNumeric(x.Machine.Name, y.Machine.Name) : x.SystemID - y.SystemID);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user