Fix regression in collections editing after improving ReadOnly option

This commit is contained in:
Wojtek Figat
2024-05-16 10:34:57 +02:00
parent 58f95d6ce3
commit ab5bb79754
9 changed files with 13 additions and 7 deletions

View File

@@ -227,7 +227,7 @@ namespace FlaxEditor.CustomEditors.Editors
var collection = (CollectionAttribute)attributes?.FirstOrDefault(x => x is CollectionAttribute);
if (collection != null)
{
_canResize = !collection.ReadOnly;
_canResize = collection.CanResize;
_readOnly = collection.ReadOnly;
_minCount = collection.MinCount;
_maxCount = collection.MaxCount;

View File

@@ -189,6 +189,7 @@ namespace FlaxEditor.CustomEditors.Editors
var collection = (CollectionAttribute)attributes?.FirstOrDefault(x => x is CollectionAttribute);
if (collection != null)
{
_canEditKeys &= collection.CanReorderItems;
_readOnly = collection.ReadOnly;
_notNullItems = collection.NotNullItems;
if (collection.BackgroundColor.HasValue)

View File

@@ -130,7 +130,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
/// The keyframes.
/// </summary>
[EditorDisplay("Keyframes", EditorDisplayAttribute.InlineStyle), ExpandGroups]
[Collection(CanReorderItems = false, ReadOnly = true)]
[Collection(CanReorderItems = false, CanResize = true)]
public List<KeyValuePair<string, object>> Keyframes;
/// <inheritdoc />

View File

@@ -159,7 +159,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
/// The parameters values.
/// </summary>
[EditorDisplay("Parameters", EditorDisplayAttribute.InlineStyle), ExpandGroups]
[Collection(CanReorderItems = false, ReadOnly = true)]
[Collection(CanReorderItems = false, CanResize = true)]
public object[] Parameters;
/// <inheritdoc />

View File

@@ -82,7 +82,7 @@ namespace FlaxEditor.Tools.Foliage
}
}
[EditorOrder(20), EditorDisplay("Model"), Collection(ReadOnly = true), Tooltip("Model materials override collection. Can be used to change a specific material of the mesh to the custom one without editing the asset.")]
[EditorOrder(20), EditorDisplay("Model"), Collection(CanResize = true), Tooltip("Model materials override collection. Can be used to change a specific material of the mesh to the custom one without editing the asset.")]
public MaterialBase[] Materials
{
get