apparently gui is fixed?

This commit is contained in:
Gray
2024-09-14 10:07:50 -04:00
parent c106b35d18
commit 9dbd6ae2f0
10 changed files with 99 additions and 6 deletions

View File

@@ -4,6 +4,10 @@
#include "Object.h" #include "Object.h"
#include "Class.h" #include "Class.h"
#include "SoftObjectPath.h"
#include "SoftObjectPtr.h"
#include "Texture2D.h"
#include "reboot.h" #include "reboot.h"
class UFortItemDefinition : public UObject class UFortItemDefinition : public UObject
@@ -19,6 +23,18 @@ public:
return ReadBitfieldValue(bAllowMultipleStacksOffset, bAllowMultipleStacksFieldMask); return ReadBitfieldValue(bAllowMultipleStacksOffset, bAllowMultipleStacksFieldMask);
} }
FSoftObjectPath& GetDisplayAssetPath()
{
static auto DisplayAssetPathOffset = GetOffset("DisplayAssetPath");
return Get<FSoftObjectPath>(DisplayAssetPathOffset);
}
TSoftObjectPtr<UTexture2D>& GetLargePreviewImage()
{
static auto LargePreviewImageOffset = GetOffset("LargePreviewImage");
return Get<TSoftObjectPtr<UTexture2D>>(LargePreviewImageOffset);
}
static UClass* StaticClass() static UClass* StaticClass()
{ {
static auto Class = FindObject<UClass>(L"/Script/FortniteGame.FortItemDefinition"); static auto Class = FindObject<UClass>(L"/Script/FortniteGame.FortItemDefinition");

View File

@@ -4,7 +4,7 @@
float UKismetMathLibrary::RandomFloatInRange(float min, float max) float UKismetMathLibrary::RandomFloatInRange(float min, float max)
{ {
static auto fn = FindObject<UFunction>("/Script/Engine.KismetMathLibrary.RandomFloatInRange"); static auto fn = FindObject<UFunction>(L"/Script/Engine.KismetMathLibrary.RandomFloatInRange");
struct { float min; float max; float ret; } params{min, max}; struct { float min; float max; float ret; } params{min, max};
@@ -16,6 +16,6 @@ float UKismetMathLibrary::RandomFloatInRange(float min, float max)
UClass* UKismetMathLibrary::StaticClass() UClass* UKismetMathLibrary::StaticClass()
{ {
static auto Class = FindObject<UClass>("/Script/Engine.KismetMathLibrary"); static auto Class = FindObject<UClass>(L"/Script/Engine.KismetMathLibrary");
return Class; return Class;
} }

View File

@@ -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<UFunction>(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, &params);
}
UClass* UKismetRenderingLibrary::StaticClass()
{
static auto Class = FindObject<UClass>(L"/Script/Engine.KismetRenderingLibrary");
return Class;
}

View File

@@ -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();
};

View File

@@ -248,6 +248,7 @@
<ClCompile Include="inc.cpp" /> <ClCompile Include="inc.cpp" />
<ClCompile Include="InventoryManagementLibrary.cpp" /> <ClCompile Include="InventoryManagementLibrary.cpp" />
<ClCompile Include="KismetMathLibrary.cpp" /> <ClCompile Include="KismetMathLibrary.cpp" />
<ClCompile Include="KismetRenderingLibrary.cpp" />
<ClCompile Include="KismetStringLibrary.cpp" /> <ClCompile Include="KismetStringLibrary.cpp" />
<ClCompile Include="KismetSystemLibrary.cpp" /> <ClCompile Include="KismetSystemLibrary.cpp" />
<ClCompile Include="KismetTextLibrary.cpp" /> <ClCompile Include="KismetTextLibrary.cpp" />
@@ -265,6 +266,7 @@
<ClCompile Include="reboot.cpp" /> <ClCompile Include="reboot.cpp" />
<ClCompile Include="SavePackage.cpp" /> <ClCompile Include="SavePackage.cpp" />
<ClCompile Include="ScriptDisassembler.cpp" /> <ClCompile Include="ScriptDisassembler.cpp" />
<ClCompile Include="Texture2D.cpp" />
<ClCompile Include="UnrealMath.cpp" /> <ClCompile Include="UnrealMath.cpp" />
<ClCompile Include="UnrealNames.cpp" /> <ClCompile Include="UnrealNames.cpp" />
<ClCompile Include="UObjectGlobals.cpp" /> <ClCompile Include="UObjectGlobals.cpp" />
@@ -431,6 +433,7 @@
<ClInclude Include="IsPointer.h" /> <ClInclude Include="IsPointer.h" />
<ClInclude Include="IsTriviallyCopyConstructible.h" /> <ClInclude Include="IsTriviallyCopyConstructible.h" />
<ClInclude Include="KismetMathLibrary.h" /> <ClInclude Include="KismetMathLibrary.h" />
<ClInclude Include="KismetRenderingLibrary.h" />
<ClInclude Include="KismetStringLibrary.h" /> <ClInclude Include="KismetStringLibrary.h" />
<ClInclude Include="KismetSystemLibrary.h" /> <ClInclude Include="KismetSystemLibrary.h" />
<ClInclude Include="KismetTextLibrary.h" /> <ClInclude Include="KismetTextLibrary.h" />
@@ -481,6 +484,7 @@
<ClInclude Include="Stack.h" /> <ClInclude Include="Stack.h" />
<ClInclude Include="StringAssetReference.h" /> <ClInclude Include="StringAssetReference.h" />
<ClInclude Include="Text.h" /> <ClInclude Include="Text.h" />
<ClInclude Include="Texture2D.h" />
<ClInclude Include="TimerManager.h" /> <ClInclude Include="TimerManager.h" />
<ClInclude Include="Transform.h" /> <ClInclude Include="Transform.h" />
<ClInclude Include="TSubclassOf.h" /> <ClInclude Include="TSubclassOf.h" />

View File

@@ -305,6 +305,12 @@
<ClCompile Include="FortServerBotManagerAthena.cpp"> <ClCompile Include="FortServerBotManagerAthena.cpp">
<Filter>FortniteGame\Source\FortniteGame\Private\AI</Filter> <Filter>FortniteGame\Source\FortniteGame\Private\AI</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="KismetRenderingLibrary.cpp">
<Filter>Engine\Source\Runtime\Engine\Private</Filter>
</ClCompile>
<ClCompile Include="Texture2D.cpp">
<Filter>Engine\Source\Runtime\Engine\Private</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="log.h" /> <ClInclude Include="log.h" />
@@ -990,6 +996,12 @@
<ClInclude Include="FortAthenaMutator_CobaltHighTower.h"> <ClInclude Include="FortAthenaMutator_CobaltHighTower.h">
<Filter>FortniteGame\Plugins\GameFeatures\LTM\HighTower_Cobalt\Source\HighTowerCobaltRuntime\Public</Filter> <Filter>FortniteGame\Plugins\GameFeatures\LTM\HighTower_Cobalt\Source\HighTowerCobaltRuntime\Public</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Texture2D.h">
<Filter>Engine\Source\Runtime\Engine\Classes\Engine</Filter>
</ClInclude>
<ClInclude Include="KismetRenderingLibrary.h">
<Filter>Engine\Source\Runtime\Engine\Classes\Kismet</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="Engine"> <Filter Include="Engine">

View File

@@ -0,0 +1,9 @@
#include "Texture2D.h"
#include "reboot.h"
UClass* UTexture2D::StaticClass()
{
static auto Class = FindObject<UClass>(L"/Script/Engine.Texture2D");
return Class;
}

View File

@@ -0,0 +1,9 @@
#pragma once
#include "Object.h"
class UTexture2D : public UObject // UTexture
{
public:
static UClass* StaticClass();
};

View File

@@ -6,7 +6,7 @@
#include <Windows.h> #include <Windows.h>
#include <dxgi.h> #include <dxgi.h>
#include <d3d11.h> // #include <d3d11.h>
#include <d3d9.h> #include <d3d9.h>
#include <ImGui/imgui.h> #include <ImGui/imgui.h>
@@ -45,6 +45,7 @@
#include "vendingmachine.h" #include "vendingmachine.h"
#include "die.h" #include "die.h"
#include "calendar.h" #include "calendar.h"
#include "KismetRenderingLibrary.h"
#define GAME_TAB 1 #define GAME_TAB 1
#define PLAYERS_TAB 2 #define PLAYERS_TAB 2
@@ -1493,7 +1494,7 @@ static inline DWORD WINAPI GuiThread(LPVOID)
// Initialize Direct3D // Initialize Direct3D
if (!CreateDeviceD3D(hwnd)) 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!"); LOG_ERROR(LogDev, "Failed to create D3D Device!");
CleanupDeviceD3D(); CleanupDeviceD3D();
::UnregisterClass(wc.lpszClassName, wc.hInstance); ::UnregisterClass(wc.lpszClassName, wc.hInstance);
@@ -1612,8 +1613,12 @@ static inline DWORD WINAPI GuiThread(LPVOID)
static inline bool CreateDeviceD3D(HWND hWnd) 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; return false;
}
// Create the D3DDevice // Create the D3DDevice
ZeroMemory(&g_d3dpp, sizeof(g_d3dpp)); ZeroMemory(&g_d3dpp, sizeof(g_d3dpp));
@@ -1624,8 +1629,14 @@ static inline bool CreateDeviceD3D(HWND hWnd)
g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16; g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; // Present with vsync g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; // Present with vsync
//g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Present without vsync, maximum unthrottled framerate //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 false;
}
return true; return true;
} }

View File

@@ -113,6 +113,7 @@ inline void InitLogger()
if (spdlog::get(#loggerName)) \ if (spdlog::get(#loggerName)) \
spdlog::get(#loggerName)->critical(std::format(__VA_ARGS__)); spdlog::get(#loggerName)->critical(std::format(__VA_ARGS__));
#else #else
#pragma warning( disable : 4390 ) // cuz then it will produce if (blahblah) ;
#define LOG_DEBUG(loggerName, ...) #define LOG_DEBUG(loggerName, ...)
#define LOG_INFO(loggerName, ...) #define LOG_INFO(loggerName, ...)
#define LOG_WARN(loggerName, ...) #define LOG_WARN(loggerName, ...)