Goran Lazarevski 3bcab085f8 Initial commit
2025-03-20 11:06:26 +01:00

31 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraGameViewportClient.h"
#include "CommonUISettings.h"
#include "ICommonUIModule.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraGameViewportClient)
class UGameInstance;
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);
}
File Preview

No preview available for this file type. Click here to download