[DatFile, DatItem] Enable merge tags and proper usage

This commit is contained in:
Matt Nadareski
2017-02-04 21:40:25 -08:00
parent 039a6368a8
commit 051a4e8fc7
4 changed files with 23 additions and 1 deletions

View File

@@ -809,6 +809,17 @@ namespace SabreTools.Helper.Dats
List<DatItem> items = this[game];
foreach (DatItem item in items)
{
// If the item doesn't have a valid merge tag OR the merged file doesn't exist in the parent, then add it
if (item.MergeTag == null || !this[parent].Select(i => i.Name).Contains(item.MergeTag))
{
// TODO: Remove hack for just disks at a later date
item.Name = (item.Type != ItemType.Disk ? item.Machine.Name + "\\" : "") + item.Name;
item.Machine = parentMachine;
this[parent].Add(item);
}
/*
// If the parent doesn't already contain the item, add it
if (!this[parent].Contains(item))
{
@@ -818,6 +829,7 @@ namespace SabreTools.Helper.Dats
this[parent].Add(item);
}
*/
}
// Then, remove the old game so it's not picked up by the writer