RealtimeStyleTransferRuntime/Plugins/GameSettings/Source/Private/EditCondition/WhenPlayingAsPrimaryPlayer.cpp

25 lines
815 B
C++
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "EditCondition/WhenPlayingAsPrimaryPlayer.h"
2022-09-13 07:18:28 +00:00
2022-05-23 18:41:30 +00:00
#include "Engine/LocalPlayer.h"
2022-09-13 07:18:28 +00:00
#include "GameSettingFilterState.h"
#include "Internationalization/Internationalization.h"
2022-05-23 18:41:30 +00:00
#define LOCTEXT_NAMESPACE "GameSetting"
TSharedRef<FWhenPlayingAsPrimaryPlayer> FWhenPlayingAsPrimaryPlayer::Get()
{
static TSharedRef<FWhenPlayingAsPrimaryPlayer> Instance = MakeShared<FWhenPlayingAsPrimaryPlayer>();
return Instance;
}
void FWhenPlayingAsPrimaryPlayer::GatherEditState(const ULocalPlayer* InLocalPlayer, FGameSettingEditableState& InOutEditState) const
{
if (!InLocalPlayer->IsPrimaryPlayer())
{
InOutEditState.Disable(LOCTEXT("OnlyPrimaryPlayerEditable", "Can only be changed by the primary player."));
}
}
#undef LOCTEXT_NAMESPACE