Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop

This commit is contained in:
EvilFactory
2024-04-12 12:11:06 -03:00
20 changed files with 204 additions and 25 deletions
@@ -2612,6 +2612,17 @@ namespace Barotrauma
errorMsg);
}
private static readonly HashSet<string> loggedErrorIdentifiers = new HashSet<string>();
/// <summary>
/// Log the error message, but only if an error with the same identifier hasn't been thrown yet during this session.
/// </summary>
public static void ThrowErrorOnce(string identifier, string errorMsg, Exception e)
{
if (loggedErrorIdentifiers.Contains(identifier)) { return; }
ThrowError(errorMsg, e);
loggedErrorIdentifiers.Add(identifier);
}
public static void AddWarning(string warning, ContentPackage contentPackage = null)
{
warning = AddContentPackageInfoToMessage($"WARNING: {warning}", contentPackage);