README update

Add Unreal Engine SDK example.
This commit is contained in:
2025-09-09 08:14:53 +00:00
parent 71ecb7c1c4
commit 7c0344e1b1

View File

@@ -39,6 +39,44 @@ Check the boxes, adjust sliders and see the effects in real time in game.
## Interesting projects
Uncharted LOTC for its cinematics fix.
Wuchang Fallen Feathers for its approach on fixes detours (using VEH debugging).
Cronos: The New Dawn for its implement of Unreal Engine SDK (see code below).
```
// Devs console re-creation
auto start = std::chrono::high_resolution_clock::now(); // Measure the time to renable console
UEngine* Engine = nullptr;
for (int i = 0; i < 100; ++i) { // gives 10 seconds to find UE Engine
std::this_thread::sleep_for(std::chrono::milliseconds(100));
Engine = UEngine::GetEngine();
if (Engine && Engine->ConsoleClass && Engine->GameViewport)
break;
}
if (!Engine || !Engine->ConsoleClass || !Engine->GameViewport) {
logger->error("Console could not be found in engine.");
return;
}
logger->info("Console found in engine");
/* Creates a new UObject of class-type specified by Engine->ConsoleClass */
UObject* NewObject = UGameplayStatics::SpawnObject(Engine->ConsoleClass, Engine->GameViewport);
if (NewObject)
{
logger->info("Successfully spawned console object");
// Set the console viewport so that it will be displayed
Engine->GameViewport->ViewportConsole = static_cast<UConsole*>(NewObject);
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = end - start;
logger->info("Console fully reactivated in {:.3f}s and bound to key Tilde", elapsed.count());
logger->info("------------------ User inputs ------------------");
g_Console_Enabled = true;
}
else {
logger->error("Could not spawn console object");
}
```
## Credits
This project use the following other projects.