1.0 Merge fixes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user