Introduce the LuaCsLogger class and make everything use that instead
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
GameMain.LuaCs.HandleException(e, LuaCsMessageOrigin.CSharpMod);
|
||||
LuaCsLogger.HandleException(e, LuaCsMessageOrigin.CSharpMod);
|
||||
}
|
||||
|
||||
LoadedMods.Remove(this);
|
||||
|
||||
@@ -52,12 +52,12 @@ namespace Barotrauma
|
||||
{
|
||||
if (rtValue == RunType.Standard && isEnabled)
|
||||
{
|
||||
LuaCsSetup.PrintCsMessage($"Added {cp.Name} {cp.ModVersion} to Cs compilation. (Standard)");
|
||||
LuaCsLogger.LogMessage($"Added {cp.Name} {cp.ModVersion} to Cs compilation. (Standard)");
|
||||
return true;
|
||||
}
|
||||
else if (rtValue == RunType.Forced)
|
||||
{
|
||||
LuaCsSetup.PrintCsMessage($"Added {cp.Name} {cp.ModVersion} to Cs compilation. (Forced)");
|
||||
LuaCsLogger.LogMessage($"Added {cp.Name} {cp.ModVersion} to Cs compilation. (Forced)");
|
||||
return true;
|
||||
}
|
||||
else if (rtValue == RunType.None)
|
||||
@@ -71,7 +71,7 @@ namespace Barotrauma
|
||||
|
||||
if (isEnabled)
|
||||
{
|
||||
LuaCsSetup.PrintCsMessage($"Added {cp.Name} {cp.ModVersion} to Cs compilation. (Assumed)");
|
||||
LuaCsLogger.LogMessage($"Added {cp.Name} {cp.ModVersion} to Cs compilation. (Assumed)");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -160,7 +160,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LuaCsSetup.PrintCsError("Error loading '" + folder + "':\n" + ex.Message + "\n" + ex.StackTrace);
|
||||
LuaCsLogger.LogError("Error loading '" + folder + "':\n" + ex.Message + "\n" + ex.StackTrace, LuaCsMessageOrigin.CSharpMod);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace Barotrauma
|
||||
{
|
||||
errStr += $"\n{diagnostic}";
|
||||
}
|
||||
LuaCsSetup.PrintCsError(errStr);
|
||||
LuaCsLogger.LogError(errStr, LuaCsMessageOrigin.CSharpMod);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -207,7 +207,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (ReflectionTypeLoadException re)
|
||||
{
|
||||
LuaCsSetup.PrintCsError($"Unable to load CsMod Types. {re.Message}");
|
||||
LuaCsLogger.LogError($"Unable to load CsMod Types. {re.Message}", LuaCsMessageOrigin.CSharpMod);
|
||||
throw re;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Barotrauma
|
||||
{
|
||||
errStr += $"\n{idx}: {err}";
|
||||
}
|
||||
LuaCsSetup.PrintCsError(errStr);
|
||||
LuaCsLogger.LogError(errStr, LuaCsMessageOrigin.CSharpMod);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -102,16 +102,16 @@ namespace Barotrauma
|
||||
UserData.UnregisterType(type, true);
|
||||
}
|
||||
}
|
||||
else { LuaCsSetup.PrintCsError("Script Error - no run method detected"); }
|
||||
else { LuaCsLogger.LogError("Script Error - no run method detected", LuaCsMessageOrigin.CSharpMod); }
|
||||
}
|
||||
else { LuaCsSetup.PrintCsError("Script Error - no runner class detected"); }
|
||||
else { LuaCsLogger.LogError("Script Error - no runner class detected", LuaCsMessageOrigin.CSharpMod); }
|
||||
}
|
||||
}
|
||||
Unload();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LuaCsSetup.PrintCsError("Error running script:\n" + ex.Message + "\n" + ex.StackTrace);
|
||||
LuaCsLogger.LogError("Error running script:\n" + ex.Message + "\n" + ex.StackTrace, LuaCsMessageOrigin.CSharpMod);
|
||||
}
|
||||
|
||||
return scriptResilt;
|
||||
|
||||
Reference in New Issue
Block a user