Files
TG_ARPG/Plugins/CommonGame/Source/Public/CommonLocalPlayer.h

56 lines
1.9 KiB
C
Raw Normal View History

2023-08-28 03:38:23 +08:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Engine/LocalPlayer.h"
#include "CommonLocalPlayer.generated.h"
2025-07-15 00:36:32 +08:00
#define UE_API COMMONGAME_API
2023-08-28 03:38:23 +08:00
class APawn;
class APlayerController;
class APlayerState;
class FViewport;
class UObject;
class UPrimaryGameLayout;
struct FSceneViewProjectionData;
2025-07-15 00:36:32 +08:00
UCLASS(MinimalAPI, config=Engine, transient)
class UCommonLocalPlayer : public ULocalPlayer
2023-08-28 03:38:23 +08:00
{
GENERATED_BODY()
public:
2025-07-15 00:36:32 +08:00
UE_API UCommonLocalPlayer();
2023-08-28 03:38:23 +08:00
/** Called when the local player is assigned a player controller */
DECLARE_MULTICAST_DELEGATE_TwoParams(FPlayerControllerSetDelegate, UCommonLocalPlayer* LocalPlayer, APlayerController* PlayerController);
FPlayerControllerSetDelegate OnPlayerControllerSet;
/** Called when the local player is assigned a player state */
DECLARE_MULTICAST_DELEGATE_TwoParams(FPlayerStateSetDelegate, UCommonLocalPlayer* LocalPlayer, APlayerState* PlayerState);
FPlayerStateSetDelegate OnPlayerStateSet;
/** Called when the local player is assigned a player pawn */
DECLARE_MULTICAST_DELEGATE_TwoParams(FPlayerPawnSetDelegate, UCommonLocalPlayer* LocalPlayer, APawn* Pawn);
FPlayerPawnSetDelegate OnPlayerPawnSet;
2025-07-15 00:36:32 +08:00
UE_API FDelegateHandle CallAndRegister_OnPlayerControllerSet(FPlayerControllerSetDelegate::FDelegate Delegate);
UE_API FDelegateHandle CallAndRegister_OnPlayerStateSet(FPlayerStateSetDelegate::FDelegate Delegate);
UE_API FDelegateHandle CallAndRegister_OnPlayerPawnSet(FPlayerPawnSetDelegate::FDelegate Delegate);
2023-08-28 03:38:23 +08:00
public:
2025-07-15 00:36:32 +08:00
UE_API virtual bool GetProjectionData(FViewport* Viewport, FSceneViewProjectionData& ProjectionData, int32 StereoViewIndex) const override;
2023-08-28 03:38:23 +08:00
bool IsPlayerViewEnabled() const { return bIsPlayerViewEnabled; }
void SetIsPlayerViewEnabled(bool bInIsPlayerViewEnabled) { bIsPlayerViewEnabled = bInIsPlayerViewEnabled; }
2025-07-15 00:36:32 +08:00
UE_API UPrimaryGameLayout* GetRootUILayout() const;
2023-08-28 03:38:23 +08:00
private:
bool bIsPlayerViewEnabled = true;
};
2025-07-15 00:36:32 +08:00
#undef UE_API