Add a friendly type name for Nullable<T>.

This commit is contained in:
Paul Chote
2021-01-02 01:32:10 +00:00
committed by Matthias Mailänder
parent 5e74e58b22
commit 3aa6fd3dc4

View File

@@ -218,6 +218,9 @@ namespace OpenRA.Mods.Common
if (t.IsGenericType && t.GetGenericTypeDefinition().GetInterfaces().Any(e => e.IsGenericType && e.GetGenericTypeDefinition() == typeof(IEnumerable<>)))
return "Collection of {0}".F(FriendlyTypeName(t.GetGenericArguments().First()));
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>))
return "{0} (optional)".F(t.GetGenericArguments().Select(FriendlyTypeName).First());
if (t == typeof(int) || t == typeof(uint))
return "Integer";