FToolBarBuilder::PushCommandList() causes both Simulate and Play buttons in the toolbar to not run

Greetings,

So I have created a simple plugin that extends the editor by adding a button to the toolbar and it works perfectly. During my testing though, I noticed that both Simulate and Play buttons do not execute. I click them and nothing happens. So I finally could identify where the problem is coming from. In the function that I use to create the button, I have:

builder.AddToolBarButton(FHamadsPluginCommands::Get().MyButton, etc etc); //builder is a FToolBarBuilder

One line before that, I have:

builder.PushCommandList(MyPluginCommands.ToSharedRef()); 

When I commented the above line, Simulate & Play buttons worked like before. Any ideas on what could be causing this? Is this a possible bug?

Thanks,

Ok, I solved it. After the builder.AddToolBarButton(), I added:

builder.PopCommandList();

So basically, for anyone experiencing the same issue, you need to first push the commands, add all the buttons that you need, and then pop the command list. Otherwise, it won’t work properly.