Hi!
I’m trying to create a plugin. But I don’t know much about it.
While training I face a problem. I can’t use the function after clicking the button.
I used this template:
ModularBuild.h
class FModularBuildModule : public IModuleInterface
{
public:
FModularBuildModule();
//UFUNCTION()
FReply TestS();
ModularBuild.cpp
[...]
TSharedRef<SDockTab> FModularBuildModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
return SNew(SDockTab).TabRole(ETabRole::NomadTab)
[
// Put your tab content here!
SNew(SBox)
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
[
SNew(SButton)
.Text(FText::FromString(TEXT("Push")))
.ContentPadding(3)
.OnClicked(this, &FModularBuildModule::TestS)
]
];
}
[...]
FReply FModularBuildModule::TestS()
{
UE_LOG(LogTemp, Log, TEXT("It win"));
return FReply::Handled();
}
Error:
[Error_txt][2] or
1>g:\programs\epic games\4.13\engine\source\runtime\core\public\delegates\DelegateSignatureImpl.INL(181): error c2039: total: is not a member of "FModularBuildModule"
1> G:\Programs\DeadMind\DeadMind\Plugins\ModularBuild\Source\ModularBuild\Public\ModularBuild.h(13) note: see the announcement "FModularBuildModule"
1> G:\Programs\Epic Games\4.13\Engine\Source\Environment\Slate\Public\Widgets\Input\SButton.h(54): note: see reference to instantiation of a function template at compile "TBaseDelegate<FReply> TBaseDelegate<FReply>::CreateSP<Userclass,>(Userclass *,FReply (__cdecl FModularBuildModule::* )(void))"
1>
1> [
1> Userclass=FModularBuildModule
1> ]
1> G:\Programs\Epic Games\4.13\Engine\Source\Environment\Slate\Public\Widgets\Input\SButton.h(54): note: see reference to instantiation of a function template at compile "TBaseDelegate<FReply> TBaseDelegate<FReply>::CreateSP<Userclass,>(Userclass *,FReply (__cdecl FModularBuildModule::* )(void))"
1>
1> [
1> Userclass=FModularBuildModule
1> ]
1> G:\Programs\DeadMind\DeadMind\Plugins\ModularBuild\Source\ModularBuild\Private\ModularBuild.cpp(78): note: see reference to instantiation of a function template at compile "SButton::FArguments::WidgetArgsType &SButton::FArguments::OnClicked<FModularBuildModule>(Userclass *,FReply (__cdecl FModularBuildModule::* )(void))"
1>
1> [
1> Userclass=FModularBuildModule
1> ]
1>error : UBT error : failed to produce item: G:\Programs\DeadMind\DeadMind\Plugins\ModularBuild\Binaries\Win64\UE4Editor-ModularBuild-5456.dll
1> Total build time: 88,75 seconds
1>files c:\program (x86)\msbuild\Microsoft.CPP\V4.0\V140\Microsoft.The makefile.Targets(37,5): MSB3075 error: Output of command ""G:\Programs\Epic game engine\\4.13\build\\BatchFiles to build.bat" DeadMindEditor Win64 development "G:\Programs\DeadMind\DeadMind\DeadMind.uproject" -waitmutex"