I always want to show the mouse cursor, when I am in UIOnly or GameAndUI InputMode. So I thought I would be clever and would override SetInputMode() in my PlayerController class:
void ABasePlayerController::SetInputMode(const FInputModeDataBase & InData)
{
Super::SetInputMode(InData);
const FInputModeDataBase* InDataPtr = &InData;
const bool bIsGameOnlyInput = static_cast<const FInputModeGameOnly*>(InDataPtr) != NULL;
bShowMouseCursor = bIsGameOnlyInput ? false : true; // Always show the mouse, when in UI Mode
}
Fortunately the code is compiling, but unfortunately the code is not working. When I log out bIsGameOnlyInput, it is always true, even though I am clearly in GameAndUI InputMode, because I can interact with my UI and I can control my Pawn.
Do You have any ideas, how else I can check whether the “const FInputModeDataBase & InData” parameter is of type FInputModeGameOnly?