Need help understanding Slate Mutators

Hi, I was going through. I understand most of it but I got doubts on how mutators work and what exactly they do.

.h

    class SMainMenuUI : public SCompoundWidget
    {
        SLATE_BEGIN_ARGS(SMainMenuUI)
            : _MenuHUD()
        {
        }
     
        SLATE_ARGUMENT(TWeakObjectPtr<class AMainMenuHUD>, MenuHUD);
     
        SLATE_END_ARGS()
    .................
    .................


     TSharedPtr<class SMainMenuUI> MainMenuUI;
    };

.cpp

void SMainMenuUI::Construct(const FArguments& args)
{
    MenuHUD = args._MenuHUD;
 
    ...............
}

Here what is _MenuHUD and what does args._MenuHUD; do?

SLATE_BEGIN_ARGS and SLATE_END_ARGS actually create a struct containing variables added by the SLATE_ARGUMENT, SLATE_ATTRIBUTE, and SLATE_EVENT macros.

The name given to those variables is in the form of _TheNameYouGaveIt.

SLATE_ARGUMENT creates a variable of the exact type you gave it, so SLATE_ARGUMENT(int, MyThing) makes a variable of type int, with the name _MyThing.

SLATE_ATTRIBUTE creates a TAttribute for the type you gave it, so SLATE_ATTRIBUTE(int, MyThing) makes a variable of type TAttribute, with the name _MyThing.

Additionally the macros define a series of functions to allow you to set the variable they add, which are named based on TheNameYouGaveIt.

That should have been:

TAttribute<int>

It seems AnswerHub allows pointy brackets in its block code tags, but not its inline code tags :frowning: