diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset index 10322752..65115eaa 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:204f09800ab34a8df692dd635861e31177dcc7370a59371da16fb22ae404cfd3 -size 1375365 +oid sha256:97cf82a1ff44c7d2a76dd22101a51b8814cb9448d8789d025acab58d2da3f907 +size 1406617 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset index 8af0f6e2..092ae16d 100644 --- a/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/C/ZX/8GZK30F02QUUO234VY329I.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1059f10fadb2631145ab8e4d90925171bb8d1a408e406985d552db36d4546b74 +oid sha256:25d61d11c54b882a0ca23aa6d56dad1a7d94e58966b7dc179727450a10f3217d size 8031 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 30554002..516f4f6a 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -54,7 +54,15 @@ void AEndlessVendettaCharacter::DecrementRestrictedBoundsCount() void AEndlessVendettaCharacter::ReloadAnimationComplete() { - bIsReloading = false; + if (IsValid(PrimaryWeapon)) + { + PrimaryWeapon->WeaponReload(); + } + if (IsValid(SecondaryWeapon)) + { + if (!bIsReloading) return; + SecondaryWeapon->WeaponReload(); + } } void AEndlessVendettaCharacter::SetOverlayState(const EOverlayState OverlayState) const @@ -639,12 +647,15 @@ void AEndlessVendettaCharacter::GunReload() if (InPauseMenu) return; if (IsValid(PrimaryWeapon)) { + if (PrimaryWeapon->currentAmmoCount == PrimaryWeapon->MagazineSize) return; PrimaryWeapon->ReloadTimer(); bIsReloading = true; } - if (IsValid(SecondaryWeapon)) + else if (IsValid(SecondaryWeapon)) { - SecondaryWeapon->ReloadTimer(); + if (SecondaryWeapon->currentAmmoCount == SecondaryWeapon->MagazineSize) return; + StartReload.Broadcast(); + SecondaryWeapon->ShowReloadingWidget(); bIsReloading = true; } } diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 86f2afef..01cc7651 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -150,7 +150,10 @@ public: void IncrementRestrictedBoundsCount(); UFUNCTION(BlueprintCallable) void DecrementRestrictedBoundsCount(); - DECLARE_DYNAMIC_MULTICAST_DELEGATE(FReloadAnimationComplete); + DECLARE_DYNAMIC_MULTICAST_DELEGATE(FStartReload); + + UPROPERTY(BlueprintAssignable, Category = "Weapon") + FStartReload StartReload; UFUNCTION(BlueprintCallable, Category = "Weapon") void ReloadAnimationComplete(); diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index 3219e7de..d934ea9e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -43,8 +43,6 @@ protected: float recoilResultPitch = 0; float recoilResultYaw = 0; - UFUNCTION(BlueprintImplementableEvent) - void ShowReloadingWidget(); UFUNCTION(BlueprintImplementableEvent) void HideReloadingWidget(); @@ -177,6 +175,9 @@ public: UFUNCTION(BlueprintCallable) void SetupSilencerAttachment(UStaticMesh* SilencerMesh); + UFUNCTION(BlueprintImplementableEvent) + void ShowReloadingWidget(); + UFUNCTION(BlueprintImplementableEvent) void ShowNeedReloadUI();