Make init logs nicer

This commit is contained in:
EvilFactory
2022-10-30 16:34:01 -03:00
parent e7d98dc887
commit ba1157b07d
4 changed files with 26 additions and 28 deletions
@@ -8,6 +8,7 @@ using System.Runtime.CompilerServices;
using System.Linq;
using System.Threading;
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
using System.Diagnostics;
[assembly: InternalsVisibleTo(Barotrauma.CsScriptBase.CsScriptAssembly, AllInternalsVisible = true)]
[assembly: InternalsVisibleTo(Barotrauma.CsScriptBase.CsOneTimeScriptAssembly, AllInternalsVisible = true)]
@@ -346,6 +347,8 @@ namespace Barotrauma
{
try
{
Stopwatch compilationTime = new Stopwatch();
compilationTime.Start();
var modTypes = CsScriptLoader.Compile();
modTypes.ForEach(t =>
{
@@ -358,6 +361,8 @@ namespace Barotrauma
HandleException(ex, LuaCsMessageOrigin.CSharpMod);
}
});
compilationTime.Stop();
PrintCsMessage($"Took {compilationTime.ElapsedMilliseconds}ms to compile and run Cs Scripts.");
}
catch (Exception ex)
{