From 0ef0a82f6c804277df39b87c03f6842e6a63ffe2 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:49:38 -0300 Subject: [PATCH] switch debug console functions to luasetup error handling --- .../BarotraumaShared/SharedSource/Lua/LuaClasses.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs index f62e3ab48..70208b200 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs @@ -851,13 +851,13 @@ namespace Barotrauma } else { - DebugConsole.ThrowError($"No hook method found in _hookMethods[{methodPath}]"); + luaSetup.PrintError($"No hook method found in _hookMethods[{methodPath}]"); } } catch (Exception ex) { - DebugConsole.ThrowError(nameof(_hookLuaPatch), ex); + luaSetup.HandleLuaException(ex, nameof(_hookLuaPatch)); } } @@ -941,10 +941,10 @@ namespace Barotrauma if (hookMethod != null) { if (!_hookMethods.TryAdd(methodPath, hookMethod)) - DebugConsole.ThrowError($"Failed to add key-value in {nameof(_hookMethods)}\n[{methodPath}, {hookMethod.ToString()}]"); + env.PrintError($"Failed to add key-value in {nameof(_hookMethods)}\n[{methodPath}, {hookMethod.ToString()}]"); #if DEBUG else - DebugConsole.NewMessage($"Sucessfully added key-value in {nameof(_hookMethods)}\n[{methodPath}, {hookMethod.ToString()}]", Color.LightSkyBlue); + env.PrintMessage($"Sucessfully added key-value in {nameof(_hookMethods)}\n[{methodPath}, {hookMethod.ToString()}]"); #endif } break;