Hey! I’ve found plenty of examples online and in the editor source code. I’ve tried them, but none worked…
Any help would be very much appreciated
Errors:
- ‘AsShared’: is not a member of ‘FVFEditorModule’ - C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl - Line:197
- ‘StaticCastSharedRef’: no matching overloaded function found - C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl - Line: 197
- ‘TBaseDelegate::CreateSP’: no matching overloaded function found - C:\Program Files\Epic Games\UE_4.16\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl - Line: 197
VFEditor.h:
class FVFEditorModule : public IModuleInterface
{
public:
// Plugin/Module functions
private:
FReply OnNewButtonClicked();
FReply OnOpenButtonClicked();
FReply OnSaveButtonClicked();
};
VFEditor.cpp:
TSharedRef<SDockTab> FVFEditorModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
FText NewButton = FText::FromString("New File");
FText NewToolTip = FText::FromString("Make a new .fga file!");
return SNew(SDockTab)
.TabRole(ETabRole::NomadTab)
[
// New file button
SNew(SButton)
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
.Text(NewButton)
.ToolTipText(NewToolTip)
.DesiredSizeScale(FVector2D(100.0f, 60.0f))
.OnClicked(this, &FVFEditorModule::OnNewButtonClicked)
];
}
FReply FVFEditorModule::OnNewButtonClicked()
{
return FReply::Handled();
}