Add quick interactions locally
This commit is contained in:
27
Quick Interactions/CSharp/Client/CrabUI/Global/CUIErrors.cs
Normal file
27
Quick Interactions/CSharp/Client/CrabUI/Global/CUIErrors.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
|
||||
using Barotrauma;
|
||||
using HarmonyLib;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.IO;
|
||||
|
||||
namespace QICrabUI
|
||||
{
|
||||
public partial class CUI
|
||||
{
|
||||
public static Dictionary<string, int> Errors = new();
|
||||
public static void Error(object msg, int maxPrints = 1, bool silent = false)
|
||||
{
|
||||
string s = $"{msg}";
|
||||
if (!Errors.ContainsKey(s)) Errors[s] = 1;
|
||||
else Errors[s] = Errors[s] + 1;
|
||||
if (silent) return;
|
||||
if (Errors[s] <= maxPrints) Log($"CUI: {s} x{Errors[s]}", Color.Orange);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user