GameMain.LuaCs is no more

This commit is contained in:
Evil Factory
2026-02-28 16:05:20 -03:00
parent c676233dfd
commit 8e8b8eb8aa
35 changed files with 99 additions and 96 deletions
@@ -22,8 +22,16 @@ namespace Barotrauma
partial class LuaCsSetup : IDisposable, IEventScreenSelected, IEventEnabledPackageListChanged,
IEventReloadAllPackages
{
public LuaCsSetup()
private static LuaCsSetup _luaCsSetup;
public static LuaCsSetup Instance => _luaCsSetup ??= new LuaCsSetup();
private LuaCsSetup()
{
if (_luaCsSetup != null)
{
throw new Exception("Tried to create another LuaCsSetup instance");
}
// == startup
_servicesProvider = SetupServicesProvider();
_runStateMachine = SetupStateMachine();
@@ -432,6 +440,8 @@ namespace Barotrauma
Console.WriteLine(e);
throw;
}
_luaCsSetup = null;
GC.SuppressFinalize(this);
}