disable spectating (should fix some crashes), option to load island at input location, fix compiler errors, work on container spawn rate.
This commit is contained in:
Milxnor
2023-04-29 18:35:49 -04:00
parent cda077d6f8
commit e04b3a2054
16 changed files with 190 additions and 95 deletions

View File

@@ -55,10 +55,7 @@ void ABuildingActor::OnDamageServerHook(ABuildingActor* BuildingActor, float Dam
// LOG_INFO(LogDev, "Before {}", __int64(CurveTable)); // LOG_INFO(LogDev, "Before {}", __int64(CurveTable));
float Out; float Out = UDataTableFunctionLibrary::EvaluateCurveTableRow(CurveTable, BuildingResourceAmountOverride.RowName, 0.f);
FString ContextString;
EEvaluateCurveTableResult result;
UDataTableFunctionLibrary::EvaluateCurveTableRow(CurveTable, BuildingResourceAmountOverride.RowName, 0.f, ContextString, &result, &Out);
// LOG_INFO(LogDev, "Out: {}", Out); // LOG_INFO(LogDev, "Out: {}", Out);

View File

@@ -2,10 +2,10 @@
#include "reboot.h" #include "reboot.h"
void UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, float UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY,
const FString& ContextString, EEvaluateCurveTableResult* OutResult, float* OutXY) const FString& ContextString, EEvaluateCurveTableResult* OutResult)
{ {
static auto fn = FindObject<UFunction>("/Script/Engine.DataTableFunctionLibrary.EvaluateCurveTableRow"); static auto fn = FindObject<UFunction>(L"/Script/Engine.DataTableFunctionLibrary.EvaluateCurveTableRow");
float wtf{}; float wtf{};
EEvaluateCurveTableResult wtf1{}; EEvaluateCurveTableResult wtf1{};
@@ -19,12 +19,11 @@ void UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, F
if (OutResult) if (OutResult)
*OutResult = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutResult; *OutResult = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutResult;
if (OutXY) return UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutXY;
*OutXY = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutXY;
} }
UClass* UDataTableFunctionLibrary::StaticClass() UClass* UDataTableFunctionLibrary::StaticClass()
{ {
static auto Class = FindObject<UClass>("/Script/Engine.DataTableFunctionLibrary"); static auto Class = FindObject<UClass>(L"/Script/Engine.DataTableFunctionLibrary");
return Class; return Class;
} }

View File

@@ -14,8 +14,8 @@ enum class EEvaluateCurveTableResult : uint8_t
class UDataTableFunctionLibrary : public UObject class UDataTableFunctionLibrary : public UObject
{ {
public: public:
static void EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, static float EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY,
const FString& ContextString, EEvaluateCurveTableResult* OutResult, float* OutXY); const FString& ContextString = FString(), EEvaluateCurveTableResult* OutResult = nullptr);
static UClass* StaticClass(); static UClass* StaticClass();
}; };

View File

@@ -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<UClass*>(AmmoBoxClassOffset);
}
FScalableFloat* GetAmmoBoxMinSpawnPercent()
{
static auto AmmoBoxMinSpawnPercentOffset = GetOffset("AmmoBoxMinSpawnPercent");
return GetPtr<FScalableFloat>(AmmoBoxMinSpawnPercentOffset);
}
FScalableFloat* GetAmmoBoxMaxSpawnPercent()
{
static auto AmmoBoxMaxSpawnPercentOffset = GetOffset("AmmoBoxMaxSpawnPercent");
return GetPtr<FScalableFloat>(AmmoBoxMaxSpawnPercentOffset);
}
UClass*& GetTreasureChestClass()
{
static auto TreasureChestClassOffset = GetOffset("TreasureChestClass");
return Get<UClass*>(TreasureChestClassOffset);
}
FScalableFloat* GetTreasureChestMinSpawnPercent()
{
static auto TreasureChestMinSpawnPercentOffset = GetOffset("TreasureChestMinSpawnPercent");
return GetPtr<FScalableFloat>(TreasureChestMinSpawnPercentOffset);
}
FScalableFloat* GetTreasureChestMaxSpawnPercent()
{
static auto TreasureChestMaxSpawnPercentOffset = GetOffset("TreasureChestMaxSpawnPercent");
return GetPtr<FScalableFloat>(TreasureChestMaxSpawnPercentOffset);
}
};

