diff --git a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
index fadbc8bc..2c7e34b2 100644
--- a/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
+++ b/EndlessVendetta/.idea/.idea.EndlessVendetta/.idea/workspace.xml
@@ -8,14 +8,13 @@
-
+
-
-
-
-
+
+
+
@@ -59,7 +58,7 @@
]
}
}
-
+
@@ -139,13 +138,23 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
index 767d6a38..a0aa8667 100644
--- a/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
+++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f147d5f0aa2007afc8217367dae73fc3253c6769d2eef3aa85ca322865f9ebe8
-size 458476
+oid sha256:2c7bbe0e841e41f594ccb33dfaa31a8d80c43cf21a86cddb92bf0c665b214cec
+size 457638
diff --git a/EndlessVendetta/Content/Levels/MainMenuLevel.umap b/EndlessVendetta/Content/Levels/MainMenuLevel.umap
index 0d2dc821..fe673da4 100644
--- a/EndlessVendetta/Content/Levels/MainMenuLevel.umap
+++ b/EndlessVendetta/Content/Levels/MainMenuLevel.umap
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:fca5db6a6d4564927237fbb2b9912ac9d1a54605ef884b185ab519358657fba4
-size 299618
+oid sha256:215612d6840204435d8e381bb7fef7ae045f523adc98458ea1af9923b8a398ab
+size 299666
diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
index a237b7d5..0f990580 100644
--- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
+++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c7f3520860316911382655da081fb87bf2a4aa9996d85a363ccd279e1f32e90a
-size 66790690
+oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d
+size 72364642
diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
index bf2e4391..ff277171 100644
--- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
+++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d
-size 43456
+oid sha256:88536082006c52f9839140df065cb0cd6e96a7ca3ba2f95bb6002971c467a2e6
+size 53268
diff --git a/EndlessVendetta/EndlessVendetta.sln.DotSettings.user b/EndlessVendetta/EndlessVendetta.sln.DotSettings.user
new file mode 100644
index 00000000..3e7d92d6
--- /dev/null
+++ b/EndlessVendetta/EndlessVendetta.sln.DotSettings.user
@@ -0,0 +1,5 @@
+
+ C:\Users\Rafal\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_EndlessVendetta.-1253833435\Snapshot\snapshot.utdcvr
+ <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <Solution />
+</SessionState>
\ No newline at end of file
diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp
index 50f255d5..9b39327f 100644
--- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp
+++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp
@@ -14,6 +14,7 @@
#include "GameFramework/MovementComponent.h"
#include "Inventory/InventoryComponent.h"
#include "EndlessVendettaGameMode.h"
+#include "EVGameInstance.h"
#include "DialogueSystem/AC_Dialogue.h"
@@ -51,6 +52,10 @@ void AEndlessVendettaCharacter::BeginPlay()
// Call the base class
Super::BeginPlay();
+ UEVGameInstance* GI = Cast(GetWorld()->GetGameInstance());
+ PrimaryWeaponClass = GI->MainSaveGameInstanceRef->PrimaryWeaponClassSave;
+ SecondaryWeaponClass = GI->MainSaveGameInstanceRef->SecondaryWeaponClassSave;
+
// Set the fp skeletal mesh for the vault it plugin to use
TArray MeshActComps = GetComponentsByClass(USkeletalMeshComponent::StaticClass());
for (auto MeshActorComponent : MeshActComps)
@@ -372,24 +377,42 @@ void AEndlessVendettaCharacter::EquipPrimary()
if (GadgetManager->IsValidReconGadget() && GadgetManager->IsReconEquipped() && !GadgetManager->TryToUnequipRecon()) return;
if (GadgetManager->IsValidCombatGadget() && GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return;
- bHasRifle = true;
- // if(!bIsPrimaryWeaponCreated)
- // {
- // //Creating a new actor object called PrimaryWeapon that is based off primaryweaponClass
- // //Changing PrimaryWeaponActor to ABaseWeaponClass type instead of actor and storing it into PrimaryWeapon which is a ABaseClass Object
- // //We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor
- // PrimaryWeaponActor = GetWorld()->SpawnActor(PrimaryWeaponClass, spawnParams);
- // PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
- // PrimaryWeapon = Cast(PrimaryWeaponActor);
- // PrimaryWeapon->SetActorHiddenInGame(false);
- // bIsPrimaryWeaponCreated = true;
- // }
+
+ if (!IsValid(PrimaryWeapon))
+ {
+ bHasRifle = true;
+ if (!bIsPrimaryWeaponCreated)
+ {
+ PrimaryWeaponActor = GetWorld()->SpawnActor(PrimaryWeaponClass, spawnParams);
+ PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
+ PrimaryWeapon = Cast(PrimaryWeaponActor);
+ PrimaryWeapon->SetActorHiddenInGame(false);
+ bIsPrimaryWeaponCreated = true;
+ }
+ //UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden());
+ GLog->Log("Primary Weapon Equipped");
+ }
+
if (!IsValid(PrimaryWeaponActor)) return;
Cast(GetWorld()->GetAuthGameMode())->SendEvent("Equip", "Pri");
PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
PrimaryWeapon = Cast(PrimaryWeaponActor);
PrimaryWeapon->SetActorHiddenInGame(false);
GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
+
+ // bHasRifle = true;
+ // // if(!bIsPrimaryWeaponCreated)
+ // // {
+ // // //Creating a new actor object called PrimaryWeapon that is based off primaryweaponClass
+ // // //Changing PrimaryWeaponActor to ABaseWeaponClass type instead of actor and storing it into PrimaryWeapon which is a ABaseClass Object
+ // // //We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor
+ // // PrimaryWeaponActor = GetWorld()->SpawnActor(PrimaryWeaponClass, spawnParams);
+ // // PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
+ // // PrimaryWeapon = Cast(PrimaryWeaponActor);
+ // // PrimaryWeapon->SetActorHiddenInGame(false);
+ // // bIsPrimaryWeaponCreated = true;
+ // // }
+
}
void AEndlessVendettaCharacter::EquipSecondary()
@@ -456,6 +479,11 @@ void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
}
bIsWeaponPickedUp = true;
PrimaryWeaponClass = Outhit->GetClass();
+
+ UEVGameInstance* GI = Cast(GetGameInstance());
+ GI->MainSaveGameInstanceRef->PrimaryWeaponClassSave = Outhit->GetClass();
+ UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
+
Outhit->Destroy();
EquipPrimary();
}
@@ -467,6 +495,11 @@ void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
}
bIsWeaponPickedUp = true;
SecondaryWeaponClass = Outhit->GetClass();
+
+ UEVGameInstance* GI = Cast(GetGameInstance());
+ GI->MainSaveGameInstanceRef->SecondaryWeaponClassSave = Outhit->GetClass();
+ UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
+
Outhit->Destroy();
EquipSecondary();
}
diff --git a/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h b/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h
index 16a1a718..3d7937da 100644
--- a/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h
+++ b/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h
@@ -4,6 +4,7 @@
#include "CoreMinimal.h"
#include "GameFramework/SaveGame.h"
+#include "WeaponSystem/BaseWeaponClass.h"
#include "MainSaveGameClass.generated.h"
/**
@@ -20,5 +21,11 @@ public:
UPROPERTY()
int LastMainBountyIndexInOpenWorld;
+
+ UPROPERTY()
+ TSubclassOf PrimaryWeaponClassSave;
+
+ UPROPERTY()
+ TSubclassOf SecondaryWeaponClassSave;
};