add Cs package check back and fix typos
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
class LuaCsSetupConfig
|
class LuaCsSetupConfig
|
||||||
{
|
{
|
||||||
public bool FirstTimeCsWaring = true;
|
public bool FirstTimeCsWarning = true;
|
||||||
|
|
||||||
public LuaCsSetupConfig() { }
|
public LuaCsSetupConfig() { }
|
||||||
}
|
}
|
||||||
@@ -413,13 +413,14 @@ namespace Barotrauma
|
|||||||
lua.Globals["SERVER"] = IsServer;
|
lua.Globals["SERVER"] = IsServer;
|
||||||
lua.Globals["CLIENT"] = IsClient;
|
lua.Globals["CLIENT"] = IsClient;
|
||||||
|
|
||||||
CsScriptLoader = new CsScriptLoader(this);
|
|
||||||
CsScriptLoader.SearchFolders();
|
if (GetPackage("CsForBarotrauma", false) != null)
|
||||||
if (CsScriptLoader.HasSources)
|
|
||||||
{
|
{
|
||||||
if (Config.FirstTimeCsWaring)
|
PrintMessage("Cs! Version " + AssemblyInfo.GitRevision);
|
||||||
|
|
||||||
|
if (Config.FirstTimeCsWarning)
|
||||||
{
|
{
|
||||||
Config.FirstTimeCsWaring = false;
|
Config.FirstTimeCsWarning = false;
|
||||||
UpdateConfig();
|
UpdateConfig();
|
||||||
|
|
||||||
LuaCsTimer.Wait((args) => PrintCsError(@"
|
LuaCsTimer.Wait((args) => PrintCsError(@"
|
||||||
@@ -427,7 +428,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
WARNING!
|
WARNING!
|
||||||
-- -- -- -- -- --
|
-- -- -- -- -- --
|
||||||
!Use of Cs Mods detected!
|
!Cs Package Enabled!
|
||||||
|
|
||||||
Cs Mods are questionably
|
Cs Mods are questionably
|
||||||
sandboxed, as they have
|
sandboxed, as they have
|
||||||
@@ -440,20 +441,25 @@ modding needs.
|
|||||||
"), 200);
|
"), 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
CsScriptLoader = new CsScriptLoader(this);
|
||||||
|
CsScriptLoader.SearchFolders();
|
||||||
|
if (CsScriptLoader.HasSources)
|
||||||
{
|
{
|
||||||
var modTypes = CsScriptLoader.Compile();
|
try
|
||||||
modTypes.ForEach(t => {
|
{
|
||||||
UserData.RegisterType(t);
|
var modTypes = CsScriptLoader.Compile();
|
||||||
t.GetConstructor(new Type[] { })?.Invoke(null);
|
modTypes.ForEach(t =>
|
||||||
});
|
{
|
||||||
}
|
UserData.RegisterType(t);
|
||||||
catch (Exception ex)
|
t.GetConstructor(new Type[] { })?.Invoke(null);
|
||||||
{
|
});
|
||||||
HandleException(ex, exceptionType: ExceptionType.CSharp);
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
HandleException(ex, exceptionType: ExceptionType.CSharp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintMessage("Cs! Version " + AssemblyInfo.GitRevision);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user