View File

@@ -12,6 +12,7 @@
#include "FortAbilitySet.h" #include "FortAbilitySet.h"
#include "NetSerialization.h" #include "NetSerialization.h"
#include "GameplayStatics.h" #include "GameplayStatics.h"
#include "DataTableFunctionLibrary.h"
#include "KismetStringLibrary.h" #include "KismetStringLibrary.h"
#include "SoftObjectPtr.h" #include "SoftObjectPtr.h"
@@ -27,6 +28,7 @@
#include "FortAthenaMutator.h" #include "FortAthenaMutator.h"
#include "calendar.h" #include "calendar.h"
#include "gui.h" #include "gui.h"
#include <random>
static UFortPlaylist* GetPlaylistToUse() static UFortPlaylist* GetPlaylistToUse()
{ {
@@ -121,6 +123,19 @@ UClass* AFortGameModeAthena::GetVehicleClassOverride(UClass* DefaultClass)
return GetVehicleClassOverride_Params.ReturnValue; return GetVehicleClassOverride_Params.ReturnValue;
} }
void AFortGameModeAthena::HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage)
{
TArray<AActor*> 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) bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode)
{ {
Globals::bHitReadyToStartMatch = true; Globals::bHitReadyToStartMatch = true;
@@ -467,16 +482,11 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
LastNum9 = Globals::AmountOfListens; LastNum9 = Globals::AmountOfListens;
} }
static auto MapInfoOffset = GameState->GetOffset("MapInfo"); auto MapInfo = GameState->GetMapInfo();
auto MapInfo = GameState->Get(MapInfoOffset);
if (!MapInfo && Engine_Version >= 421) if (!MapInfo && Engine_Version >= 421)
return false; return false;
// if (GameState->GetPlayersLeft() < GameMode->Get<int>("WarmupRequiredPlayerCount"))
// if (!bFirstPlayerJoined)
// return false;
static int LastNum = 1; static int LastNum = 1;
if (Globals::AmountOfListens != LastNum) if (Globals::AmountOfListens != LastNum)
@@ -507,7 +517,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
GameSession->Get<int>(MaxPlayersOffset) = 100; GameSession->Get<int>(MaxPlayersOffset) = 100;
// if (Engine_Version < 424)
GameState->OnRep_CurrentPlaylistInfo(); // ? GameState->OnRep_CurrentPlaylistInfo(); // ?
// SetupNavConfig(); // SetupNavConfig();
@@ -821,6 +830,34 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
SpawnBGAs(); 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<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C"); auto SpawnIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C");
auto BRIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_01.Tiered_Athena_FloorLoot_01_C"); auto BRIsland_FloorLoot = FindObject<UClass>("/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); ABuildingContainer* CurrentActor = (ABuildingContainer*)SpawnIsland_FloorLoot_Actors.at(i);
// CurrentActor->K2_DestroyActor();
// continue;
// if (Engine_Version != 419)
{ {
auto Location = CurrentActor->GetActorLocation(); auto Location = CurrentActor->GetActorLocation();
Location.Z += UpZ; Location.Z += UpZ;

View File

@@ -224,6 +224,10 @@ public:
FName RedirectLootTier(const FName& LootTier); FName RedirectLootTier(const FName& LootTier);
UClass* GetVehicleClassOverride(UClass* DefaultClass); 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 bool Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode);
static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller); static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller);
static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor); static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor);

View File

