Hi everyone,
I’ve finished my menus and they work perfectly fine with a mouse and a keyboard. Now I’m trying to implement Gamepad navigation but I’ve found myself stuck with Input Key Selector.
Most of my menus are Buttons, so when I’m using a gamepad to navigate I simply check at the tick which button has the Keyboard Focus to change its color. So far this was working perfectly fine, enven tough it might not be the best system. But for my input settings menu that doesn’t contains just Buttons but also Input Key Selector this is not working at all.
I wanted to check at the tick in this menu which Input Key Selector has the Keyboard Focus so I can change its Tint Color but it doesn’t seems to be possible. I’ve tried to change it directly or to use the FButtonStyle::SetNormal function but I can’t compile.
Here’s my code that I try to do in the tick if the Input Key Selector has the Keyboard Focus. I try to apply the color of its Hovered state.
if (UInputKeySelector* InputKeySelector = Cast<UInputKeySelector>(InWidget))
{
FSlateBrush HoverSlate = InputKeySelector->WidgetStyle.Hovered;
InputKeySelector->GetButtonStyle().SetNormal(HoverSlate);
}
And here’s the error message that I have :
error C2662: 'FButtonStyle &FButtonStyle::SetNormal(const FSlateBrush &)': cannot convert 'this' pointer from 'const FButtonStyle' to 'FButtonStyle &'
I know I’m missing something here but I can’t figure what it is.
Can someone please tell me what I’m doing wrong ?
Thank you for your time.