mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Only include booleans if the value is true
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user