Bugfix BindAction Consuming Left Mouse Input

This commit is contained in:
Philip W 2023-04-26 03:22:13 +01:00
parent f7c4fdac3f
commit 0c13de4668
3 changed files with 6 additions and 6 deletions

Binary file not shown.

View File

@ -32,9 +32,6 @@ void UHoldToInitCombat::BeginPlay()
InitCombatWidget->SetVisibility(ESlateVisibility::Hidden);
ReloadSlider = Cast<URadialSlider>(InitCombatWidget->GetWidgetFromName("ReloadSlider"));
UInputComponent* PlayerInputComponent = GetWorld()->GetFirstPlayerController()->InputComponent;
PlayerInputComponent->BindAction("Click", IE_Pressed, this, &UHoldToInitCombat::OnClickDown);
}
@ -60,6 +57,7 @@ void UHoldToInitCombat::TickComponent(float DeltaTime, ELevelTick TickType, FAct
void UHoldToInitCombat::OnClickDown()
{
if (Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->bIsInCombat) return;
if (ReloadTimer > 0.0f) return;
if (GunEffect)
{

View File

@ -29,6 +29,9 @@ public:
UPROPERTY(EditAnywhere)
float ReloadTime = 1.0f;
UFUNCTION(BlueprintCallable)
void OnClickDown();
protected:
// Called when the game starts
virtual void BeginPlay() override;
@ -38,7 +41,6 @@ public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
private:
void OnClickDown();
bool bClickDown = false;
float ReloadTimer = 0.0f;