46 lines
1023 B
C++
46 lines
1023 B
C++
// Unreal Fighting Framework by Kevin Poretti
|
|
|
|
#include "FFPlayerController.h"
|
|
|
|
// FF includes
|
|
#include "FFInputBufferComponent.h"
|
|
|
|
// UE includes
|
|
#include "EnhancedInputSubsystems.h"
|
|
|
|
AFFPlayerController::AFFPlayerController()
|
|
{
|
|
InputBuffer = CreateDefaultSubobject<UFFInputBufferComponent>(TEXT("InputBuffer"));
|
|
}
|
|
|
|
|
|
void AFFPlayerController::SendInputsToRemote() const
|
|
{
|
|
}
|
|
|
|
|
|
void AFFPlayerController::FixedTick(float OneFrame)
|
|
{
|
|
//UnacknowledgedInputs.Push(CurrInput);
|
|
InputBuffer->AddInput(CurrInput);
|
|
|
|
SendInputsToRemote();
|
|
}
|
|
|
|
|
|
void AFFPlayerController::SetupInputComponent()
|
|
{
|
|
Super::SetupInputComponent();
|
|
|
|
if (ULocalPlayer* LocalPlayer = Cast<ULocalPlayer>(Player))
|
|
{
|
|
if (UEnhancedInputLocalPlayerSubsystem* InputSystem = LocalPlayer->GetSubsystem<UEnhancedInputLocalPlayerSubsystem>())
|
|
{
|
|
if (!DefaultInputMapping.IsNull())
|
|
{
|
|
InputSystem->AddMappingContext(DefaultInputMapping.LoadSynchronous(), 0);
|
|
}
|
|
}
|
|
}
|
|
}
|