diff --git a/.vs/Cheat-Menu/FileContentIndex/90a937da-dd25-4b1a-8230-c47648cb9def.vsidx b/.vs/Cheat-Menu/FileContentIndex/90a937da-dd25-4b1a-8230-c47648cb9def.vsidx new file mode 100644 index 0000000..af3d021 Binary files /dev/null and b/.vs/Cheat-Menu/FileContentIndex/90a937da-dd25-4b1a-8230-c47648cb9def.vsidx differ diff --git a/.vs/Cheat-Menu/v17/.wsuo b/.vs/Cheat-Menu/v17/.wsuo new file mode 100644 index 0000000..5c44eb0 Binary files /dev/null and b/.vs/Cheat-Menu/v17/.wsuo differ diff --git a/.vs/Cheat-Menu/v17/Browse.VC.db b/.vs/Cheat-Menu/v17/Browse.VC.db new file mode 100644 index 0000000..7a7aaeb Binary files /dev/null and b/.vs/Cheat-Menu/v17/Browse.VC.db differ diff --git a/.vs/Cheat-Menu/v17/DocumentLayout.json b/.vs/Cheat-Menu/v17/DocumentLayout.json new file mode 100644 index 0000000..faf6025 --- /dev/null +++ b/.vs/Cheat-Menu/v17/DocumentLayout.json @@ -0,0 +1,47 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\Users\\kelson\\Documents\\git\\gta_stuff\\Cheat-Menu\\", + "Documents": [], + "DocumentGroupContainers": [ + { + "Orientation": 1, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedHeight": 200, + "SelectedChildIndex": -1, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:130:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{6324226f-61b6-4f28-92ee-18d4b5fe1e48}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{a80febb4-e7e0-4147-b476-21aaf2453969}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..0cf5ea5 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": "No Configurations" +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..6b61141 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,6 @@ +{ + "ExpandedNodes": [ + "" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..22512de Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/src/custom/randomcheats_sa.cpp b/src/custom/randomcheats_sa.cpp index 1517fc9..1c5259b 100644 --- a/src/custom/randomcheats_sa.cpp +++ b/src/custom/randomcheats_sa.cpp @@ -10,7 +10,7 @@ void RandomCheatsMgr::DrawPages() if ((timer - m_nTimer) > (static_cast(m_nInterval) * 1000)) { - int id = Random(0, 91); + int id = Random(uint(0), uint(91)); for (int i = 0; i < 92; i++) { diff --git a/src/custom/vehcustmzr.cpp b/src/custom/vehcustmzr.cpp index 552c684..62168a0 100644 --- a/src/custom/vehcustmzr.cpp +++ b/src/custom/vehcustmzr.cpp @@ -265,22 +265,22 @@ VehCustmzrMgr::VehCustmzrMgr() if (veh->m_nVehicleClass == CLASS_NORMAL) // Normal { - chance = Random(1, 20); + chance = Random(uint(1), uint(20)); } if (veh->m_nVehicleClass == CLASS_RICHFAMILY) // Rich family { - chance = Random(1, 4); + chance = Random(uint(1), uint(4)); } if (veh->m_nVehicleClass == CLASS_EXECUTIVE) // Executive { - chance = Random(1, 3); + chance = Random(uint(1), uint(3)); } if (chance == 1 && !Neon.IsInstalled(veh) && veh->m_pDriver != pPlayer) { - Neon.Install(veh, Random(0, 255), Random(0, 255), Random(0, 255)); + Neon.Install(veh, Random(uint(0), uint(255)), Random(uint(0), uint(255)), Random(uint(0), uint(255))); } } m_Neon.m_nTrafficTimer = timer; diff --git a/src/defines.h b/src/defines.h index 19c070a..7b560e5 100644 --- a/src/defines.h +++ b/src/defines.h @@ -9,8 +9,10 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "3.52" + #define MENU_VERSION MENU_VERSION_NUMBER #define MENU_TITLE MENU_NAME " v" MENU_VERSION +#define CUSTOM_CODE #ifdef GTASA #define BY_GAME(sa, vc, iii) sa diff --git a/src/interface/ipage.h b/src/interface/ipage.h index 9741a7c..e8d3432 100644 --- a/src/interface/ipage.h +++ b/src/interface/ipage.h @@ -14,6 +14,9 @@ enum class ePageID Visual, Menu, + // Added by kelson8 + //Test, + // Pages without headers Anniversary, Update, diff --git a/src/pages/game.cpp b/src/pages/game.cpp index 6a5ee1c..b7af396 100644 --- a/src/pages/game.cpp +++ b/src/pages/game.cpp @@ -43,13 +43,22 @@ GamePage& gamePage = GamePage::Get(); GamePage::GamePage() : IPage(ePageID::Game, "Window.GamePage", true) { + +#define _TEST #ifdef GTASA Events::drawMenuBackgroundEvent += []() { if (bSaveGameFlag) { + + // I don't think this'll work. +#ifdef _TEST + //FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_SAVE_WRITE_ASK; +#else FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE; +#endif + bSaveGameFlag = false; } }; @@ -178,14 +187,18 @@ void GamePage::Draw() CPlayerPed* pPlayer = FindPlayerPed(); int hplayer = CPools::GetPedRef(pPlayer); +#ifdef _DISABLED_CODE #ifdef GTASA if (ImGui::Button(TEXT("Game.SaveGame"), Widget::CalcSize())) { + FrontEndMenuManager.m_bActivateMenuNextFrame = true; bSaveGameFlag = true; + } ImGui::Spacing(); -#endif +#endif // GTASA +#endif //_DISABLED_CODE if (ImGui::BeginTabBar("Game", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { diff --git a/src/pages/player.cpp b/src/pages/player.cpp index 91045db..608740c 100644 --- a/src/pages/player.cpp +++ b/src/pages/player.cpp @@ -10,6 +10,10 @@ #include "custom/topdowncam_sa.h" #include "custom/customskins_sa.h" +#ifdef CUSTOM_CODE +#include "CExplosion.h" +#endif + static inline const char* clothNameList[18] = { "Shirts", "Heads", "Trousers", "Shoes", "Tattoos left lower arm", "Tattoos left upper arm", @@ -784,7 +788,24 @@ void PlayerPage::Draw() ImGui::Spacing(); ImGui::Separator(); + +#ifdef CUSTOM_CODE + + if (ImGui::CollapsingHeader(TEXT("Player.TestFeatures"))) { + if (ImGui::Button(TEXT("Player.Explosion"), Widget::CalcSize(3))) { + //CExplosion* explosion = new CExplosion(); + //CPlayerPed playerPed = FindPlayerPed(); + CVector playerCoords = FindPlayerCoors(-1); + + CExplosion::AddExplosion(FindPlayerPed(), FindPlayerPed(), EXPLOSION_CAR, playerCoords, 1000, true, 1.0f, true); + } + } + + ImGui::Spacing(); + ImGui::Separator(); +#endif //CUSTOM_CODE } + ImGui::EndChild(); ImGui::EndTabItem(); } @@ -863,5 +884,44 @@ void PlayerPage::Draw() } #endif ImGui::EndTabBar(); + + } + +#ifdef CUSTOM_CODE + + ImGui::Spacing(); + if (ImGui::BeginTabBar("TestTab", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { + if (ImGui::BeginTabItem(TEXT("TestTab.TestTab"))) { + + ImGui::Text("Hello from KCNet"); + + ImGui::Spacing(); + ImGui::Separator(); + + // I never did get this working yet. + if (ImGui::CollapsingHeader(TEXT("Player.TestFeatures"))) { + if (ImGui::Button(TEXT("Player.Explosion"), Widget::CalcSize(3))) { + //CExplosion* explosion = new CExplosion(); + //CPlayerPed playerPed = FindPlayerPed(); + + // This somewhat works but has no sound + CVector testCoords = CVector(2494.666016, -1672.507080, 13.335972); + // From teleport.cpp + // Couldn't get this working properly. + CPlayerPed* pPlayer = FindPlayerPed(); + + CVector playerCoords = pPlayer->GetPosition(); + // + + CExplosion::AddExplosion(FindPlayerPed(), FindPlayerPed(), EXPLOSION_CAR, testCoords, 1000, true, 1.0f, true); + } + } + + ImGui::EndTabItem(); + + } + ImGui::EndTabBar(); + } +#endif //CUSTOM_CODE } diff --git a/src/pages/vehicle.cpp b/src/pages/vehicle.cpp index 9ce9edd..b7a33e4 100644 --- a/src/pages/vehicle.cpp +++ b/src/pages/vehicle.cpp @@ -172,7 +172,7 @@ int VehiclePage::GetRandomTrainIdForModel(int model) Util::SetMessage("Invalid train model"); return -1; } - int id = Random(_start, _end); + int id = Random(uint(_start), uint(_end)); return train_ids[id]; } #elif GTAVC @@ -317,9 +317,9 @@ void VehiclePage::SpawnVehicle(std::string& smodel) CTrain* pTrain = nullptr; CTrain* carraige = nullptr; - int track = Random(0, 1); + int track = Random(uint(0), uint(1)); int node = CTrain::FindClosestTrackNode(pos, &track); - CTrain::CreateMissionTrain(pos, (Random(0, 1)) == 1 ? true : false, trainID, &pTrain, &carraige, node, track, false); + CTrain::CreateMissionTrain(pos, (Random(uint(0), uint(1))) == 1 ? true : false, trainID, &pTrain, &carraige, node, track, false); pVeh = (CVehicle*)pTrain; hVeh = CPools::GetVehicleRef(pVeh); @@ -374,7 +374,7 @@ void VehiclePage::SpawnVehicle(std::string& smodel) { for (int i = 0; i < 20; ++i) { - unsigned int compID = Random(1000, 1093); + unsigned int compID = Random(uint(1000), uint(1093)); if (VehCustmzr.IsSideskirtComponent(compID)) { diff --git a/src/utils/log.h b/src/utils/log.h index 7c21105..4a4e865 100644 --- a/src/utils/log.h +++ b/src/utils/log.h @@ -3,6 +3,8 @@ #include #include +//#define _TEST + enum class eLogLevel { Debug, @@ -46,7 +48,12 @@ public: #endif } AppendLogLevel(fmt); + +#define _TEST +#ifndef _TEST *pLog << std::vformat(fmt, std::make_format_args(std::forward(args)...)) << std::endl; +#endif //_TEST +#undef _TEST } template diff --git a/src/utils/rpc.cpp b/src/utils/rpc.cpp index de865f3..b44d7e1 100644 --- a/src/utils/rpc.cpp +++ b/src/utils/rpc.cpp @@ -74,7 +74,8 @@ void RPC::Process() } static std::string detailsText, stateText, smallImg, smallImgText, largeImg, largeImgText; - static size_t curImage = Random(1, 5); + /*static size_t curImage = Random(1, 5);*/ + static size_t curImage = Random(float (1), float (5)); static size_t timer = CTimer::m_snTimeInMilliseconds; CPlayerInfo *pInfo = &CWorld::Players[CWorld::PlayerInFocus];