Check user input

I adapted a debug macro from the UE wiki

#define SCREENDEBUG(Format, ...) \
{ \
	if (!ensure(GEngine != nullptr)) return; \
    const FString Msg = FString::Printf(TEXT(Format), ##__VA_ARGS__); \
    GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, Msg); \
}

void UPuzzlePlatformsGameInstance::Host()
{
	SCREENDEBUG("Hosting");
}

void UPuzzlePlatformsGameInstance::Join(const FString& Address) const
{
     if (Address == "")  return;
    SCREENDEBUG("Joining %s", *Address);
}
1 Like

This is so handy. Thanks for sharing.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms