FPropertyAccess::Result FPropertyValueImpl::ImportText( const TArray& InObjects, const TArray& InValues, FPropertyNode* InPropertyNode, EPropertyValueSetFlags::Type Flags )
{
// 略
FScriptSetHelper SetHelper(SetProperty, ValueBaseAddress);
if (SetHelper.HasElement(Cur.BaseAddress, NewValue) &&
(Flags & EPropertyValueSetFlags::InteractiveChange) == 0)
{
// Duplicate element in the set
ShowInvalidOperationError(LOCTEXT("DuplicateSetElement", "Duplicate elements are not allowed in Set properties."));
//return FPropertyAccess::Fail; ←削除
}
// 略
FScriptMapHelper MapHelper(MapProperty, ValueBaseAddress);
if (MapHelper.HasKey(Cur.BaseAddress, NewValue) &&
(Flags & EPropertyValueSetFlags::InteractiveChange) == 0)
{
// Duplicate key in the map
ShowInvalidOperationError(LOCTEXT("DuplicateMapKey", "Duplicate keys are not allowed in Map properties."));
//return FPropertyAccess::Fail; ←削除
}
return Result;
}
FPropertyAccess::Result FPropertyHandleSet::AddItem()
{
FPropertyAccess::Result Result = FPropertyAccess::Fail;
if (IsEditable())
{
/* 削除
if (!HasDefaultElement())
{
Implementation->AddChild();
Result = FPropertyAccess::Success;
}
else
{
Implementation->ShowInvalidOperationError(LOCTEXT("DuplicateSetElement_Add", "Cannot add a new element to the set while an element with the default value exists"));
}
*/
// 挿入↓
if (HasDefaultElement())
{
Implementation->ShowInvalidOperationError(LOCTEXT("DuplicateSetElement_Add", "Cannot add a new element to the set while an element with the default value exists"));
}
Implementation->AddChild();
Result = FPropertyAccess::Success;
// 挿入↑
}
return Result;
}
FPropertyAccess::Result FPropertyHandleMap::AddItem()
{
FPropertyAccess::Result Result = FPropertyAccess::Fail;
if (IsEditable())
{
/* 削除
if ( !HasDefaultKey() )
{
Implementation->AddChild();
Result = FPropertyAccess::Success;
}
else
{
Implementation->ShowInvalidOperationError(LOCTEXT("DuplicateMapKey_Add", "Cannot add a new key to the map while a key with the default value exists"));
}
*/
// 挿入↓
if (HasDefaultKey())
{
Implementation->ShowInvalidOperationError(LOCTEXT("DuplicateMapKey_Add", "Cannot add a new key to the map while a key with the default value exists"));
}
Implementation->AddChild();
Result = FPropertyAccess::Success;
// 挿入↑
}
return Result;
}