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.


    class SMainMenuUI : public SCompoundWidget
            : _MenuHUD()
        SLATE_ARGUMENT(TWeakObjectPtr<class AMainMenuHUD>, MenuHUD);

     TSharedPtr<class SMainMenuUI> MainMenuUI;


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:


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