Created Show and Hide Widget Functions

This commit is contained in:
MH261677 2024-02-19 13:09:51 +00:00 committed by PHILIP WHITE
parent d408958096
commit 220f9ef159
2 changed files with 9 additions and 0 deletions

View File

@ -200,10 +200,12 @@ void ABaseWeaponClass::Fire()
if (!Cast<AAICharacter>(outHit.GetActor())) return;
Cast<AAICharacter>(outHit.GetActor())->TakeDamage(tempWeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
}
HideNeedReloadUI();
}
else if(currentAmmoCount <= 0)
{
UE_LOG(LogTemp, Display, TEXT("No ammo, Ammo count: %d"), currentAmmoCount);
ShowNeedReloadUI();
}
}
@ -241,6 +243,7 @@ void ABaseWeaponClass::WeaponReload()
currentAmmoCount = MagazineSize;
endlessVendettaChar->bIsReloading = false;
HideReloadingWidget();
HideNeedReloadUI();
}
}

View File

@ -179,6 +179,12 @@ public:
UFUNCTION(BlueprintCallable)
void SetupSilencerAttachment(UStaticMesh* SilencerMesh);
UFUNCTION(BlueprintImplementableEvent)
void ShowNeedReloadUI();
UFUNCTION(BlueprintImplementableEvent)
void HideNeedReloadUI();
protected:
UArrowComponent* GunStartArrow;
bool bStopShooting = false;