From c194cfa1ea6d4fa92e024c583397d7b0acf591d4 Mon Sep 17 00:00:00 2001 From: Manuel Wagner Date: Tue, 13 Sep 2022 09:07:12 +0200 Subject: [PATCH] added screenshots cheat --- Source/LyraGame/Player/LyraCheatManager.cpp | 14 ++++++++++++++ Source/LyraGame/Player/LyraCheatManager.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/Source/LyraGame/Player/LyraCheatManager.cpp b/Source/LyraGame/Player/LyraCheatManager.cpp index 36dac6e9..0ba3837d 100644 --- a/Source/LyraGame/Player/LyraCheatManager.cpp +++ b/Source/LyraGame/Player/LyraCheatManager.cpp @@ -13,6 +13,7 @@ #include "AbilitySystem/LyraAbilitySystemComponent.h" #include "AbilitySystemGlobals.h" #include "GameplayEffect.h" +#include "HighResScreenshot.h" #include "Character/LyraHealthComponent.h" #include "Character/LyraPawnExtensionComponent.h" #include "System/LyraSystemStatics.h" @@ -421,3 +422,16 @@ void ULyraCheatManager::UnlimitedHealth(int32 Enabled) } } } +void ULyraCheatManager::Singinwhale_StartScreenshotInterval(float IntervalSeconds) +{ + FTimerHandle _Handle = FTimerHandle(); + GetWorld()->GetTimerManager().SetTimer(_Handle, FTimerDelegate::CreateWeakLambda(this, [this]() + { + FHighResScreenshotConfig& HighResScreenshotConfig = GetHighResScreenshotConfig(); + HighResScreenshotConfig.bDumpBufferVisualizationTargets = true; + HighResScreenshotConfig.bDateTimeBasedNaming = true; + HighResScreenshotConfig.SetResolution(1920,1080); + HighResScreenshotConfig.SetHDRCapture(true); + FScreenshotRequest::RequestScreenshot(true); + }), IntervalSeconds, true, 0); +} \ No newline at end of file diff --git a/Source/LyraGame/Player/LyraCheatManager.h b/Source/LyraGame/Player/LyraCheatManager.h index f193078e..c00229ec 100644 --- a/Source/LyraGame/Player/LyraCheatManager.h +++ b/Source/LyraGame/Player/LyraCheatManager.h @@ -95,6 +95,9 @@ public: UFUNCTION(Exec, BlueprintAuthorityOnly) virtual void UnlimitedHealth(int32 Enabled = -1); + UFUNCTION(Exec) + void Singinwhale_StartScreenshotInterval(float IntervalSeconds); + protected: virtual void EnableDebugCamera() override;