Let me say first I Hate Event Callbacks…
Ok so i have some events in my Class HudControl
public:
UFUNCTION(BlueprintNativeEvent, Category=MouseEvent)
void OnMouseClick();
The problem comes why i try to add a C++ coded event into the event. so i have
UQuestWindow::UQuestWindow(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
this->SetUp(0, 0, 450, 550, true);
UHudWindowButton* AcceptBtn = NewObject<UHudWindowButton>();
AcceptBtn->SetUp(this->GetBounds().right - 116, this->GetBounds().bottom - 32, 116, 32, true);
AcceptBtn->SetText(" Accept");
AcceptBtn->OnMouseClick.AddDynamic(this, &UQuestWindow::AcceptButtonClick);
}
void UQuestWindow::AcceptButtonClick(){
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("Button Clicked")));
this->Disable();
}
But all i get is
Error 1 error C2228: left of ‘.__Internal_AddDynamic’ must have class/struct/union {OMITED}\Unreal Projects\Assesment2\Source\Assesment2\QuestWindow.cpp 14 1 Assesment2
How do i bind my event in QuestWindow to the UFunction Event i have created in the HudWindowButton Class?