I can’t think of any other example of slate where it uses something else besides ] that breaks the indents.
The only additional think I can add here is that the code may be deeply nested. Here’s modified version of a code from Rama’s hello slate tutorial:
void SStandardSlateWidget::Construct(const FArguments& InArgs)
{
OwnerHUD = InArgs._OwnerHUD;
////////////////////////////////////////////////////////////////////////////////////////////////////
/////If the code below doesn't look like C++ to you it's because it (sort-of) isn't,
/////Slate makes extensive use of the C++ Prerocessor(macros) and operator overloading,
/////Epic is trying to make our lives easier, look-up the macro/operator definitions to see why.
ChildSlot
.VAlign(VAlign_Fill)
.HAlign(HAlign_Fill)
SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.FillWidth(1)
SNew(STextBlock)
.Text(LOCTEXT("Some text"))
] // ; here
+SHorizontalBox::Slot()
.FillWidth(1)
SNew(STextBlock)
.Text(LOCTEXT("Another text"))
] // no ; here either
];
}
Dunno if the lack of ‘;’ would matter for you, but I pointed that out just in case.
Actually, I’ve found more thing about slate that could malfunction. It’s the declaration of slate arguments in header files.
Here’s how it looks like:
class STableRow : public ITableRow, public SBorder
{
static_assert(TIsValidListItem<ItemType>::Value, "Item type T must be UObjectBase*, TSharedRef<>, or TSharedPtr<>.");
public:
DECLARE_DELEGATE_RetVal_ThreeParams(TOptional<EItemDropZone>, FOnCanAcceptDrop, const FDragDropEvent&, EItemDropZone, ItemType);
DECLARE_DELEGATE_RetVal_ThreeParams(FReply, FOnAcceptDrop, const FDragDropEvent&, EItemDropZone, ItemType);
public:
SLATE_BEGIN_ARGS( STableRow< ItemType > )
: _Style( &FCoreStyle::Get().GetWidgetStyle<FTableRowStyle>("TableView.Row") )
, _ExpanderStyleSet( &FCoreStyle::Get() )
, _Padding( FMargin(0) )
, _ShowSelection( true )
, _Content()
{}
SLATE_STYLE_ARGUMENT( FTableRowStyle, Style )
SLATE_ARGUMENT(const ISlateStyle*, ExpanderStyleSet)
SLATE_EVENT( FOnCanAcceptDrop, OnCanAcceptDrop )
SLATE_EVENT( FOnAcceptDrop, OnAcceptDrop )
SLATE_EVENT( FOnDragDetected, OnDragDetected )
SLATE_EVENT( FOnTableRowDragEnter, OnDragEnter )
SLATE_EVENT( FOnTableRowDragLeave, OnDragLeave )
SLATE_EVENT( FOnTableRowDrop, OnDrop )
SLATE_ATTRIBUTE( FMargin, Padding )
SLATE_ARGUMENT( bool, ShowSelection )
SLATE_DEFAULT_SLOT( typename STableRow<ItemType>::FArguments, Content )
SLATE_END_ARGS()
// the rest of the class
};
And custom subclass:
class SSomeSubclass: public SMultiColumnTableRow<FSomeDataStruct>
{
public:
SLATE_BEGIN_ARGS(SSomeSubclass) {}
SLATE_ARGUMENT(TSharedPtr<class FSomeOtherClass>, Class)
SLATE_ARGUMENT(FSomeDataStruct, Data)
SLATE_END_ARGS()
// the rest of the class
};