|
|
|
|
| #pragma once
|
|
|
| #include "CommonLocalPlayer.h"
|
| #include "Teams/LyraTeamAgentInterface.h"
|
|
|
| #include "LyraLocalPlayer.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| struct FGenericTeamId;
|
|
|
| class APlayerController;
|
| class UInputMappingContext;
|
| class ULyraSettingsLocal;
|
| class ULyraSettingsShared;
|
| class UObject;
|
| class UWorld;
|
| struct FFrame;
|
| struct FSwapAudioOutputResult;
|
|
|
| |
| |
|
|
| UCLASS(MinimalAPI)
|
| class ULyraLocalPlayer : public UCommonLocalPlayer, public ILyraTeamAgentInterface
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
|
|
| UE_API ULyraLocalPlayer();
|
|
|
|
|
| UE_API virtual void PostInitProperties() override;
|
|
|
|
|
|
|
| UE_API virtual void SwitchController(class APlayerController* PC) override;
|
|
|
|
|
|
|
| UE_API virtual bool SpawnPlayActor(const FString& URL, FString& OutError, UWorld* InWorld) override;
|
| UE_API virtual void InitOnlineSession() override;
|
|
|
|
|
|
|
| UE_API virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override;
|
| UE_API virtual FGenericTeamId GetGenericTeamId() const override;
|
| UE_API virtual FOnLyraTeamIndexChangedDelegate* GetOnTeamIndexChangedDelegate() override;
|
|
|
|
|
|
|
| UFUNCTION()
|
| UE_API ULyraSettingsLocal* GetLocalSettings() const;
|
|
|
|
|
| UFUNCTION()
|
| UE_API ULyraSettingsShared* GetSharedSettings() const;
|
|
|
|
|
| UE_API void LoadSharedSettingsFromDisk(bool bForceLoad = false);
|
|
|
| protected:
|
| UE_API void OnSharedSettingsLoaded(ULyraSettingsShared* LoadedOrCreatedSettings);
|
|
|
| UE_API void OnAudioOutputDeviceChanged(const FString& InAudioOutputDeviceId);
|
|
|
| UFUNCTION()
|
| UE_API void OnCompletedAudioDeviceSwap(const FSwapAudioOutputResult& SwapResult);
|
|
|
| UE_API void OnPlayerControllerChanged(APlayerController* NewController);
|
|
|
| UFUNCTION()
|
| UE_API void OnControllerChangedTeam(UObject* TeamAgent, int32 OldTeam, int32 NewTeam);
|
|
|
| private:
|
| UPROPERTY(Transient)
|
| mutable TObjectPtr<ULyraSettingsShared> SharedSettings;
|
|
|
| FUniqueNetIdRepl NetIdForSharedSettings;
|
|
|
| UPROPERTY(Transient)
|
| mutable TObjectPtr<const UInputMappingContext> InputMappingContext;
|
|
|
| UPROPERTY()
|
| FOnLyraTeamIndexChangedDelegate OnTeamChangedDelegate;
|
|
|
| UPROPERTY()
|
| TWeakObjectPtr<APlayerController> LastBoundPC;
|
| };
|
|
|
| #undef UE_API
|
|
|