Add a function to apply cvars visual effects. Add a fallback function to retrieve GWorld.
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
#pragma once
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <GameFixes.h>
|
||||
#include <atomic>
|
||||
|
||||
inline std::atomic_bool g_Console_Enabled { false };
|
||||
inline std::atomic<bool> g_Console_Enabled = false;
|
||||
inline std::atomic<bool> gPendingFog = false; // Used to toggle Fog effect once
|
||||
inline std::atomic<bool> gPendingDOF = false; // Used to toggle DOF effect once
|
||||
inline std::atomic<bool> gPendingCA = false; // Used to toggle chromatic aberrations effect once
|
||||
inline std::atomic<bool> gPendingVignetting = false; // Used to toggle chromatic aberrations effect once
|
||||
|
||||
namespace SDK {
|
||||
class UEngine;
|
||||
@@ -20,6 +25,14 @@ namespace SDK {
|
||||
class APlayerController;
|
||||
}
|
||||
|
||||
namespace UC {
|
||||
class FString;
|
||||
}
|
||||
|
||||
void ApplyVisualEffect(GameFixes fix, bool enabled);
|
||||
|
||||
UC::FString GetCommand(GameFixes fix, bool enabled);
|
||||
|
||||
/**
|
||||
* @brief Gets the current game resolution (not native display) and aspect ratio.
|
||||
* @param outWidth screen width.
|
||||
@@ -29,6 +42,13 @@ namespace SDK {
|
||||
void GetResolution(int& outWidth, int& outHeight, float& outAspectRatio);
|
||||
|
||||
// Unreal Engine functions
|
||||
/**
|
||||
* @brief Gets the current World from an UObject.
|
||||
* @param ptr pointer to an object (eg: AActor).
|
||||
* @return UWorld* or nullptr.
|
||||
*/
|
||||
SDK::UWorld* GetWorldFromContext(uintptr_t ptr);
|
||||
|
||||
/**
|
||||
* @brief Gets the current player Pawn from the world.
|
||||
* @param world Optional UWorld pointer.
|
||||
|
||||
Reference in New Issue
Block a user