Update moonsharp and move extension methods to register Lua file
This commit is contained in:
@@ -23,6 +23,18 @@ namespace Barotrauma
|
||||
return UserData.RegisterType(type);
|
||||
}
|
||||
|
||||
public static void RegisterExtensionType(string typeName)
|
||||
{
|
||||
Type type = GetType(typeName);
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
throw new ScriptRuntimeException($"tried to register a type that doesn't exist: {typeName}.");
|
||||
}
|
||||
|
||||
UserData.RegisterExtensionType(type);
|
||||
}
|
||||
|
||||
public static bool IsRegistered(string typeName)
|
||||
{
|
||||
Type type = GetType(typeName);
|
||||
|
||||
@@ -420,9 +420,6 @@ namespace Barotrauma
|
||||
UserData.RegisterType<LuaCsPerformanceCounter>();
|
||||
UserData.RegisterType<IUserDataDescriptor>();
|
||||
|
||||
UserData.RegisterExtensionType(typeof(MathUtils));
|
||||
UserData.RegisterExtensionType(typeof(XMLExtensions));
|
||||
|
||||
Lua.Globals["printerror"] = (DynValue o) => { LuaCsLogger.LogError(o.ToString(), LuaCsMessageOrigin.LuaMod); };
|
||||
|
||||
Lua.Globals["setmodulepaths"] = (Action<string[]>)SetModulePaths;
|
||||
|
||||
Reference in New Issue
Block a user