diff --git a/CHANGELIST.md b/CHANGELIST.md index 2af1775e..dad712c2 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -38,6 +38,7 @@ - Convert postgap and VCD fields to checkboxes - Adjust width ratios for disc info window - Fix IsReadOnly +- Only include booleans if the value is true ### 2.2 (2021-12-30) - Fix Saturn header finding diff --git a/MPF.Library/InfoTool.cs b/MPF.Library/InfoTool.cs index 10ee7f92..f8e4aea8 100644 --- a/MPF.Library/InfoTool.cs +++ b/MPF.Library/InfoTool.cs @@ -887,11 +887,17 @@ namespace MPF.Library string line = $"{kvp.Key.ShortName()}{(isMultiLine ? "\n" : " ")}"; // Special case for boolean fields - if ((kvp.Key == SiteCode.PostgapType || kvp.Key == SiteCode.VCD) && kvp.Value != true.ToString()) + if (kvp.Key == SiteCode.PostgapType || kvp.Key == SiteCode.VCD) + { + if (kvp.Value != true.ToString()) + return string.Empty; + return line.Trim(); + } return $"{line}{kvp.Value}{(isMultiLine ? "\n" : string.Empty)}"; }) + .Where(s => !string.IsNullOrEmpty(s)) ) + "\n" + info.CommonDiscInfo.Comments; // Trim the comments field @@ -918,11 +924,17 @@ namespace MPF.Library string line = $"{kvp.Key.ShortName()}{(isMultiLine ? "\n" : " ")}"; // Special case for boolean fields - if ((kvp.Key == SiteCode.PostgapType || kvp.Key == SiteCode.VCD) && kvp.Value != true.ToString()) + if (kvp.Key == SiteCode.PostgapType || kvp.Key == SiteCode.VCD) + { + if (kvp.Value != true.ToString()) + return string.Empty; + return line.Trim(); + } return $"{line}{kvp.Value}{(isMultiLine ? "\n" : string.Empty)}"; }) + .Where(s => !string.IsNullOrEmpty(s)) ) + "\n" + info.CommonDiscInfo.Contents; // Trim the contents field