How to open a EditorWidget via "EditorToolbarButton" Plugin

Viewed 766

I'd like to open up a Editor Widget that accepts User Inputs via the Editor Toolbar Button Plugin given in UE4 4.23. The problems are not the Inputs, I got that sorted out. Rather to really have a window that pops up as soon as I hit that Plugin Button. I am fairly new to Unreal and C++ (Round about 3 weeks)

https://isaratech.com/ue4-programmatically-starting-an-editor-utility-widget/

I used these informations from isaratech. But I am already stuck at:

#include "CoreMinimal.h"
#include "Editor/Blutility/Classes/EditorUtilityWidget.h"
#include "Runtime/Engine/Classes/Kismet/BlueprintFunctionLibrary.h"
#include "EditorWidgetFunctionLibrary.generated.h"

UCLASS(BlueprintType)
class CPPEDITORWIDGET_API UEditorWidgetFunctionLibrary : public 
UBlueprintFunctionLibrary
{
    GENERATED_BODY()

public:
    UFUNCTION(BlueprintCallable)
        static void StartWidget(UWidgetBlueprint* Blueprint);
};

But this isn't working at all. For instance I get problems with the GENERATED_BODY() when I include #include "Editor/Blutility/Classes/EditorUtilityWidget.h". Saying it has not enough storage. I fix the GENERATED_BODY() problem when suddenly UWidgetBlueprint is not defined anymore, but it was just a second ago. Fix that problem and suddenly the generated.h is not callable from the folder anymore. Saying it doesn't exist. I am in quite a loophole and kinda lost.

I've tried looking into it if 4.22 and 4.23 differentiate that much since the Isartech "Tutorial" is based on 4.22 but I got no luck in both versions.

What I expect is that I press on the Toolbar Plugin and it opens the Editor Widget. Isaratech has been the best explanation so far but still a bit skinny to what I expected. And everything else is just not what I really needed. I know UE4 4.23 is fairly new but I still hope someone knows the answer. Right now that is the only thing we are stuck at. If this question needs any more elaboration I will try my best.

0 Answers
Related