2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-06-17 09:46:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "PropertyEditorPrivatePCH.h"
|
|
|
|
|
#include "PropertyNode.h"
|
|
|
|
|
#include "CategoryPropertyNode.h"
|
|
|
|
|
#include "ItemPropertyNode.h"
|
|
|
|
|
#include "ObjectEditorUtils.h"
|
|
|
|
|
#include "StructurePropertyNode.h"
|
|
|
|
|
|
|
|
|
|
void FStructurePropertyNode::InitChildNodes()
|
|
|
|
|
{
|
|
|
|
|
const bool bShouldShowHiddenProperties = !!HasNodeFlags(EPropertyNodeFlags::ShouldShowHiddenProperties);
|
2015-02-02 03:29:45 -05:00
|
|
|
const bool bShouldShowDisableEditOnInstance = !!HasNodeFlags(EPropertyNodeFlags::ShouldShowDisableEditOnInstance);
|
|
|
|
|
|
2014-12-10 10:57:36 -05:00
|
|
|
const UStruct* Struct = StructData.IsValid() ? StructData->GetStruct() : NULL;
|
2014-06-17 09:46:22 -04:00
|
|
|
|
|
|
|
|
for (TFieldIterator<UProperty> It(Struct); It; ++It)
|
|
|
|
|
{
|
|
|
|
|
UProperty* StructMember = *It;
|
2015-02-02 03:29:45 -05:00
|
|
|
|
2015-03-31 20:12:31 -04:00
|
|
|
if (StructMember)
|
2014-06-17 09:46:22 -04:00
|
|
|
{
|
2015-03-31 20:12:31 -04:00
|
|
|
const bool bShowIfEditableProperty = StructMember->HasAnyPropertyFlags(CPF_Edit);
|
|
|
|
|
const bool bShowIfDisableEditOnInstance = !StructMember->HasAnyPropertyFlags(CPF_DisableEditOnInstance) || bShouldShowDisableEditOnInstance;
|
2014-06-17 09:46:22 -04:00
|
|
|
|
2015-03-31 20:12:31 -04:00
|
|
|
if (bShouldShowHiddenProperties || (bShowIfEditableProperty && bShowIfDisableEditOnInstance))
|
|
|
|
|
{
|
|
|
|
|
TSharedPtr<FItemPropertyNode> NewItemNode(new FItemPropertyNode);//;//CreatePropertyItem(StructMember,INDEX_NONE,this);
|
2014-06-17 09:46:22 -04:00
|
|
|
|
2015-03-31 20:12:31 -04:00
|
|
|
FPropertyNodeInitParams InitParams;
|
|
|
|
|
InitParams.ParentNode = SharedThis(this);
|
|
|
|
|
InitParams.Property = StructMember;
|
|
|
|
|
InitParams.ArrayOffset = 0;
|
|
|
|
|
InitParams.ArrayIndex = INDEX_NONE;
|
|
|
|
|
InitParams.bAllowChildren = true;
|
|
|
|
|
InitParams.bForceHiddenPropertyVisibility = bShouldShowHiddenProperties;
|
|
|
|
|
InitParams.bCreateDisableEditOnInstanceNodes = bShouldShowDisableEditOnInstance;
|
|
|
|
|
InitParams.bCreateCategoryNodes = false;
|
|
|
|
|
|
|
|
|
|
NewItemNode->InitNode(InitParams);
|
|
|
|
|
AddChildNode(NewItemNode);
|
|
|
|
|
}
|
2014-06-17 09:46:22 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|