mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Replacement code to own class
This commit is contained in:
@@ -540,11 +540,25 @@ namespace SabreTools.Filtering
|
||||
List<DatItem> items = datFile.Items[key];
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
DatItemTool.SetOneRomPerGame(items[i]);
|
||||
SetOneRomPerGame(items[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set internal names to match One Rom Per Game (ORPG) logic
|
||||
/// </summary>
|
||||
/// <param name="datItem">DatItem to run logic on</param>
|
||||
internal void SetOneRomPerGame(DatItem datItem)
|
||||
{
|
||||
if (datItem.GetName() == null)
|
||||
return;
|
||||
|
||||
string[] splitname = datItem.GetName().Split('.');
|
||||
datItem.Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}";
|
||||
datItem.SetName(Path.GetFileName(datItem.GetName()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Strip the dates from the beginning of scene-style set names
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user