diff --git a/Content/Levels/Top_layer_level.umap b/Content/Levels/Top_layer_level.umap index ad576cc..a338efc 100644 --- a/Content/Levels/Top_layer_level.umap +++ b/Content/Levels/Top_layer_level.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b9913f8136b9bf2c1f42801089b7071ad667f9467ee25d72ab588ae96d7543f2 -size 247266 +oid sha256:b12ca45d23f48747799c368c38e00f316adb025ea913272a4a36b69ec4b30fa3 +size 247139 diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index 553ac9c..42a36fe 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -8,6 +8,7 @@ #include "Components/CapsuleComponent.h" #include "GameFramework/CharacterMovementComponent.h" #include "the_twilight_abyss/MerchantInteraction/Interaction.h" +#include // CONSTRUCTOR @@ -20,6 +21,7 @@ ATempCharacter::ATempCharacter() GoldBalance = GoldBalance; Health = Health; this->GetCharacterMovement()->GetNavAgentPropertiesRef().bCanCrouch = true; + } // Called when the game starts or when spawned @@ -29,6 +31,10 @@ void ATempCharacter::BeginPlay() Health = 100; ThisCamera = Cast(this->FindComponentByClass()); PlayerCapsule = GetCapsuleComponent(); + TArray AllActorsInScene; + + UGameplayStatics::GetAllActorsOfClass(GetWorld(), APostProcessVolume::StaticClass(), AllActorsInScene); + PostProcessVolume = Cast(AllActorsInScene[0]); } //Binds the input we made in the setup player component to the forward vector @@ -48,10 +54,12 @@ void ATempCharacter::Sneak() if (bIsCrouched) { UnCrouch(); + PostProcessVolume->Settings.VignetteIntensity = 0.0f; } else { Crouch(); + PostProcessVolume->Settings.VignetteIntensity = 0.8f; } } @@ -183,7 +191,6 @@ void ATempCharacter::InputDisabler() OriginalCameraLocation = ThisCamera->GetComponentLocation(); OriginalCameraRotation = ThisCamera->GetComponentRotation(); OriginalCameraFOV = ThisCamera->FieldOfView; - //ulog the originalcameralocation value UE_LOG(LogTemp, Display, TEXT("Original Camera Location: %s"), *OriginalCameraLocation.ToString()); } } @@ -212,7 +219,6 @@ void ATempCharacter::InputEnabler() ThisCamera->SetWorldLocation(OriginalCameraLocation); ThisCamera->SetWorldRotation(OriginalCameraRotation); ThisCamera->FieldOfView = OriginalCameraFOV; - //ulog the originalcameralocation value UE_LOG(LogTemp, Display, TEXT("Original Camera Location: %s"), *OriginalCameraLocation.ToString()); } } @@ -222,7 +228,7 @@ void ATempCharacter::UseItem(class UBaseItem* Item) if(Item) { Item->Use(this); - Item->OnUse(this); //Blueprint Version + Item->OnUse(this); //OnUse is a Blueprint Version } } diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index c1f22e9..f162b7f 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -7,6 +7,7 @@ #include "the_twilight_abyss/BaseItems/Items/BaseItem.h" #include "Camera/CameraComponent.h" #include "Kismet/KismetMathLibrary.h" +#include "Engine/PostProcessVolume.h" #include "TempCharacter.generated.h" UCLASS() @@ -87,5 +88,5 @@ public: UPROPERTY(BlueprintReadWrite) bool disableTab = false; - + APostProcessVolume* PostProcessVolume; };