diff --git a/Project Reboot 3.0/FortItemDefinition.h b/Project Reboot 3.0/FortItemDefinition.h index c450356..854eec5 100644 --- a/Project Reboot 3.0/FortItemDefinition.h +++ b/Project Reboot 3.0/FortItemDefinition.h @@ -4,6 +4,10 @@ #include "Object.h" #include "Class.h" +#include "SoftObjectPath.h" +#include "SoftObjectPtr.h" +#include "Texture2D.h" + #include "reboot.h" class UFortItemDefinition : public UObject @@ -19,6 +23,18 @@ public: return ReadBitfieldValue(bAllowMultipleStacksOffset, bAllowMultipleStacksFieldMask); } + FSoftObjectPath& GetDisplayAssetPath() + { + static auto DisplayAssetPathOffset = GetOffset("DisplayAssetPath"); + return Get(DisplayAssetPathOffset); + } + + TSoftObjectPtr& GetLargePreviewImage() + { + static auto LargePreviewImageOffset = GetOffset("LargePreviewImage"); + return Get>(LargePreviewImageOffset); + } + static UClass* StaticClass() { static auto Class = FindObject(L"/Script/FortniteGame.FortItemDefinition"); diff --git a/Project Reboot 3.0/KismetMathLibrary.cpp b/Project Reboot 3.0/KismetMathLibrary.cpp index 029c977..2409c9b 100644 --- a/Project Reboot 3.0/KismetMathLibrary.cpp +++ b/Project Reboot 3.0/KismetMathLibrary.cpp @@ -4,7 +4,7 @@ float UKismetMathLibrary::RandomFloatInRange(float min, float max) { - static auto fn = FindObject("/Script/Engine.KismetMathLibrary.RandomFloatInRange"); + static auto fn = FindObject(L"/Script/Engine.KismetMathLibrary.RandomFloatInRange"); struct { float min; float max; float ret; } params{min, max}; @@ -16,6 +16,6 @@ float UKismetMathLibrary::RandomFloatInRange(float min, float max) UClass* UKismetMathLibrary::StaticClass() { - static auto Class = FindObject("/Script/Engine.KismetMathLibrary"); + static auto Class = FindObject(L"/Script/Engine.KismetMathLibrary"); return Class; } \ No newline at end of file diff --git a/Project Reboot 3.0/KismetRenderingLibrary.cpp b/Project Reboot 3.0/KismetRenderingLibrary.cpp new file mode 100644 index 0000000..c1b8d7a --- /dev/null +++ b/Project Reboot 3.0/KismetRenderingLibrary.cpp @@ -0,0 +1,19 @@ +#include "KismetRenderingLibrary.h" + +#include "reboot.h" + +void UKismetRenderingLibrary::ExportTexture2D(UObject* WorldContextObject, class UTexture2D* Texture, const FString& FilePath, const FString& Filename) +{ + static auto fn = FindObject(L"/Script/Engine.KismetRenderingLibrary.ExportTexture2D"); + + struct { UObject* WorldContextObject; class UTexture2D* Texture; FString FilePath; FString Filename; } params{ WorldContextObject, Texture, FilePath, Filename }; + + static auto DefaultObject = StaticClass(); + DefaultObject->ProcessEvent(fn, ¶ms); +} + +UClass* UKismetRenderingLibrary::StaticClass() +{ + static auto Class = FindObject(L"/Script/Engine.KismetRenderingLibrary"); + return Class; +} \ No newline at end of file diff --git a/Project Reboot 3.0/KismetRenderingLibrary.h b/Project Reboot 3.0/KismetRenderingLibrary.h new file mode 100644 index 0000000..26a3431 --- /dev/null +++ b/Project Reboot 3.0/KismetRenderingLibrary.h @@ -0,0 +1,12 @@ +#pragma once + +#include "Object.h" +#include "UnrealString.h" + +class UKismetRenderingLibrary : public UObject // UBlueprintFunctionLibrary +{ +public: + static void ExportTexture2D(UObject* WorldContextObject, class UTexture2D* Texture, const FString& FilePath, const FString& Filename); + + static UClass* StaticClass(); +}; \ No newline at end of file diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj b/Project Reboot 3.0/Project Reboot 3.0.vcxproj index 18ab0c9..d346fac 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj @@ -248,6 +248,7 @@ + @@ -265,6 +266,7 @@ + @@ -431,6 +433,7 @@ + @@ -481,6 +484,7 @@ + diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters index 2d77495..09b8e42 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -305,6 +305,12 @@ FortniteGame\Source\FortniteGame\Private\AI + + Engine\Source\Runtime\Engine\Private + + + Engine\Source\Runtime\Engine\Private + @@ -990,6 +996,12 @@ FortniteGame\Plugins\GameFeatures\LTM\HighTower_Cobalt\Source\HighTowerCobaltRuntime\Public + + Engine\Source\Runtime\Engine\Classes\Engine + + + Engine\Source\Runtime\Engine\Classes\Kismet + diff --git a/Project Reboot 3.0/Texture2D.cpp b/Project Reboot 3.0/Texture2D.cpp new file mode 100644 index 0000000..688b811 --- /dev/null +++ b/Project Reboot 3.0/Texture2D.cpp @@ -0,0 +1,9 @@ +#include "Texture2D.h" + +#include "reboot.h" + +UClass* UTexture2D::StaticClass() +{ + static auto Class = FindObject(L"/Script/Engine.Texture2D"); + return Class; +} \ No newline at end of file diff --git a/Project Reboot 3.0/Texture2D.h b/Project Reboot 3.0/Texture2D.h new file mode 100644 index 0000000..f6c58e0 --- /dev/null +++ b/Project Reboot 3.0/Texture2D.h @@ -0,0 +1,9 @@ +#pragma once + +#include "Object.h" + +class UTexture2D : public UObject // UTexture +{ +public: + static UClass* StaticClass(); +}; \ No newline at end of file diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 60d0074..2775279 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -6,7 +6,7 @@ #include #include -#include +// #include #include #include @@ -45,6 +45,7 @@ #include "vendingmachine.h" #include "die.h" #include "calendar.h" +#include "KismetRenderingLibrary.h" #define GAME_TAB 1 #define PLAYERS_TAB 2 @@ -1493,7 +1494,7 @@ static inline DWORD WINAPI GuiThread(LPVOID) // Initialize Direct3D if (!CreateDeviceD3D(hwnd)) { - MessageBoxA(0, "Failed to create D3D Device!", "Reboot 3.0", MB_ICONERROR); + // MessageBoxA(0, "Failed to create D3D Device!", "Reboot 3.0", MB_ICONERROR); // Error Boxes are within the helper function. LOG_ERROR(LogDev, "Failed to create D3D Device!"); CleanupDeviceD3D(); ::UnregisterClass(wc.lpszClassName, wc.hInstance); @@ -1612,8 +1613,12 @@ static inline DWORD WINAPI GuiThread(LPVOID) static inline bool CreateDeviceD3D(HWND hWnd) { - if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) + g_pD3D = Direct3DCreate9(D3D_SDK_VERSION); + if (g_pD3D == NULL) + { + MessageBoxA(0, "Failed call to Direct3DCreate9!", "Reboot 3.0", MB_ICONERROR); return false; + } // Create the D3DDevice ZeroMemory(&g_d3dpp, sizeof(g_d3dpp)); @@ -1624,8 +1629,14 @@ static inline bool CreateDeviceD3D(HWND hWnd) g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; // Present with vsync //g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Present without vsync, maximum unthrottled framerate - if (g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice) < 0) + + auto CreateDeviceResult = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice); + + if (CreateDeviceResult < D3D_OK) + { + MessageBoxA(0, ("Failed call to CreateDevice " + std::to_string(CreateDeviceResult) + "!").c_str(), "Reboot 3.0", MB_ICONERROR); return false; + } return true; } diff --git a/Project Reboot 3.0/log.h b/Project Reboot 3.0/log.h index 03a6711..76a3b93 100644 --- a/Project Reboot 3.0/log.h +++ b/Project Reboot 3.0/log.h @@ -113,6 +113,7 @@ inline void InitLogger() if (spdlog::get(#loggerName)) \ spdlog::get(#loggerName)->critical(std::format(__VA_ARGS__)); #else +#pragma warning( disable : 4390 ) // cuz then it will produce if (blahblah) ; #define LOG_DEBUG(loggerName, ...) #define LOG_INFO(loggerName, ...) #define LOG_WARN(loggerName, ...)