Merge remote-tracking branch 'origin/grip-attachment' into Main-Bounty-Update
# Conflicts: # EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset
This commit is contained in:
commit
d5f78c190d
BIN
EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FPWeapon/Mesh/SK_FPGun_Skeleton.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_ARTEST1.uasset
(Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/Pistol_Skeleton.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset
(Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
EndlessVendetta/Content/Levels/DoorTestLevel.umap
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Levels/DoorTestLevel.umap
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Shapes/TempExtendedMag.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/StarterContent/Shapes/TempExtendedMag.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/StarterContent/Shapes/TempGrip.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset
(Stored with Git LFS)
Normal file
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/2/K1/58MA6LCG9V3BWWEPHFBLQO.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/V5/00HOTT7GJB6N5M6TZHPJO5.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset
(Stored with Git LFS)
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\Rafal\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_EndlessVendetta.-1253833435\Snapshot\snapshot.utdcvr</s:String></wpf:ResourceDictionary>
|
@ -13,6 +13,8 @@
|
||||
#include <EndlessVendetta/EndlessVendettaGameMode.h>
|
||||
|
||||
#include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h"
|
||||
#include "EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h"
|
||||
#include "EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h"
|
||||
#include "EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h"
|
||||
|
||||
|
||||
@ -278,6 +280,7 @@ void ABaseWeaponClass::InteractPrompt()
|
||||
WeaponStatsPopUp();
|
||||
}
|
||||
|
||||
//Called in weaponworkbench WBP
|
||||
void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP SILENCER ATTACHMENTS"));
|
||||
@ -290,11 +293,13 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
|
||||
{
|
||||
if (IsValid(WeaponSkeletonMesh))
|
||||
{
|
||||
//this handles giving the weapon the required component class/code
|
||||
SilencerAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("SilencerMeshSocket")));
|
||||
UE_LOG(LogTemp, Display, TEXT("All Attachment is valid"));
|
||||
//this makes it showup in editor for better debugging
|
||||
SilencerAttachmentClass->CreationMethod = EComponentCreationMethod::Instance;
|
||||
SilencerAttachmentClass->RegisterComponent();
|
||||
//below handles seeing the physical attachment you selected
|
||||
UStaticMeshComponent* StaticMeshComp = NewObject<UStaticMeshComponent>(SilencerAttachmentClass, UStaticMeshComponent::StaticClass());
|
||||
if (IsValid(StaticMeshComp))
|
||||
{
|
||||
@ -309,3 +314,78 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Called in weaponworkbench WBP
|
||||
void ABaseWeaponClass::SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP EXTENDEDMAG ATTACHMENTS"));
|
||||
FTransform EmptyTransform;
|
||||
|
||||
USceneComponent* ExtendedMagAttachmentClass = Cast<USceneComponent>(AddComponentByClass(UExtendedMagAttachmentClass::StaticClass(), false, EmptyTransform, false));
|
||||
ExtendedMagAttachmentClass->ComponentTags.Add(FName("AttachmentType"));
|
||||
USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass<USkeletalMeshComponent>();
|
||||
if (IsValid(ExtendedMagAttachmentClass))
|
||||
{
|
||||
if (IsValid(WeaponSkeletonMesh))
|
||||
{
|
||||
//this handles giving the weapon the required component class/code
|
||||
ExtendedMagAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("ExtendedMagSocket")));
|
||||
UE_LOG(LogTemp, Display, TEXT("All Attachment is valid"));
|
||||
//this makes it showup in editor for better debugging
|
||||
ExtendedMagAttachmentClass->CreationMethod = EComponentCreationMethod::Instance;
|
||||
ExtendedMagAttachmentClass->RegisterComponent();
|
||||
//below handles seeing the physical attachment you selected
|
||||
UStaticMeshComponent* StaticMeshComp = NewObject<UStaticMeshComponent>(ExtendedMagAttachmentClass, UStaticMeshComponent::StaticClass());
|
||||
if (IsValid(StaticMeshComp))
|
||||
{
|
||||
StaticMeshComp->AttachToComponent(ExtendedMagAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale);
|
||||
StaticMeshComp->SetStaticMesh(ExtendedMagMesh);
|
||||
StaticMeshComp->SetRelativeRotation(FRotator(0, 180, 0));
|
||||
StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
//Making it show in editor for debugging
|
||||
StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance;
|
||||
StaticMeshComp->RegisterComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Called in weaponworkbench WBP
|
||||
void ABaseWeaponClass::SetupGripAttachment(UStaticMesh* GripMesh)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("SETTING UP GRIP ATTACHMENTS"));
|
||||
FTransform EmptyTransform;
|
||||
|
||||
USceneComponent* GripAttachmentClass = Cast<USceneComponent>(AddComponentByClass(UGripAttachmentClass::StaticClass(), false, EmptyTransform, false));
|
||||
GripAttachmentClass->ComponentTags.Add(FName("AttachmentType"));
|
||||
USkeletalMeshComponent* WeaponSkeletonMesh = FindComponentByClass<USkeletalMeshComponent>();
|
||||
if (IsValid(GripAttachmentClass))
|
||||
{
|
||||
if (IsValid(WeaponSkeletonMesh))
|
||||
{
|
||||
//this handles giving the weapon the required component class/code
|
||||
GripAttachmentClass->AttachToComponent(WeaponSkeletonMesh, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("GripMeshSocket")));
|
||||
UE_LOG(LogTemp, Display, TEXT("All Attachment is valid"));
|
||||
//this makes it showup in editor for better debugging
|
||||
GripAttachmentClass->CreationMethod = EComponentCreationMethod::Instance;
|
||||
GripAttachmentClass->RegisterComponent();
|
||||
//below handles seeing the physical attachment you selected
|
||||
UStaticMeshComponent* StaticMeshComp = NewObject<UStaticMeshComponent>(GripAttachmentClass, UStaticMeshComponent::StaticClass());
|
||||
if (IsValid(StaticMeshComp))
|
||||
{
|
||||
StaticMeshComp->AttachToComponent(GripAttachmentClass, FAttachmentTransformRules::SnapToTargetIncludingScale);
|
||||
StaticMeshComp->SetStaticMesh(GripMesh);
|
||||
StaticMeshComp->SetRelativeRotation(FRotator(0, 0, 0));
|
||||
StaticMeshComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
//Making it show in editor for debugging
|
||||
StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance;
|
||||
StaticMeshComp->RegisterComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ABaseWeaponClass::RemoveAllAttachments()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -172,9 +172,20 @@ public:
|
||||
|
||||
//void GetOutHit(FHitResult OutHit);
|
||||
|
||||
//ATTACHMENTS
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetupSilencerAttachment(UStaticMesh* SilencerMesh);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetupExtendedMagAttachment(UStaticMesh* ExtendedMagMesh);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetupGripAttachment(UStaticMesh* GripMesh);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void RemoveAllAttachments();
|
||||
|
||||
//
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void ShowReloadingWidget();
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "ExtendedMagAttachmentClass.h"
|
||||
|
||||
#include "EndlessVendetta/WeaponSystem/BaseWeaponClass.h"
|
||||
|
||||
|
||||
// Sets default values for this component's properties
|
||||
UExtendedMagAttachmentClass::UExtendedMagAttachmentClass()
|
||||
{
|
||||
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
|
||||
// off to improve performance if you don't need them.
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
// Called when the game starts
|
||||
void UExtendedMagAttachmentClass::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
BaseWeaponClass = Cast<ABaseWeaponClass>(this->GetAttachParentActor());
|
||||
if (BaseWeaponClass)
|
||||
{
|
||||
IncreaseAmmoCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Called every frame
|
||||
void UExtendedMagAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
}
|
||||
|
||||
void UExtendedMagAttachmentClass::IncreaseAmmoCount()
|
||||
{
|
||||
if (!IsValid(BaseWeaponClass)) return;
|
||||
UE_LOG(LogTemp, Warning, TEXT("AmmoCountIncrease activated"));
|
||||
BaseWeaponClass->MagazineSize *= 2;
|
||||
BaseWeaponClass->currentAmmoCount = BaseWeaponClass->MagazineSize;
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/SceneComponent.h"
|
||||
#include "ExtendedMagAttachmentClass.generated.h"
|
||||
|
||||
|
||||
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
|
||||
class ENDLESSVENDETTA_API UExtendedMagAttachmentClass : public USceneComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this component's properties
|
||||
UExtendedMagAttachmentClass();
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
class ABaseWeaponClass* BaseWeaponClass;
|
||||
|
||||
void IncreaseAmmoCount();
|
||||
};
|
@ -0,0 +1,33 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "GripAttachmentClass.h"
|
||||
|
||||
|
||||
// Sets default values for this component's properties
|
||||
UGripAttachmentClass::UGripAttachmentClass()
|
||||
{
|
||||
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
|
||||
// off to improve performance if you don't need them.
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
// Called when the game starts
|
||||
void UGripAttachmentClass::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
// ...
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Called every frame
|
||||
void UGripAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/SceneComponent.h"
|
||||
#include "GripAttachmentClass.generated.h"
|
||||
|
||||
|
||||
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
|
||||
class ENDLESSVENDETTA_API UGripAttachmentClass : public USceneComponent
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this component's properties
|
||||
UGripAttachmentClass();
|
||||
|
||||
protected:
|
||||
// Called when the game starts
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user