fpwong / BlueprintAssistWiki

47 stars 2 forks source link

BABlueprintActionMenu.cpp doesn't compile for ue5-main 5.5 #175

Closed geekrelief closed 6 months ago

geekrelief commented 6 months ago

When compiling against ue5-main, v5.5, I get an error.

Error   C2440   'initializing': cannot convert from 'FGraphActionListBuilderBase::ActionGroup' to 'FGraphActionListBuilderBase::ActionGroup &'  UIUMG   D:\UE5-main\Engine\Plugins\Marketplace\BlueprintAssist\Source\BlueprintAssist\Private\BlueprintAssistWidgets\BABlueprintActionMenu.cpp  256     

In BABlueprintActionMenu.cpp, line 223

FBlueprintActionMenuBuilder MenuBuilder;

Derives from EdGraphSchema.h's, FGraphActionListBuilderBase where ActionGroup has been deprecated

    class UE_DEPRECATED(5.5, "ActionGroup has been deprecated - operate only on TSharedPtr<FEdGraphSchemaAction> or const FEdGraphSchemaAction& as appropriate") 

In BABlueprintActionMenu.cpp on line 256, the call to MenuBuilder.GetAction needs to be replaced with GetSchemaAction.

The code in the for loop on line 254 can compile with this (looks sensible to me, but hopefully you will double check):

        for (int i = 0; i < MenuBuilder.GetNumActions(); ++i)
        {
#if BA_UE_VERSION_OR_LATER(5, 5)
            TSharedPtr<FEdGraphSchemaAction> EdGraphSchemaAction = MenuBuilder.GetSchemaAction(i);
            Items.Add(MakeShared<FBAActionMenuItem>(EdGraphSchemaAction));
#else
            FGraphActionListBuilderBase::ActionGroup& ActionGroup = MenuBuilder.GetAction(i);
            for (TSharedPtr<FEdGraphSchemaAction> EdGraphSchemaAction : ActionGroup.Actions)
            {
                Items.Add(MakeShared<FBAActionMenuItem>(EdGraphSchemaAction));
            }
#endif
        }
fpwong commented 6 months ago

Thanks for letting me know, currently have some pc issues so it might be a while until I can double-check this on the main branch.

Looking at the code here I think your fix is good, I'll add this in the next update 👍

fpwong commented 6 months ago

Added in 4.2.15 https://github.com/fpwong/BlueprintAssistWiki/releases/tag/4.2.15