continued setup

This commit is contained in:
2025-11-22 00:34:20 -05:00
parent c91d73ed33
commit a59399ebfe
2 changed files with 56 additions and 2 deletions

View File

@@ -2,6 +2,8 @@
#include "DDIPlayerController.h" #include "DDIPlayerController.h"
#include "DDICharacter.h"
#include "EnhancedInputSubsystems.h" #include "EnhancedInputSubsystems.h"
#include "Engine/LocalPlayer.h" #include "Engine/LocalPlayer.h"
#include "InputMappingContext.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<ADDICharacter>(InPawn))
{
// add the player tag
DDICharacter->Tags.Add(PlayerPawnTag);
}
} }

View File

@@ -13,10 +13,45 @@ UCLASS()
class OPENCONFLICT_API ADDIPlayerController : public APlayerController class OPENCONFLICT_API ADDIPlayerController : public APlayerController
{ {
GENERATED_BODY() 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<class UInputMappingContext*> MappingContexts; TArray<class UInputMappingContext*> 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*/
}; };