diff --git a/Artemis/Artemis/Utilities/GeneralHelpers.cs b/Artemis/Artemis/Utilities/GeneralHelpers.cs index a024dba1c..fed6fa746 100644 --- a/Artemis/Artemis/Utilities/GeneralHelpers.cs +++ b/Artemis/Artemis/Utilities/GeneralHelpers.cs @@ -8,6 +8,7 @@ using System.Security.Principal; using System.Windows; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using static System.String; namespace Artemis.Utilities { @@ -63,9 +64,18 @@ namespace Artemis.Utilities var list = new List(); foreach (var propertyInfo in getProperties) { + var friendlyName = Empty; + if (propertyInfo.PropertyType.Name == "Int32") + friendlyName = "(Number) "; + else if (propertyInfo.PropertyType.Name == "String") + friendlyName = "(Text) "; + if (propertyInfo.PropertyType.BaseType?.Name == "Enum") + friendlyName = "(Choice) "; + var parent = new PropertyCollection { Type = propertyInfo.PropertyType.Name, + DisplayType = friendlyName, Display = $"{path.Replace(".", " → ")}{propertyInfo.Name}", Path = $"{path}{propertyInfo.Name}" }; @@ -76,7 +86,9 @@ namespace Artemis.Utilities parent.Type = "Enum"; } - list.Add(parent); + if (friendlyName != Empty) + list.Add(parent); + list.AddRange(GenerateTypeMap(propertyInfo.PropertyType.GetProperties(), path + $"{propertyInfo.Name}.")); } return list; @@ -94,6 +106,7 @@ namespace Artemis.Utilities public string[] EnumValues { get; set; } public List Children { get; set; } + public string DisplayType { get; set; } } } } \ No newline at end of file diff --git a/Artemis/Artemis/Views/LayerEditor/LayerConditionView.xaml b/Artemis/Artemis/Views/LayerEditor/LayerConditionView.xaml index d99c8fb92..67c8f7ef0 100644 --- a/Artemis/Artemis/Views/LayerEditor/LayerConditionView.xaml +++ b/Artemis/Artemis/Views/LayerEditor/LayerConditionView.xaml @@ -6,35 +6,57 @@ xmlns:local="clr-namespace:Artemis.Views.LayerEditor" xmlns:cal="http://www.caliburnproject.org" xmlns:utilities="clr-namespace:Artemis.Utilities" - mc:Ignorable="d" - d:DesignHeight="132.061" d:DesignWidth="632.296"> + mc:Ignorable="d" d:DesignWidth="613.296" Height="46"> + + + + + + + - + + HorizontalAlignment="Center" VerticalAlignment="Top"> + + + + + + + + + + VerticalAlignment="Top" /> - - - - - - - + + + + + + + -