better vectors
This commit is contained in:
@@ -10,6 +10,21 @@ namespace Barotrauma
|
||||
{
|
||||
partial class LuaSetup
|
||||
{
|
||||
private static Vector2 CreateVector2(float x, float y)
|
||||
{
|
||||
return new Vector2(x, y);
|
||||
}
|
||||
|
||||
private static Vector3 CreateVector3(float x, float y, float z)
|
||||
{
|
||||
return new Vector3(x, y, z);
|
||||
}
|
||||
|
||||
private static Vector4 CreateVector4(float x, float y, float z, float w)
|
||||
{
|
||||
return new Vector4(x, y, z, w);
|
||||
}
|
||||
|
||||
private class LuaPlayer
|
||||
{
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Barotrauma
|
||||
public static void RegisterAll()
|
||||
{
|
||||
|
||||
// Vector 2
|
||||
/* // Vector 2
|
||||
|
||||
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(Vector2),
|
||||
dynVal => {
|
||||
@@ -51,7 +51,7 @@ namespace Barotrauma
|
||||
DynValue dynVal = DynValue.NewTable(script, new DynValue[] { x, y, z });
|
||||
return dynVal;
|
||||
}
|
||||
);
|
||||
);*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -139,14 +139,19 @@ namespace Barotrauma
|
||||
lua.Globals["Character"] = UserData.CreateStatic<Character>();
|
||||
lua.Globals["Item"] = UserData.CreateStatic<Item>();
|
||||
lua.Globals["Level"] = UserData.CreateStatic<Level>();
|
||||
lua.Globals["Vector2"] = UserData.CreateStatic<Vector2>();
|
||||
lua.Globals["Vector3"] = UserData.CreateStatic<Vector3>();
|
||||
lua.Globals["PositionType"] = UserData.CreateStatic<Level.PositionType>();
|
||||
lua.Globals["JobPrefab"] = UserData.CreateStatic<JobPrefab>();
|
||||
lua.Globals["TraitorMessageType"] = UserData.CreateStatic<TraitorMessageType>();
|
||||
lua.Globals["CauseOfDeathType"] = UserData.CreateStatic<CauseOfDeathType>();
|
||||
lua.Globals["Affliction"] = UserData.CreateStatic<Affliction>();
|
||||
|
||||
lua.Globals["Vector2"] = UserData.CreateStatic<Vector2>();
|
||||
lua.Globals["Vector3"] = UserData.CreateStatic<Vector3>();
|
||||
lua.Globals["Vector4"] = UserData.CreateStatic<Vector3>();
|
||||
lua.Globals["CreateVector2"] = (Func<float, float, Vector2>)CreateVector2;
|
||||
lua.Globals["CreateVector3"] = (Func<float, float, float, Vector3>)CreateVector3;
|
||||
lua.Globals["CreateVector4"] = (Func<float, float, float, float, Vector4>)CreateVector4;
|
||||
|
||||
foreach (string d in Directory.GetDirectories("Mods"))
|
||||
{
|
||||
if (Directory.Exists(d + "/Lua/Autorun"))
|
||||
|
||||
Reference in New Issue
Block a user