RealtimeStyleTransferRuntime/Source/LyraGame/UI/LyraGameViewportClient.cpp

27 lines
1002 B
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraGameViewportClient.h"
#include "CommonUISettings.h"
#include "NativeGameplayTags.h"
#include "ICommonUIModule.h"
namespace GameViewportTags
{
UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_Platform_Trait_Input_HardwareCursor, "Platform.Trait.Input.HardwareCursor");
}
ULyraGameViewportClient::ULyraGameViewportClient()
: Super(FObjectInitializer::Get())
{
}
void ULyraGameViewportClient::Init(struct FWorldContext& WorldContext, UGameInstance* OwningGameInstance, bool bCreateNewAudioDevice)
{
Super::Init(WorldContext, OwningGameInstance, bCreateNewAudioDevice);
// We have software cursors set up in our project settings for console/mobile use, but on desktop we're fine with
// the standard hardware cursors
const bool UseHardwareCursor = ICommonUIModule::GetSettings().GetPlatformTraits().HasTag(GameViewportTags::TAG_Platform_Trait_Input_HardwareCursor);
SetUseSoftwareCursorWidgets(!UseHardwareCursor);
}