So I want to write a Editor Mode Plugin wich can Edit the Data of custom Navigation Tiles. I never wrote a plugin for ue4 befor and I struggle to get the STableRow to work. I want to achieve a Slot similar to the Static Mesh or Material References in the Editor but with my TileData DataAsset.
If I try to use the STableRow (I dont even knof if it is the right Slate for whot I want to achieve) I get:
*C2660 "STableRow<UTileData >::Construct": fonction does not accept 1 Argument (or similar. had to translate)
This is the Code:
#include "TileEditorEdModeToolkit.h"
#include "TileEditorEdMode.h"
#include "Engine/Selection.h"
#include "Widgets/Input/SButton.h"
#include "Widgets/Text/STextBlock.h"
#include "EditorModeManager.h"
#include "STableRow.h"
#include "STableViewBase.h"
#include "./TBS_FH/TileData.h"
#define LOCTEXT_NAMESPACE "FTileEditorEdModeToolkit"
FTileEditorEdModeToolkit::FTileEditorEdModeToolkit()
{
}
void FTileEditorEdModeToolkit::Init(const TSharedPtr<IToolkitHost>& InitToolkitHost)
{
struct Locals
{
static bool IsWidgetEnabled()
{
return GEditor->GetSelectedActors()->Num() != 0;
}
static FReply OnButtonClick(FVector InOffset)
{
USelection* SelectedActors = GEditor->GetSelectedActors();
// Let editor know that we're about to do something that we want to undo/redo
GEditor->BeginTransaction(LOCTEXT("MoveActorsTransactionName", "MoveActors"));
// For each selected actor
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter)
{
if (AActor* LevelActor = Cast<AActor>(*Iter))
{
// Register actor in opened transaction (undo/redo)
LevelActor->Modify();
// Move actor to given location
LevelActor->TeleportTo(LevelActor->GetActorLocation() + InOffset, FRotator(0, 0, 0));
}
}
// We're done moving actors so close transaction
GEditor->EndTransaction();
return FReply::Handled();
}
};
const float Factor = 256.0f;
SAssignNew(ToolkitWidget, SBorder)
.HAlign(HAlign_Center)
.Padding(25)
.IsEnabled_Static(&Locals::IsWidgetEnabled)
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.HAlign(HAlign_Center)
.Padding(50)
SNew(STableRow<UTileData*>)
]
];
FModeToolkit::Init(InitToolkitHost);
}
FName FTileEditorEdModeToolkit::GetToolkitFName() const
{
return FName("TileEditorEdMode");
}
FText FTileEditorEdModeToolkit::GetBaseToolkitName() const
{
return NSLOCTEXT("TileEditorEdModeToolkit", "DisplayName", "TileEditorEdMode Tool");
}
class FEdMode* FTileEditorEdModeToolkit::GetEditorMode() const
{
return GLevelEditorModeTools().GetActiveMode(FTileEditorEdMode::EM_TileEditorEdModeId);
}
#undef LOCTEXT_NAMESPACE
I hope someone can help me. Thank you in advance.