Added popups telling you to run CSharp when joining a server with CSharp mods enabled but without the Cs package
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.Interpreter.Interop;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -65,6 +64,14 @@ namespace Barotrauma
|
||||
public CsScriptLoader CsScriptLoader { get; private set; }
|
||||
public LuaCsSetupConfig Config { get; private set; }
|
||||
|
||||
private bool ShouldRunCs
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetPackage(CsForBarotraumaId, false, true) != null || Config.ForceCsScripting;
|
||||
}
|
||||
}
|
||||
|
||||
public LuaCsSetup()
|
||||
{
|
||||
Hook = new LuaCsHook(this);
|
||||
@@ -260,13 +267,13 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
public void Initialize(bool forceEnableCs = false)
|
||||
{
|
||||
Stop();
|
||||
|
||||
LuaCsLogger.LogMessage("Lua! Version " + AssemblyInfo.GitRevision);
|
||||
|
||||
bool csActive = GetPackage(CsForBarotraumaId, false, true) != null || Config.ForceCsScripting;
|
||||
bool csActive = ShouldRunCs || forceEnableCs;
|
||||
|
||||
LuaScriptLoader = new LuaScriptLoader();
|
||||
LuaScriptLoader.ModulePaths = new string[] { };
|
||||
|
||||
Reference in New Issue
Block a user