diff --git a/Source/OpenConflict/PlayerCharacter/DDIPlayerController.cpp b/Source/OpenConflict/PlayerCharacter/DDIPlayerController.cpp index ca8cad1..69384e8 100644 --- a/Source/OpenConflict/PlayerCharacter/DDIPlayerController.cpp +++ b/Source/OpenConflict/PlayerCharacter/DDIPlayerController.cpp @@ -2,6 +2,8 @@ #include "DDIPlayerController.h" + +#include "DDICharacter.h" #include "EnhancedInputSubsystems.h" #include "Engine/LocalPlayer.h" #include "InputMappingContext.h" @@ -18,4 +20,21 @@ void ADDIPlayerController::BeginPlay() } } +} + +void ADDIPlayerController::SetupInputComponent() +{ + // Super::SetupInputComponent(); +} + +void ADDIPlayerController::OnPossess(APawn* InPawn) +{ + Super::OnPossess(InPawn); + + // is this a shooter character? + if (ADDICharacter* DDICharacter = Cast(InPawn)) + { + // add the player tag + DDICharacter->Tags.Add(PlayerPawnTag); + } } \ No newline at end of file diff --git a/Source/OpenConflict/PlayerCharacter/DDIPlayerController.h b/Source/OpenConflict/PlayerCharacter/DDIPlayerController.h index 4cb1737..964cc19 100644 --- a/Source/OpenConflict/PlayerCharacter/DDIPlayerController.h +++ b/Source/OpenConflict/PlayerCharacter/DDIPlayerController.h @@ -13,10 +13,45 @@ UCLASS() class OPENCONFLICT_API ADDIPlayerController : public APlayerController { GENERATED_BODY() + /*UPROPERTY and UFUNCTION declarations*/ +private: + /*Properties*/ - virtual void BeginPlay() override; + /*Functions*/ - UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess=true)) +protected: + /*Properties*/ + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Shooter", meta = (AllowPrivateAccess = "true")) TArray MappingContexts; + + UPROPERTY(EditAnywhere, Category="Shooter") + FName PlayerPawnTag = FName("Player"); + + /*Functions*/ + + +public: + /*Properties*/ + + /*Functions*/ + + /*C++ only declarations*/ +private: + /*Properties*/ + + /*Functions*/ + +protected: + /*Properties*/ + + /*Functions*/ + virtual void SetupInputComponent() override; + virtual void BeginPlay() override; + virtual void OnPossess(APawn *InPawn) override; + +public: + /*Properties*/ + + /*Functions*/ };