Update DiscGuard

This commit is contained in:
Matt Nadareski
2022-12-04 21:11:55 -08:00
parent e824428e0f
commit ce1c74aec3
2 changed files with 30 additions and 27 deletions

View File

@@ -2341,6 +2341,24 @@ namespace BurnOutSharp.Wrappers
});
}
/// <summary>
/// Find string table resources by contained string entry
/// </summary>
/// <param name="entry">String entry to check for</param>
/// <returns>Enumerable of matching resources</returns>
public IEnumerable<Dictionary<int, string>> FindStringTableByEntry(string entry)
{
// Ensure that we have the resource data cached
if (ResourceData == null)
return Enumerable.Empty<Dictionary<int, string>>();
return ResourceData.Select(r => r.Value)
.Select(r => r as Dictionary<int, string>)
.Where(st => st != null)
.Where(st => st.Select(kvp => kvp.Value)
.Any(s => s.Contains(entry)));
}
/// <summary>
/// Find unparsed resources by type name
/// </summary>