93 lines
2.5 KiB
C++
93 lines
2.5 KiB
C++
#pragma once
|
|
#include <spdlog/spdlog.h>
|
|
#include <GameFixes.h>
|
|
#include <atomic>
|
|
|
|
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;
|
|
class UObject;
|
|
class UWorld;
|
|
class UWidget;
|
|
class AActor;
|
|
class APawn;
|
|
class UGameplayStatics;
|
|
class UConsole;
|
|
class UInputSettings;
|
|
class UKismetStringLibrary;
|
|
class UKismetSystemLibrary;
|
|
class UGameInstance;
|
|
class ULocalPlayer;
|
|
class APlayerController;
|
|
}
|
|
|
|
namespace UC {
|
|
class FString;
|
|
}
|
|
|
|
// Templates
|
|
template<typename T>
|
|
inline bool IsValidUObj(T* obj) {
|
|
return obj && SDK::UKismetSystemLibrary::IsValid(obj);
|
|
}
|
|
|
|
/**
|
|
* @brief Prepare all visual effects to be toggled by pending them.
|
|
*/
|
|
void SetAllEffectsToBeToggled();
|
|
|
|
/**
|
|
* @brief Apply visual effect.
|
|
* @param fix - The visual effect to be applied.
|
|
* @param enabled - The effect enabled or not.
|
|
*/
|
|
void ApplyVisualEffect(GameFixes fix, bool enabled);
|
|
|
|
/**
|
|
* @brief Retrieve the cvar FString command to be applied.
|
|
* @param fix - The visual effect to be applied.
|
|
* @param enabled - The effect enabled or not.
|
|
* @return The FString command to be applied or empty FString if not found.
|
|
*/
|
|
UC::FString GetCommand(GameFixes fix, bool enabled);
|
|
|
|
/**
|
|
* @brief Gets the current game resolution (not native display) and aspect ratio.
|
|
* @param outWidth screen width.
|
|
* @param outHeight screen height.
|
|
* @param outAspectRatio aspect ratio computed.
|
|
*/
|
|
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.
|
|
* @return Player Pawn or nullptr.
|
|
*/
|
|
SDK::APawn* GetPawnFromWorld(SDK::UWorld* world = nullptr);
|
|
|
|
/**
|
|
* @brief Gets the current player Pawn from an actor object.
|
|
* @param object pointer (must be an UObject at least).
|
|
* @return Player Pawn or nullptr.
|
|
*/
|
|
SDK::APawn* GetPawnFromObject(SDK::UObject* object);
|
|
|
|
/**
|
|
* @brief Reactivate the development console.
|
|
* @param logger spdlog.
|
|
*/
|
|
void ReactivateDevConsole(std::shared_ptr<spdlog::logger> logger); |