Bugfix BindAction Consuming Left Mouse Input
This commit is contained in:
parent
f7c4fdac3f
commit
0c13de4668
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/CombatCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -32,9 +32,6 @@ void UHoldToInitCombat::BeginPlay()
|
|||||||
InitCombatWidget->SetVisibility(ESlateVisibility::Hidden);
|
InitCombatWidget->SetVisibility(ESlateVisibility::Hidden);
|
||||||
|
|
||||||
ReloadSlider = Cast<URadialSlider>(InitCombatWidget->GetWidgetFromName("ReloadSlider"));
|
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()
|
void UHoldToInitCombat::OnClickDown()
|
||||||
{
|
{
|
||||||
|
if (Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState())->bIsInCombat) return;
|
||||||
if (ReloadTimer > 0.0f) return;
|
if (ReloadTimer > 0.0f) return;
|
||||||
if (GunEffect)
|
if (GunEffect)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
float ReloadTime = 1.0f;
|
float ReloadTime = 1.0f;
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void OnClickDown();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Called when the game starts
|
// Called when the game starts
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
@ -38,7 +41,6 @@ public:
|
|||||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnClickDown();
|
|
||||||
bool bClickDown = false;
|
bool bClickDown = false;
|
||||||
float ReloadTimer = 0.0f;
|
float ReloadTimer = 0.0f;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user