reworked features

This commit is contained in:
Bennett Staley
2024-01-26 18:32:28 -06:00
parent 6b548a4756
commit 95f0186c75
4 changed files with 85 additions and 61 deletions

View File

@ -265,69 +265,20 @@ namespace DX11_Base {
}
}
if (ImGui::Button("Give x2 first item", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20)))
ImGui::InputInt("Slot to modify (start 0):", &Config.AddItemSlot);
ImGui::InputInt("Multiple of how much:", &Config.AddItemCount);
// this does not work lol
// std::stringstream AddItemsString;
// AddItemsString << "Give " << Config.AddItemCount << " items from slot" << Config.AddItemSlot;
if (ImGui::Button("Give items from slot", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20)))
{
SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter();
if (p_appc != NULL)
{
if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL)
{
if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL)
{
SDK::UPalPlayerInventoryData* InventoryData = Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->GetInventoryData();
if (InventoryData != NULL) {
SDK::UPalItemContainerMultiHelper* InventoryMultiHelper = InventoryData->InventoryMultiHelper;
if (InventoryMultiHelper != NULL) {
SDK::TArray<class SDK::UPalItemContainer*> Containers = InventoryMultiHelper->Containers;
if (Containers.Num() == 0) {
return;
}
SDK::UPalItemSlot* FirstSlot = Containers[0]->Get(0);
if (FirstSlot != NULL)
{
SDK::FPalItemId FirstItemId = FirstSlot->GetItemId();
int32 StackCount = FirstSlot->GetStackCount();
InventoryData->RequestAddItem(FirstItemId.StaticId, StackCount * 2, true);
}
}
}
}
}
}
AddToInventoryContainer(Config.AddItemCount, Config.AddItemSlot);
}
if (ImGui::Button("All Effigies", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20)))
if (ImGui::Button("Unlock All Effigies", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20)))
{
SDK::APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter();
if (!pPalCharacter)
return;
SDK::UWorld* world = Config.GetUWorld();
if (!world)
return;
SDK::TUObjectArray* objects = world->GObjects;
for (int i = 0; i < objects->NumElements; ++i) {
SDK::UObject* object = objects->GetByIndex(i);
if (!object) {
continue;
}
if (!object->IsA(SDK::APalLevelObjectRelic::StaticClass())) {
continue;
}
SDK::APalLevelObjectObtainable* relic = (SDK::APalLevelObjectObtainable*)object;
if (!relic) {
continue;
}
((SDK::APalPlayerState*)pPalCharacter->PlayerState)->RequestObtainLevelObject_ToServer(relic);
}
UnlockAllEffigies();
}
////ImGui::InputText("Pal Name", Config.PalName, sizeof(Config.PalName));