Bugfix Need Reload UI Persisting on Overlay State Change
This commit is contained in:
parent
42f86bc2f2
commit
c042d6f3af
@ -490,6 +490,7 @@ void AEndlessVendettaCharacter::EquipPrimary()
|
|||||||
//PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket"));
|
//PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket"));
|
||||||
PrimaryWeapon->SetActorHiddenInGame(true);
|
PrimaryWeapon->SetActorHiddenInGame(true);
|
||||||
PrimaryWeapon->SetActorEnableCollision(false);
|
PrimaryWeapon->SetActorEnableCollision(false);
|
||||||
|
PrimaryWeapon->HideNeedReloadUI();
|
||||||
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), PrimaryWeapon->IsHidden());
|
UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), PrimaryWeapon->IsHidden());
|
||||||
PrimaryWeapon = nullptr;
|
PrimaryWeapon = nullptr;
|
||||||
@ -544,6 +545,10 @@ void AEndlessVendettaCharacter::EquipPrimary()
|
|||||||
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
||||||
PrimaryWeapon->SetActorHiddenInGame(false);
|
PrimaryWeapon->SetActorHiddenInGame(false);
|
||||||
PrimaryWeapon->SetActorEnableCollision(false);
|
PrimaryWeapon->SetActorEnableCollision(false);
|
||||||
|
if (PrimaryWeapon->currentAmmoCount <= 0)
|
||||||
|
{
|
||||||
|
PrimaryWeapon->ShowNeedReloadUI();
|
||||||
|
}
|
||||||
//GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
|
//GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
|
||||||
bIsCurrentlyHoldingWeapon = true;
|
bIsCurrentlyHoldingWeapon = true;
|
||||||
bHasRifle = true;
|
bHasRifle = true;
|
||||||
@ -568,6 +573,7 @@ void AEndlessVendettaCharacter::EquipSecondary()
|
|||||||
SecondaryWeapon->SetActorHiddenInGame(true);
|
SecondaryWeapon->SetActorHiddenInGame(true);
|
||||||
SecondaryWeapon->SetActorEnableCollision(false);
|
SecondaryWeapon->SetActorEnableCollision(false);
|
||||||
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
|
||||||
|
SecondaryWeapon->HideNeedReloadUI();
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
|
UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
|
||||||
//the nullptr makes it so we can unequip and requip the same weapon
|
//the nullptr makes it so we can unequip and requip the same weapon
|
||||||
SecondaryWeapon = nullptr;
|
SecondaryWeapon = nullptr;
|
||||||
@ -611,6 +617,10 @@ void AEndlessVendettaCharacter::EquipSecondary()
|
|||||||
SecondaryWeaponActor = HeldWeapon->GetChildActor();
|
SecondaryWeaponActor = HeldWeapon->GetChildActor();
|
||||||
SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
|
SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
|
||||||
SecondaryWeapon->SetActorHiddenInGame(false);
|
SecondaryWeapon->SetActorHiddenInGame(false);
|
||||||
|
if (SecondaryWeapon->currentAmmoCount <= 0)
|
||||||
|
{
|
||||||
|
SecondaryWeapon->ShowNeedReloadUI();
|
||||||
|
}
|
||||||
bIsCurrentlyHoldingWeapon = true;
|
bIsCurrentlyHoldingWeapon = true;
|
||||||
SetOverlayState(EOverlayState::Pistol);
|
SetOverlayState(EOverlayState::Pistol);
|
||||||
GetWorldTimerManager().ClearTimer(SecondaryWeapon->reloadTimerHandle);
|
GetWorldTimerManager().ClearTimer(SecondaryWeapon->reloadTimerHandle);
|
||||||
|
Loading…
Reference in New Issue
Block a user