diff --git a/Project Reboot 3.0/BuildingActor.cpp b/Project Reboot 3.0/BuildingActor.cpp index 36a3472..011f3c0 100644 --- a/Project Reboot 3.0/BuildingActor.cpp +++ b/Project Reboot 3.0/BuildingActor.cpp @@ -55,10 +55,7 @@ void ABuildingActor::OnDamageServerHook(ABuildingActor* BuildingActor, float Dam // LOG_INFO(LogDev, "Before {}", __int64(CurveTable)); - float Out; - FString ContextString; - EEvaluateCurveTableResult result; - UDataTableFunctionLibrary::EvaluateCurveTableRow(CurveTable, BuildingResourceAmountOverride.RowName, 0.f, ContextString, &result, &Out); + float Out = UDataTableFunctionLibrary::EvaluateCurveTableRow(CurveTable, BuildingResourceAmountOverride.RowName, 0.f); // LOG_INFO(LogDev, "Out: {}", Out); diff --git a/Project Reboot 3.0/DataTableFunctionLibrary.cpp b/Project Reboot 3.0/DataTableFunctionLibrary.cpp index b16e599..c73bc62 100644 --- a/Project Reboot 3.0/DataTableFunctionLibrary.cpp +++ b/Project Reboot 3.0/DataTableFunctionLibrary.cpp @@ -2,10 +2,10 @@ #include "reboot.h" -void UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, - const FString& ContextString, EEvaluateCurveTableResult* OutResult, float* OutXY) +float UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, + const FString& ContextString, EEvaluateCurveTableResult* OutResult) { - static auto fn = FindObject("/Script/Engine.DataTableFunctionLibrary.EvaluateCurveTableRow"); + static auto fn = FindObject(L"/Script/Engine.DataTableFunctionLibrary.EvaluateCurveTableRow"); float wtf{}; EEvaluateCurveTableResult wtf1{}; @@ -19,12 +19,11 @@ void UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, F if (OutResult) *OutResult = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutResult; - if (OutXY) - *OutXY = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutXY; + return UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutXY; } UClass* UDataTableFunctionLibrary::StaticClass() { - static auto Class = FindObject("/Script/Engine.DataTableFunctionLibrary"); + static auto Class = FindObject(L"/Script/Engine.DataTableFunctionLibrary"); return Class; } \ No newline at end of file diff --git a/Project Reboot 3.0/DataTableFunctionLibrary.h b/Project Reboot 3.0/DataTableFunctionLibrary.h index ee61a21..a6d11c1 100644 --- a/Project Reboot 3.0/DataTableFunctionLibrary.h +++ b/Project Reboot 3.0/DataTableFunctionLibrary.h @@ -14,8 +14,8 @@ enum class EEvaluateCurveTableResult : uint8_t class UDataTableFunctionLibrary : public UObject { public: - static void EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, - const FString& ContextString, EEvaluateCurveTableResult* OutResult, float* OutXY); + static float EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, + const FString& ContextString = FString(), EEvaluateCurveTableResult* OutResult = nullptr); static UClass* StaticClass(); }; \ No newline at end of file diff --git a/Project Reboot 3.0/FortAthenaMapInfo.h b/Project Reboot 3.0/FortAthenaMapInfo.h new file mode 100644 index 0000000..8f8466d --- /dev/null +++ b/Project Reboot 3.0/FortAthenaMapInfo.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Actor.h" + +#include "GameplayAbilityTypes.h" + +class AFortAthenaMapInfo : public AActor +{ +public: + UClass*& GetAmmoBoxClass() + { + static auto AmmoBoxClassOffset = GetOffset("AmmoBoxClass"); + return Get(AmmoBoxClassOffset); + } + + FScalableFloat* GetAmmoBoxMinSpawnPercent() + { + static auto AmmoBoxMinSpawnPercentOffset = GetOffset("AmmoBoxMinSpawnPercent"); + return GetPtr(AmmoBoxMinSpawnPercentOffset); + } + + FScalableFloat* GetAmmoBoxMaxSpawnPercent() + { + static auto AmmoBoxMaxSpawnPercentOffset = GetOffset("AmmoBoxMaxSpawnPercent"); + return GetPtr(AmmoBoxMaxSpawnPercentOffset); + } + + UClass*& GetTreasureChestClass() + { + static auto TreasureChestClassOffset = GetOffset("TreasureChestClass"); + return Get(TreasureChestClassOffset); + } + + FScalableFloat* GetTreasureChestMinSpawnPercent() + { + static auto TreasureChestMinSpawnPercentOffset = GetOffset("TreasureChestMinSpawnPercent"); + return GetPtr(TreasureChestMinSpawnPercentOffset); + } + + FScalableFloat* GetTreasureChestMaxSpawnPercent() + { + static auto TreasureChestMaxSpawnPercentOffset = GetOffset("TreasureChestMaxSpawnPercent"); + return GetPtr(TreasureChestMaxSpawnPercentOffset); + } +}; \ No newline at end of file diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index 282ee6b..351b6db 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -12,6 +12,7 @@ #include "FortAbilitySet.h" #include "NetSerialization.h" #include "GameplayStatics.h" +#include "DataTableFunctionLibrary.h" #include "KismetStringLibrary.h" #include "SoftObjectPtr.h" @@ -27,6 +28,7 @@ #include "FortAthenaMutator.h" #include "calendar.h" #include "gui.h" +#include static UFortPlaylist* GetPlaylistToUse() { @@ -121,6 +123,19 @@ UClass* AFortGameModeAthena::GetVehicleClassOverride(UClass* DefaultClass) return GetVehicleClassOverride_Params.ReturnValue; } +void AFortGameModeAthena::HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage) +{ + TArray AllActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), ActorClass); + + int AmmoBoxesToDelete = std::round(AllActors.Num() - ((AllActors.Num()) * (SpawnPercentage / 100))); + + while (AmmoBoxesToDelete) + { + AllActors.at(rand() % AllActors.Num())->K2_DestroyActor(); + AmmoBoxesToDelete--; + } +} + bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode) { Globals::bHitReadyToStartMatch = true; @@ -467,16 +482,11 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game LastNum9 = Globals::AmountOfListens; } - static auto MapInfoOffset = GameState->GetOffset("MapInfo"); - auto MapInfo = GameState->Get(MapInfoOffset); + auto MapInfo = GameState->GetMapInfo(); if (!MapInfo && Engine_Version >= 421) return false; - // if (GameState->GetPlayersLeft() < GameMode->Get("WarmupRequiredPlayerCount")) - // if (!bFirstPlayerJoined) - // return false; - static int LastNum = 1; if (Globals::AmountOfListens != LastNum) @@ -507,7 +517,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game GameSession->Get(MaxPlayersOffset) = 100; - // if (Engine_Version < 424) GameState->OnRep_CurrentPlaylistInfo(); // ? // SetupNavConfig(); @@ -821,6 +830,34 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena SpawnBGAs(); + // Handle spawn rate + + if (false) + { + auto MapInfo = GameState->GetMapInfo(); + + if (MapInfo) + { + float AmmoBoxMinSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow( + MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().CurveTable, MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().RowName, 0 + ); + + float AmmoBoxMaxSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow( + MapInfo->GetAmmoBoxMaxSpawnPercent()->GetCurve().CurveTable, MapInfo->GetAmmoBoxMaxSpawnPercent()->GetCurve().RowName, 0 + ); + + LOG_INFO(LogDev, "AmmoBoxMinSpawnPercent: {} AmmoBoxMaxSpawnPercent: {}", AmmoBoxMinSpawnPercent, AmmoBoxMaxSpawnPercent); + + std::random_device AmmoBoxRd; + std::mt19937 AmmoBoxGen(AmmoBoxRd()); + std::uniform_int_distribution<> AmmoBoxDis(AmmoBoxMinSpawnPercent * 100, AmmoBoxMaxSpawnPercent * 100 + 1); // + 1 ? + + float AmmoBoxSpawnPercent = AmmoBoxDis(AmmoBoxGen); + + HandleSpawnRateForActorClass(MapInfo->GetAmmoBoxClass(), AmmoBoxSpawnPercent); + } + } + auto SpawnIsland_FloorLoot = FindObject("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C"); auto BRIsland_FloorLoot = FindObject("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_01.Tiered_Athena_FloorLoot_01_C"); @@ -841,10 +878,6 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena { ABuildingContainer* CurrentActor = (ABuildingContainer*)SpawnIsland_FloorLoot_Actors.at(i); - // CurrentActor->K2_DestroyActor(); - // continue; - - // if (Engine_Version != 419) { auto Location = CurrentActor->GetActorLocation(); Location.Z += UpZ; diff --git a/Project Reboot 3.0/FortGameModeAthena.h b/Project Reboot 3.0/FortGameModeAthena.h index 3ffbbbc..fc9c48e 100644 --- a/Project Reboot 3.0/FortGameModeAthena.h +++ b/Project Reboot 3.0/FortGameModeAthena.h @@ -224,6 +224,10 @@ public: FName RedirectLootTier(const FName& LootTier); UClass* GetVehicleClassOverride(UClass* DefaultClass); + // Idk where to put these 3 functions. + + static void HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage); + static bool Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode); static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller); static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor); diff --git a/Project Reboot 3.0/FortGameStateAthena.h b/Project Reboot 3.0/FortGameStateAthena.h index 671c735..5e57316 100644 --- a/Project Reboot 3.0/FortGameStateAthena.h +++ b/Project Reboot 3.0/FortGameStateAthena.h @@ -6,6 +6,7 @@ #include "BuildingStructuralSupportSystem.h" #include "ScriptInterface.h" #include "Interface.h" +#include "FortAthenaMapInfo.h" enum class EAthenaGamePhaseStep : uint8_t // idk if this changes { @@ -79,6 +80,12 @@ public: return Get(PlayerBuildableClassesOffset); } + AFortAthenaMapInfo*& GetMapInfo() + { + static auto MapInfoOffset = GetOffset("MapInfo"); + return Get(MapInfoOffset); + } + UFortPlaylist*& GetCurrentPlaylist(); TScriptInterface GetSafeZoneInterface(); diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index d892255..e900a5f 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -1291,7 +1291,7 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo { static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath"); - bool bAllowSpectate = GameMode->Get(bAllowSpectateAfterDeathOffset); + bool bAllowSpectate = false; // GameMode->Get(bAllowSpectateAfterDeathOffset); LOG_INFO(LogDev, "bAllowSpectate: {}", bAllowSpectate); diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.cpp b/Project Reboot 3.0/FortPlayerControllerAthena.cpp index 917cdd1..10fe242 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.cpp +++ b/Project Reboot 3.0/FortPlayerControllerAthena.cpp @@ -159,18 +159,14 @@ void AFortPlayerControllerAthena::EnterAircraftHook(UObject* PC, AActor* Aircraf if (!ItemToGive->GetItemToDrop()) continue; - float Out = 1; - FString ContextString; - EEvaluateCurveTableResult result; float Out2 = 0; if (!IsBadReadPtr(ItemToGive->GetNumberToGive().GetCurve().CurveTable, 8) && ItemToGive->GetNumberToGive().GetCurve().RowName.IsValid()) { - UDataTableFunctionLibrary::EvaluateCurveTableRow(ItemToGive->GetNumberToGive().GetCurve().CurveTable, ItemToGive->GetNumberToGive().GetCurve().RowName, - 0.f, ContextString, &result, &Out2); + Out2 = UDataTableFunctionLibrary::EvaluateCurveTableRow(ItemToGive->GetNumberToGive().GetCurve().CurveTable, ItemToGive->GetNumberToGive().GetCurve().RowName, 0.f); } - LOG_INFO(LogDev, "[{}] [{}] Out: {} Out2: {} ItemToGive.ItemToDrop: {}", i, j, Out, Out2, ItemToGive->GetItemToDrop()->IsValidLowLevel() ? ItemToGive->GetItemToDrop()->GetFullName() : "BadRead"); + LOG_INFO(LogDev, "[{}] [{}] Out2: {} ItemToGive.ItemToDrop: {}", i, j, Out2, ItemToGive->GetItemToDrop()->IsValidLowLevel() ? ItemToGive->GetItemToDrop()->GetFullName() : "BadRead"); if (!Out2) continue; diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj b/Project Reboot 3.0/Project Reboot 3.0.vcxproj index ee9a53a..34e1860 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj @@ -284,7 +284,7 @@ - + @@ -301,6 +301,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 43abac3..afdb856 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -814,9 +814,12 @@ Reboot\Public - + Reboot\Public + + FortniteGame\Source\FortniteGame\Public + diff --git a/Project Reboot 3.0/creative.h b/Project Reboot 3.0/builder.h similarity index 82% rename from Project Reboot 3.0/creative.h rename to Project Reboot 3.0/builder.h index 49da240..d6cdd2d 100644 --- a/Project Reboot 3.0/creative.h +++ b/Project Reboot 3.0/builder.h @@ -10,9 +10,9 @@ namespace fs = std::filesystem; -namespace Creative +namespace Builder { - static inline bool LoadIsland(const std::string& SaveFileName, AFortVolume* LoadIntoVolume, bool* bCouldBeOutdatedPtr = nullptr) + static inline bool LoadSave(const std::string& SaveFileName, const FVector& Location, const FRotator& Rotation) { auto GameState = Cast(GetWorld()->GetGameState()); @@ -24,20 +24,9 @@ namespace Creative return false; } - /* auto AllBuildingActors = LoadIntoVolume->GetActorsWithinVolumeByClass(ABuildingActor::StaticClass()); - - for (int i = 0; i < AllBuildingActors.Num(); i++) - { - auto CurrentBuildingActor = (ABuildingActor*)AllBuildingActors[i]; - CurrentBuildingActor->SilentDie(); - } */ - nlohmann::json j; fileStream >> j; - auto VolumeLocation = LoadIntoVolume->GetActorLocation(); - auto VolumeRotation = LoadIntoVolume->GetActorRotation(); - for (const auto& obj : j) { for (auto it = obj.begin(); it != obj.end(); ++it) { auto& ClassName = it.key(); @@ -82,9 +71,9 @@ namespace Creative if (stuff.size() >= 8) { FRotator rot{}; - rot.Pitch = stuff[3] + VolumeRotation.Pitch; - rot.Roll = stuff[4] + VolumeRotation.Roll; - rot.Yaw = stuff[5] + VolumeRotation.Yaw; + rot.Pitch = stuff[3] + Rotation.Pitch; + rot.Roll = stuff[4] + Rotation.Roll; + rot.Yaw = stuff[5] + Rotation.Yaw; FVector Scale3D = { 1, 1, 1 }; @@ -95,7 +84,7 @@ namespace Creative Scale3D.Z = stuff[10]; } - auto NewActor = GetWorld()->SpawnActor(Class, FVector{ stuff[0] + VolumeLocation.X , stuff[1] + VolumeLocation.Y, stuff[2] + VolumeLocation.Z }, + auto NewActor = GetWorld()->SpawnActor(Class, FVector{ stuff[0] + Location.X , stuff[1] + Location.Y, stuff[2] + Location.Z }, rot.Quaternion(), Scale3D); if (!NewActor) @@ -107,7 +96,7 @@ namespace Creative // NewActor->SetHealth(stuff[7]); static auto FortActorOptionsComponentClass = FindObject("/Script/FortniteGame.FortActorOptionsComponent"); - auto ActorOptionsComponent = NewActor->GetComponentByClass(FortActorOptionsComponentClass); + auto ActorOptionsComponent = FortActorOptionsComponentClass ? NewActor->GetComponentByClass(FortActorOptionsComponentClass) : nullptr; // continue; @@ -144,4 +133,17 @@ namespace Creative return true; } + + static inline bool LoadSave(const std::string& SaveFileName, AFortVolume* LoadIntoVolume) + { + /* auto AllBuildingActors = LoadIntoVolume->GetActorsWithinVolumeByClass(ABuildingActor::StaticClass()); + + for (int i = 0; i < AllBuildingActors.Num(); i++) + { + auto CurrentBuildingActor = (ABuildingActor*)AllBuildingActors[i]; + CurrentBuildingActor->SilentDie(); + } */ + + return LoadSave(SaveFileName, LoadIntoVolume->GetActorLocation(), LoadIntoVolume->GetActorRotation()); + } } \ No newline at end of file diff --git a/Project Reboot 3.0/commands.h b/Project Reboot 3.0/commands.h index 96338f9..2439fc2 100644 --- a/Project Reboot 3.0/commands.h +++ b/Project Reboot 3.0/commands.h @@ -6,7 +6,7 @@ #include "AthenaBarrierObjective.h" #include "FortAthenaMutator_Barrier.h" #include "FortWeaponMeleeItemDefinition.h" -#include "creative.h" +#include "builder.h" bool IsOperator(APlayerState* PlayerState, AFortPlayerController* PlayerController) { @@ -262,13 +262,8 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) return; } - auto Volume = ReceivingController->GetCreativePlotLinkedVolume(); - - if (!Volume) - { - SendMessageToConsole(PlayerController, L"They do not have an island!"); - return; - } + static auto CreativePlotLinkedVolumeOffset = ReceivingController->GetOffset("CreativePlotLinkedVolume", false); + auto Volume = CreativePlotLinkedVolumeOffset == -1 ? nullptr : ReceivingController->GetCreativePlotLinkedVolume(); if (Arguments.size() <= 1) { @@ -281,7 +276,31 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) try { FileName = Arguments[1]; } catch (...) {} - Creative::LoadIsland(FileName, Volume); + float X{ -1 }, Y{ -1 }, Z{ -1 }; + + if (Arguments.size() >= 4) + { + try { X = std::stof(Arguments[2]); } + catch (...) {} + try { Y = std::stof(Arguments[3]); } + catch (...) {} + try { Z = std::stof(Arguments[4]); } + catch (...) {} + } + else + { + if (!Volume) + { + SendMessageToConsole(PlayerController, L"They do not have an island!"); + return; + } + } + + if (X != -1 && Y != -1 && Z != -1) // omg what if they want to spawn it at -1 -1 -1!!! + Builder::LoadSave(FileName, FVector(X, Y, Z), FRotator()); + else + Builder::LoadSave(FileName, Volume); + SendMessageToConsole(PlayerController, L"Loaded!"); } else if (Command == "spawnpickup") diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index b6a4a5b..e7fa4e8 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -62,19 +62,19 @@ static inline bool bIsInAutoRestart = false; // THE BASE CODE IS FROM IMGUI GITHUB -static LPDIRECT3D9 g_pD3D = NULL; -static LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; -static D3DPRESENT_PARAMETERS g_d3dpp = {}; +static inline LPDIRECT3D9 g_pD3D = NULL; +static inline LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; +static inline D3DPRESENT_PARAMETERS g_d3dpp = {}; // Forward declarations of helper functions -bool CreateDeviceD3D(HWND hWnd); -void CleanupDeviceD3D(); -void ResetDevice(); -LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); +static inline bool CreateDeviceD3D(HWND hWnd); +static inline void CleanupDeviceD3D(); +static inline void ResetDevice(); +static inline LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); static inline bool bStartedBus = false; -void Restart() // todo move? +static inline void Restart() // todo move? { FString LevelA = Engine_Version < 424 ? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501 @@ -124,7 +124,7 @@ void Restart() // todo move? // UGameplayStatics::OpenLevel(GetWorld(), UKismetStringLibrary::Conv_StringToName(LevelA), true, FString()); } -std::string wstring_to_utf8(const std::wstring& str) +static inline std::string wstring_to_utf8(const std::wstring& str) { if (str.empty()) return {}; const auto size_needed = WideCharToMultiByte(CP_UTF8, 0, &str[0], static_cast(str.size()), nullptr, 0, nullptr, nullptr); @@ -133,7 +133,7 @@ std::string wstring_to_utf8(const std::wstring& str) return str_to; } -void InitStyle() +static inline void InitStyle() { ImFontConfig FontConfig; FontConfig.FontDataOwnedByAtlas = false; @@ -194,18 +194,7 @@ void InitStyle() style.Colors[ImGuiCol_PopupBg] = ImVec4(0.20f, 0.22f, 0.27f, 0.9f); } -class Playera -{ -public: - std::string Name; - int Kills = 0; - - Playera(const std::string& _Name, int _Kills) : Name(_Name), Kills(_Kills) {} - - Playera() {} -}; - -void TextCentered(std::string text, bool bNewLine = true) { +static inline void TextCentered(std::string text, bool bNewLine = true) { if (bNewLine) ImGui::NewLine(); @@ -229,7 +218,7 @@ void TextCentered(std::string text, bool bNewLine = true) { ImGui::PopTextWrapPos(); } -bool ButtonCentered(std::string text, bool bNewLine = true) { +static inline bool ButtonCentered(std::string text, bool bNewLine = true) { if (bNewLine) ImGui::NewLine(); @@ -254,7 +243,7 @@ bool ButtonCentered(std::string text, bool bNewLine = true) { return res; } -void InputVector(const std::string& baseText, FVector* vec) +static inline void InputVector(const std::string& baseText, FVector* vec) { ImGui::InputFloat((baseText + " X").c_str(), &vec->X); ImGui::InputFloat((baseText + " Y").c_str(), &vec->Y); @@ -270,7 +259,7 @@ static bool bIsEditingInventory = false; static bool bInformationTab = false; static int playerTabTab = MAIN_PLAYERTAB; -void StaticUI() +static inline void StaticUI() { ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart); @@ -289,7 +278,7 @@ void StaticUI() } } -void MainTabs() +static inline void MainTabs() { // std::ofstream bannedStream(Moderation::Banning::GetFilePath()); @@ -390,7 +379,7 @@ void MainTabs() } } -void PlayerTabs() +static inline void PlayerTabs() { if (ImGui::BeginTabBar("")) { @@ -422,7 +411,7 @@ void PlayerTabs() } } -void MainUI() +static inline void MainUI() { bool bLoaded = true; @@ -915,7 +904,7 @@ void MainUI() } } -void PregameUI() +static inline void PregameUI() { StaticUI(); @@ -939,7 +928,7 @@ void PregameUI() ImGui::InputText("Playlist", &PlaylistName); } -DWORD WINAPI GuiThread(LPVOID) +static inline DWORD WINAPI GuiThread(LPVOID) { WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"RebootClass", NULL }; ::RegisterClassEx(&wc); @@ -1116,7 +1105,7 @@ DWORD WINAPI GuiThread(LPVOID) // Helper functions -bool CreateDeviceD3D(HWND hWnd) +static inline bool CreateDeviceD3D(HWND hWnd) { if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) return false; @@ -1136,13 +1125,13 @@ bool CreateDeviceD3D(HWND hWnd) return true; } -void CleanupDeviceD3D() +static inline void CleanupDeviceD3D() { if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; } if (g_pD3D) { g_pD3D->Release(); g_pD3D = NULL; } } -void ResetDevice() +static inline void ResetDevice() { ImGui_ImplDX9_InvalidateDeviceObjects(); HRESULT hr = g_pd3dDevice->Reset(&g_d3dpp); @@ -1153,7 +1142,7 @@ void ResetDevice() extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); -LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +static inline LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // my implementation of window dragging.. /* { diff --git a/vendor/Fonts/ruda-bold.h b/vendor/Fonts/ruda-bold.h index 8890a84..bc220d2 100644 --- a/vendor/Fonts/ruda-bold.h +++ b/vendor/Fonts/ruda-bold.h @@ -1,7 +1,7 @@ /* C:\Users\Stowe\Downloads\ruda.bold.ttf (4/13/2023 9:01:48 PM) StartOffset(h): 00000000, EndOffset(h): 0000610F, Length(h): 00006110 */ -unsigned char ruda_bold_data[24848] = { +static inline unsigned char ruda_bold_data[24848] = { 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x04, 0x00, 0x10, 0x44, 0x53, 0x49, 0x47, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x61, 0x08, 0x00, 0x00, 0x00, 0x08, 0x46, 0x46, 0x54, 0x4D, 0x5F, 0xE3, 0x7D, 0x17, diff --git a/vendor/Images/reboot_icon.h b/vendor/Images/reboot_icon.h index 6d008e7..d0ae317 100644 --- a/vendor/Images/reboot_icon.h +++ b/vendor/Images/reboot_icon.h @@ -1,7 +1,7 @@ /* F:\Fortnite\Seasons\Fortnite 8.51\FortniteGame\Binaries\Win64\Reboot Resources\images\reboot.ico (7/27/2022 10:26:15 PM) StartOffset(h): 00000000, EndOffset(h): 00003AED, Length(h): 00003AEE */ -unsigned char reboot_icon_data[15086] = { +static inline unsigned char reboot_icon_data[15086] = { 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x30, 0x30, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xA8, 0x25, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xA8, 0x10, 0x00, 0x00, 0xDE, 0x25,