1.0 Merge fixes

This commit is contained in:
EvilFactory
2023-03-13 13:37:24 -03:00
parent 4a229c6427
commit 5a3f9ebc80
2 changed files with 0 additions and 24 deletions

View File

@@ -254,21 +254,6 @@ namespace Barotrauma
return null;
});
Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion(typeof(None<T>), (Script v, object obj) =>
{
return UserData.Create(default(LuaNone));
});
Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion(typeof(Some<T>), (Script v, object obj) =>
{
if (obj is Some<T> some)
{
return UserData.Create(some.Value);
}
return null;
});
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(dataType, typeof(Option<T>), v =>
{
if (v.UserData.Object is LuaNone)

View File

@@ -110,14 +110,5 @@ namespace Barotrauma
result += $"<{string.Join(", ", t.GetGenericArguments().Select(NameWithGenerics))}>";
return result;
}
public static string NameWithGenerics(this Type t)
{
if (!t.IsGenericType) { return t.Name; }
string result = t.Name[..t.Name.IndexOf('`')];
result += $"<{string.Join(", ", t.GetGenericArguments().Select(NameWithGenerics))}>";
return result;
}
}
}