@@ -6,6 +6,7 @@
#include "BuildingStructuralSupportSystem.h" #include "BuildingStructuralSupportSystem.h"
#include "ScriptInterface.h" #include "ScriptInterface.h"
#include "Interface.h" #include "Interface.h"
#include "FortAthenaMapInfo.h"
enum class EAthenaGamePhaseStep : uint8_t // idk if this changes enum class EAthenaGamePhaseStep : uint8_t // idk if this changes
{ {
@@ -79,6 +80,12 @@ public:
return Get<FPlayerBuildableClassContainer*>(PlayerBuildableClassesOffset); return Get<FPlayerBuildableClassContainer*>(PlayerBuildableClassesOffset);
} }
AFortAthenaMapInfo*& GetMapInfo()
{
static auto MapInfoOffset = GetOffset("MapInfo");
return Get<AFortAthenaMapInfo*>(MapInfoOffset);
}
UFortPlaylist*& GetCurrentPlaylist(); UFortPlaylist*& GetCurrentPlaylist();
TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface(); TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface();

View File

@@ -1291,7 +1291,7 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
{ {
static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath"); static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath");
bool bAllowSpectate = GameMode->Get<bool>(bAllowSpectateAfterDeathOffset); bool bAllowSpectate = false; // GameMode->Get<bool>(bAllowSpectateAfterDeathOffset);
LOG_INFO(LogDev, "bAllowSpectate: {}", bAllowSpectate); LOG_INFO(LogDev, "bAllowSpectate: {}", bAllowSpectate);

View File

@@ -159,18 +159,14 @@ void AFortPlayerControllerAthena::EnterAircraftHook(UObject* PC, AActor* Aircraf
if (!ItemToGive->GetItemToDrop()) if (!ItemToGive->GetItemToDrop())
continue; continue;
float Out = 1;
FString ContextString;
EEvaluateCurveTableResult result;
float Out2 = 0; float Out2 = 0;
if (!IsBadReadPtr(ItemToGive->GetNumberToGive().GetCurve().CurveTable, 8) && ItemToGive->GetNumberToGive().GetCurve().RowName.IsValid()) if (!IsBadReadPtr(ItemToGive->GetNumberToGive().GetCurve().CurveTable, 8) && ItemToGive->GetNumberToGive().GetCurve().RowName.IsValid())
{ {
UDataTableFunctionLibrary::EvaluateCurveTableRow(ItemToGive->GetNumberToGive().GetCurve().CurveTable, ItemToGive->GetNumberToGive().GetCurve().RowName, Out2 = UDataTableFunctionLibrary::EvaluateCurveTableRow(ItemToGive->GetNumberToGive().GetCurve().CurveTable, ItemToGive->GetNumberToGive().GetCurve().RowName, 0.f);
0.f, ContextString, &result, &Out2);
} }
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) if (!Out2)
continue; continue;

View File

@@ -284,7 +284,7 @@
<ClInclude Include="commands.h" /> <ClInclude Include="commands.h" />
<ClInclude Include="ContainerAllocationPolicies.h" /> <ClInclude Include="ContainerAllocationPolicies.h" />
<ClInclude Include="Controller.h" /> <ClInclude Include="Controller.h" />
<ClInclude Include="creative.h" /> <ClInclude Include="builder.h" />
<ClInclude Include="CurveTable.h" /> <ClInclude Include="CurveTable.h" />
<ClInclude Include="DataTable.h" /> <ClInclude Include="DataTable.h" />
<ClInclude Include="DataTableFunctionLibrary.h" /> <ClInclude Include="DataTableFunctionLibrary.h" />
@@ -301,6 +301,7 @@
<ClInclude Include="finder.h" /> <ClInclude Include="finder.h" />
<ClInclude Include="FortAbilitySet.h" /> <ClInclude Include="FortAbilitySet.h" />
<ClInclude Include="FortAthenaCreativePortal.h" /> <ClInclude Include="FortAthenaCreativePortal.h" />
<ClInclude Include="FortAthenaMapInfo.h" />
<ClInclude Include="FortAthenaMutator.h" /> <ClInclude Include="FortAthenaMutator.h" />
<ClInclude Include="FortAthenaMutator_Barrier.h" /> <ClInclude Include="FortAthenaMutator_Barrier.h" />
<ClInclude Include="FortAthenaMutator_Disco.h" /> <ClInclude Include="FortAthenaMutator_Disco.h" />

View File

@@ -814,9 +814,12 @@
<ClInclude Include="moderation.h"> <ClInclude Include="moderation.h">
<Filter>Reboot\Public</Filter> <Filter>Reboot\Public</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="creative.h"> <ClInclude Include="builder.h">
<Filter>Reboot\Public</Filter> <Filter>Reboot\Public</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="FortAthenaMapInfo.h">
<Filter>FortniteGame\Source\FortniteGame\Public</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="Engine"> <Filter Include="Engine">

View File

@@ -10,9 +10,9 @@
namespace fs = std::filesystem; 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<AFortGameStateAthena>(GetWorld()->GetGameState()); auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
@@ -24,20 +24,9 @@ namespace Creative
return false; 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; nlohmann::json j;
fileStream >> j; fileStream >> j;
auto VolumeLocation = LoadIntoVolume->GetActorLocation();
auto VolumeRotation = LoadIntoVolume->GetActorRotation();
for (const auto& obj : j) { for (const auto& obj : j) {
for (auto it = obj.begin(); it != obj.end(); ++it) { for (auto it = obj.begin(); it != obj.end(); ++it) {
auto& ClassName = it.key(); auto& ClassName = it.key();
@@ -82,9 +71,9 @@ namespace Creative
if (stuff.size() >= 8) if (stuff.size() >= 8)
{ {
FRotator rot{}; FRotator rot{};
rot.Pitch = stuff[3] + VolumeRotation.Pitch; rot.Pitch = stuff[3] + Rotation.Pitch;
rot.Roll = stuff[4] + VolumeRotation.Roll; rot.Roll = stuff[4] + Rotation.Roll;
rot.Yaw = stuff[5] + VolumeRotation.Yaw; rot.Yaw = stuff[5] + Rotation.Yaw;
FVector Scale3D = { 1, 1, 1 }; FVector Scale3D = { 1, 1, 1 };
@@ -95,7 +84,7 @@ namespace Creative
Scale3D.Z = stuff[10]; Scale3D.Z = stuff[10];
} }
auto NewActor = GetWorld()->SpawnActor<ABuildingActor>(Class, FVector{ stuff[0] + VolumeLocation.X , stuff[1] + VolumeLocation.Y, stuff[2] + VolumeLocation.Z }, auto NewActor = GetWorld()->SpawnActor<ABuildingActor>(Class, FVector{ stuff[0] + Location.X , stuff[1] + Location.Y, stuff[2] + Location.Z },
rot.Quaternion(), Scale3D); rot.Quaternion(), Scale3D);
if (!NewActor) if (!NewActor)
@@ -107,7 +96,7 @@ namespace Creative
// NewActor->SetHealth(stuff[7]); // NewActor->SetHealth(stuff[7]);
static auto FortActorOptionsComponentClass = FindObject<UClass>("/Script/FortniteGame.FortActorOptionsComponent"); static auto FortActorOptionsComponentClass = FindObject<UClass>("/Script/FortniteGame.FortActorOptionsComponent");
auto ActorOptionsComponent = NewActor->GetComponentByClass(FortActorOptionsComponentClass); auto ActorOptionsComponent = FortActorOptionsComponentClass ? NewActor->GetComponentByClass(FortActorOptionsComponentClass) : nullptr;
// continue; // continue;
@@ -144,4 +133,17 @@ namespace Creative
return true; 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());
}
} }

View File

@@ -6,7 +6,7 @@
#include "AthenaBarrierObjective.h" #include "AthenaBarrierObjective.h"
#include "FortAthenaMutator_Barrier.h" #include "FortAthenaMutator_Barrier.h"
#include "FortWeaponMeleeItemDefinition.h" #include "FortWeaponMeleeItemDefinition.h"
#include "creative.h" #include "builder.h"
bool IsOperator(APlayerState* PlayerState, AFortPlayerController* PlayerController) bool IsOperator(APlayerState* PlayerState, AFortPlayerController* PlayerController)
{ {
@@ -262,13 +262,8 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
return; return;
} }
auto Volume = ReceivingController->GetCreativePlotLinkedVolume(); static auto CreativePlotLinkedVolumeOffset = ReceivingController->GetOffset("CreativePlotLinkedVolume", false);
auto Volume = CreativePlotLinkedVolumeOffset == -1 ? nullptr : ReceivingController->GetCreativePlotLinkedVolume();
if (!Volume)
{
SendMessageToConsole(PlayerController, L"They do not have an island!");
return;
}
if (Arguments.size() <= 1) if (Arguments.size() <= 1)
{ {
@@ -281,7 +276,31 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
try { FileName = Arguments[1]; } try { FileName = Arguments[1]; }
catch (...) {} 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!"); SendMessageToConsole(PlayerController, L"Loaded!");
} }
else if (Command == "spawnpickup") else if (Command == "spawnpickup")

View File

@@ -62,19 +62,19 @@ static inline bool bIsInAutoRestart = false;
// THE BASE CODE IS FROM IMGUI GITHUB // THE BASE CODE IS FROM IMGUI GITHUB
static LPDIRECT3D9 g_pD3D = NULL; static inline LPDIRECT3D9 g_pD3D = NULL;
static LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; static inline LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
static D3DPRESENT_PARAMETERS g_d3dpp = {}; static inline D3DPRESENT_PARAMETERS g_d3dpp = {};
// Forward declarations of helper functions // Forward declarations of helper functions
bool CreateDeviceD3D(HWND hWnd); static inline bool CreateDeviceD3D(HWND hWnd);
void CleanupDeviceD3D(); static inline void CleanupDeviceD3D();
void ResetDevice(); static inline void ResetDevice();
LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); static inline LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static inline bool bStartedBus = false; static inline bool bStartedBus = false;
void Restart() // todo move? static inline void Restart() // todo move?
{ {
FString LevelA = Engine_Version < 424 FString LevelA = Engine_Version < 424
? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501 ? 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()); // 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 {}; if (str.empty()) return {};
const auto size_needed = WideCharToMultiByte(CP_UTF8, 0, &str[0], static_cast<int>(str.size()), nullptr, 0, nullptr, nullptr); const auto size_needed = WideCharToMultiByte(CP_UTF8, 0, &str[0], static_cast<int>(str.size()), nullptr, 0, nullptr, nullptr);
@@ -133,7 +133,7 @@ std::string wstring_to_utf8(const std::wstring& str)
return str_to; return str_to;
} }
void InitStyle() static inline void InitStyle()
{ {
ImFontConfig FontConfig; ImFontConfig FontConfig;
FontConfig.FontDataOwnedByAtlas = false; FontConfig.FontDataOwnedByAtlas = false;
@@ -194,18 +194,7 @@ void InitStyle()
style.Colors[ImGuiCol_PopupBg] = ImVec4(0.20f, 0.22f, 0.27f, 0.9f); style.Colors[ImGuiCol_PopupBg] = ImVec4(0.20f, 0.22f, 0.27f, 0.9f);
} }
class Playera static inline void TextCentered(std::string text, bool bNewLine = true) {
{
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) {
if (bNewLine) if (bNewLine)
ImGui::NewLine(); ImGui::NewLine();
@@ -229,7 +218,7 @@ void TextCentered(std::string text, bool bNewLine = true) {
ImGui::PopTextWrapPos(); ImGui::PopTextWrapPos();
} }
bool ButtonCentered(std::string text, bool bNewLine = true) { static inline bool ButtonCentered(std::string text, bool bNewLine = true) {
if (bNewLine) if (bNewLine)
ImGui::NewLine(); ImGui::NewLine();
@@ -254,7 +243,7 @@ bool ButtonCentered(std::string text, bool bNewLine = true) {
return res; 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 + " X").c_str(), &vec->X);
ImGui::InputFloat((baseText + " Y").c_str(), &vec->Y); ImGui::InputFloat((baseText + " Y").c_str(), &vec->Y);
@@ -270,7 +259,7 @@ static bool bIsEditingInventory = false;
static bool bInformationTab = false; static bool bInformationTab = false;
static int playerTabTab = MAIN_PLAYERTAB; static int playerTabTab = MAIN_PLAYERTAB;
void StaticUI() static inline void StaticUI()
{ {
ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart); ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart);
@@ -289,7 +278,7 @@ void StaticUI()
} }
} }
void MainTabs() static inline void MainTabs()
{ {
// std::ofstream bannedStream(Moderation::Banning::GetFilePath()); // std::ofstream bannedStream(Moderation::Banning::GetFilePath());
@@ -390,7 +379,7 @@ void MainTabs()
} }
} }
void PlayerTabs() static inline void PlayerTabs()
{ {
if (ImGui::BeginTabBar("")) if (ImGui::BeginTabBar(""))
{ {
@@ -422,7 +411,7 @@ void PlayerTabs()
} }
} }
void MainUI() static inline void MainUI()
{ {
bool bLoaded = true; bool bLoaded = true;
@@ -915,7 +904,7 @@ void MainUI()
} }
} }
void PregameUI() static inline void PregameUI()
{ {
StaticUI(); StaticUI();
@@ -939,7 +928,7 @@ void PregameUI()
ImGui::InputText("Playlist", &PlaylistName); 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 }; WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"RebootClass", NULL };
::RegisterClassEx(&wc); ::RegisterClassEx(&wc);
@@ -1116,7 +1105,7 @@ DWORD WINAPI GuiThread(LPVOID)
// Helper functions // Helper functions
bool CreateDeviceD3D(HWND hWnd) static inline bool CreateDeviceD3D(HWND hWnd)
{ {
if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL) if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
return false; return false;
@@ -1136,13 +1125,13 @@ bool CreateDeviceD3D(HWND hWnd)
return true; return true;
} }
void CleanupDeviceD3D() static inline void CleanupDeviceD3D()
{ {
if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; } if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; }
if (g_pD3D) { g_pD3D->Release(); g_pD3D = NULL; } if (g_pD3D) { g_pD3D->Release(); g_pD3D = NULL; }
} }
void ResetDevice() static inline void ResetDevice()
{ {
ImGui_ImplDX9_InvalidateDeviceObjects(); ImGui_ImplDX9_InvalidateDeviceObjects();
HRESULT hr = g_pd3dDevice->Reset(&g_d3dpp); 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); 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.. // my implementation of window dragging..
/* { /* {

View File

@@ -1,7 +1,7 @@
/* C:\Users\Stowe\Downloads\ruda.bold.ttf (4/13/2023 9:01:48 PM) /* C:\Users\Stowe\Downloads\ruda.bold.ttf (4/13/2023 9:01:48 PM)
StartOffset(h): 00000000, EndOffset(h): 0000610F, Length(h): 00006110 */ 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, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x04, 0x00, 0x10,
0x44, 0x53, 0x49, 0x47, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x61, 0x08, 0x44, 0x53, 0x49, 0x47, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x61, 0x08,
0x00, 0x00, 0x00, 0x08, 0x46, 0x46, 0x54, 0x4D, 0x5F, 0xE3, 0x7D, 0x17, 0x00, 0x00, 0x00, 0x08, 0x46, 0x46, 0x54, 0x4D, 0x5F, 0xE3, 0x7D, 0x17,

View File

@@ -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) /* 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 */ 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, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x30, 0x30, 0x00, 0x00, 0x01, 0x00,
0x20, 0x00, 0xA8, 0x25, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x00, 0xA8, 0x25, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x20, 0x20,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xA8, 0x10, 0x00, 0x00, 0xDE, 0x25, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xA8, 0x10, 0x00, 0x00, 0xDE, 0x25,