Hi! Coming from C# Unity, I am still scraching my head in search for best practicies. Here is what I am struggling with now:
Inside my custom controller, I reference the UMG buttons:
startGameButton = (UButton*)MyMainMenu->GetWidgetFromName(TEXT("BStartGame"));
startGameButton->OnClicked.AddDynamic(this, &AMainMenuController::BStartGame_Click);
Now, if that was C# Unity, instead of swarming my character contrtoller class with many BStartGame_Click, BExitGame_Click and e.t.c functions, I would have created seperate class (component) ‘MenuButtonHandler’, attach it to the buttons, and inside that class, I would handle OnClick, OnTick, OnMouseEnter and e.t.c. for every button;
Here I have ‘UButton’ class - is there some C++ proper way to extend it in such a way I would do it in C#? Should I just wrap UButton is some super-class, and assign my Ubutton Widget as reference in there, and handle events from inside? Or there is some better way? I also want it to have animations. Maybe the best way here is to create some new widget ‘animated button’, based on UBUtton, and use it inside UMG Editor?
P.S. There is no mouse_over, mouse_out for buttons, only isHovering - which means - I should check isHovering check inside OnTick function every frame? But UButton does not have onTick implementation too