Greetings,
I have a custom plugin that has this following function that adds a button to the toolbar:
void HamadsPluginModule::AddToolbarExtension(FToolBarBuilder &builder)
{
UE_LOG(MyPlugin, Log, TEXT("Starting Extension logic"));
builder.PushCommandList(MyPluginCommands.ToSharedRef());
builder.AddToolBarButton(FHamadsPluginCommands::Get().MyButton, NAME_None, LOCTEXT("MyButton_Override", "My Button"), LOCTEXT("MyButton_ToolTipOverride", "Click me to display a message"), TAttribute<FSlateIcon>(), "HamadsPluginAwesomeButton");
}
I want to just better understand AddToolBarButton() since I essentially copied it from somewhere and edited it. So I’d like to understand its parameters:
1- The 2nd param: takes in an extension hook. That has been already defined while initializing this delegate, I’m wondering why would it need another hook in here?
2- 3rd param: LOCTEXT() if I’m correct is “localized text”, so I can have my buttons text localized. Could someone explain what is its first param, in this case this value MyButton_Override ? (it was WorldProperties_Override, but renamed it to fit the name of my button). I think this is like a key/value pair, so where can I define MyButton_Override?
4- 5th param: TAttribute(). This is obviously the icon for the button, I’m wondering what syntax should I use to set it up and where can I store the icon? Is it possible that I can make it reside in my plugin’s resource folder?
5- last param: What is a tutorial highlight?? What should I do here?
That’s it, and thanks!