Added ammo ui refresh on ammo pickup

This commit is contained in:
TjgL 2025-01-24 21:20:19 +01:00
parent 8265363b28
commit ebfc6f0b61
8 changed files with 16 additions and 10 deletions

View File

@ -158,3 +158,6 @@ ManualIPAddress=
+CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
+CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")
[/Script/UnrealEd.CookerSettings]
bCookOnTheFlyForLaunchOn=True

Binary file not shown.

BIN
Content/Legumix/Player/BP_Play.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Weapon/BP_Ammo.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -40,9 +40,10 @@ void ALMPlayer::PickUpAmmo(ALMAmmo* Ammo)
if (GEngine)
{
FString AmmoAmount = FString::Printf(TEXT("Quantité de munition : %i"), Ammo->GetAmmoAmount());
GEngine->AddOnScreenDebugMessage(1, 30.f, FColor::Red, AmmoAmount);
GEngine->AddOnScreenDebugMessage(INDEX_NONE, 30.f, FColor::Red, AmmoAmount);
}
WeaponManager->AddAmmoType(Ammo->GetAmmoType(), Ammo->GetAmmoAmount());
OnAmmoPickup();
}
int ALMPlayer::GetAmmoCount(const EAmmoType AmmoType) const

View File

@ -71,6 +71,8 @@ public:
void WeaponReloaded();
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void WeaponSwitched();
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
void OnAmmoPickup();
UFUNCTION(BlueprintImplementableEvent)
void OnEnnemyHit();