Fix displaying multiple structure parameters in Visject Surface parameters panel

This commit is contained in:
Wojciech Figat
2022-08-05 13:27:32 +02:00
parent ce1465ae98
commit b23cf5f1d8
2 changed files with 21 additions and 1 deletions

View File

@@ -29,6 +29,26 @@ namespace FlaxEditor.CustomEditors.Elements
Properties = new PropertiesList(this);
}
/// <summary>
/// Adds object property editor. Selects proper <see cref="CustomEditor"/> based on overrides.
/// </summary>
/// <param name="name">The property name.</param>
/// <param name="values">The values.</param>
/// <param name="overrideEditor">The custom editor to use. If null will detect it by auto.</param>
/// <returns>The created element.</returns>
public CustomEditor Property(string name, ValueContainer values, CustomEditor overrideEditor = null)
{
var editor = CustomEditorsUtil.CreateEditor(values, overrideEditor);
var style = editor.Style;
if (style == DisplayStyle.Group)
{
var group = Group(name, editor, true);
group.Panel.Open();
return group.Object(values, editor);
}
return Object(values, editor);
}
internal readonly List<PropertyNameLabel> Labels = new List<PropertyNameLabel>();
internal void OnAddProperty(string name, string tooltip)

View File

@@ -427,7 +427,7 @@ namespace FlaxEditor.Surface
propertyLabel.MouseLeftDoubleClick += (label, location) => StartParameterRenaming(pIndex, label);
propertyLabel.SetupContextMenu += OnPropertyLabelSetupContextMenu;
var property = itemLayout.AddPropertyItem(propertyLabel, tooltipText);
property.Object(propertyValue);
property.Property("Value", propertyValue);
}
CustomEditors.Editors.GenericEditor.OnGroupUsage();