Make this build on SA for me and some minor changes.

This commit is contained in:
kelson8 2024-06-14 11:08:41 -04:00
parent 1dda6ac05e
commit 55272845e6
Signed by: kelson8
GPG Key ID: 3D738D9DD7239E13
16 changed files with 153 additions and 11 deletions

BIN
.vs/Cheat-Menu/v17/.wsuo Normal file

Binary file not shown.

Binary file not shown.

View File

@ -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}"
}
]
}
]
}
]
}

3
.vs/ProjectSettings.json Normal file
View File

@ -0,0 +1,3 @@
{
"CurrentProjectSetting": "No Configurations"
}

View File

@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}

BIN
.vs/slnx.sqlite Normal file

Binary file not shown.

View File

@ -10,7 +10,7 @@ void RandomCheatsMgr::DrawPages()
if ((timer - m_nTimer) > (static_cast<uint>(m_nInterval) * 1000)) if ((timer - m_nTimer) > (static_cast<uint>(m_nInterval) * 1000))
{ {
int id = Random(0, 91); int id = Random(uint(0), uint(91));
for (int i = 0; i < 92; i++) for (int i = 0; i < 92; i++)
{ {

View File

@ -265,22 +265,22 @@ VehCustmzrMgr::VehCustmzrMgr()
if (veh->m_nVehicleClass == CLASS_NORMAL) // Normal 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 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 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) 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; m_Neon.m_nTrafficTimer = timer;

View File

@ -9,8 +9,10 @@
#define MENU_NAME "Cheat Menu" #define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "3.52" #define MENU_VERSION_NUMBER "3.52"
#define MENU_VERSION MENU_VERSION_NUMBER #define MENU_VERSION MENU_VERSION_NUMBER
#define MENU_TITLE MENU_NAME " v" MENU_VERSION #define MENU_TITLE MENU_NAME " v" MENU_VERSION
#define CUSTOM_CODE
#ifdef GTASA #ifdef GTASA
#define BY_GAME(sa, vc, iii) sa #define BY_GAME(sa, vc, iii) sa

View File

@ -14,6 +14,9 @@ enum class ePageID
Visual, Visual,
Menu, Menu,
// Added by kelson8
//Test,
// Pages without headers // Pages without headers
Anniversary, Anniversary,
Update, Update,

View File

@ -43,13 +43,22 @@ GamePage& gamePage = GamePage::Get();
GamePage::GamePage() GamePage::GamePage()
: IPage<GamePage>(ePageID::Game, "Window.GamePage", true) : IPage<GamePage>(ePageID::Game, "Window.GamePage", true)
{ {
#define _TEST
#ifdef GTASA #ifdef GTASA
Events::drawMenuBackgroundEvent += []() Events::drawMenuBackgroundEvent += []()
{ {
if (bSaveGameFlag) 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; FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE;
#endif
bSaveGameFlag = false; bSaveGameFlag = false;
} }
}; };
@ -178,14 +187,18 @@ void GamePage::Draw()
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
int hplayer = CPools::GetPedRef(pPlayer); int hplayer = CPools::GetPedRef(pPlayer);
#ifdef _DISABLED_CODE
#ifdef GTASA #ifdef GTASA
if (ImGui::Button(TEXT("Game.SaveGame"), Widget::CalcSize())) if (ImGui::Button(TEXT("Game.SaveGame"), Widget::CalcSize()))
{ {
FrontEndMenuManager.m_bActivateMenuNextFrame = true; FrontEndMenuManager.m_bActivateMenuNextFrame = true;
bSaveGameFlag = true; bSaveGameFlag = true;
} }
ImGui::Spacing(); ImGui::Spacing();
#endif #endif // GTASA
#endif //_DISABLED_CODE
if (ImGui::BeginTabBar("Game", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) if (ImGui::BeginTabBar("Game", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
{ {

View File

@ -10,6 +10,10 @@
#include "custom/topdowncam_sa.h" #include "custom/topdowncam_sa.h"
#include "custom/customskins_sa.h" #include "custom/customskins_sa.h"
#ifdef CUSTOM_CODE
#include "CExplosion.h"
#endif
static inline const char* clothNameList[18] = static inline const char* clothNameList[18] =
{ {
"Shirts", "Heads", "Trousers", "Shoes", "Tattoos left lower arm", "Tattoos left upper arm", "Shirts", "Heads", "Trousers", "Shoes", "Tattoos left lower arm", "Tattoos left upper arm",
@ -784,7 +788,24 @@ void PlayerPage::Draw()
ImGui::Spacing(); ImGui::Spacing();
ImGui::Separator(); 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::EndChild();
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -863,5 +884,44 @@ void PlayerPage::Draw()
} }
#endif #endif
ImGui::EndTabBar(); 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
} }

View File

@ -172,7 +172,7 @@ int VehiclePage::GetRandomTrainIdForModel(int model)
Util::SetMessage("Invalid train model"); Util::SetMessage("Invalid train model");
return -1; return -1;
} }
int id = Random(_start, _end); int id = Random(uint(_start), uint(_end));
return train_ids[id]; return train_ids[id];
} }
#elif GTAVC #elif GTAVC
@ -317,9 +317,9 @@ void VehiclePage::SpawnVehicle(std::string& smodel)
CTrain* pTrain = nullptr; CTrain* pTrain = nullptr;
CTrain* carraige = nullptr; CTrain* carraige = nullptr;
int track = Random(0, 1); int track = Random(uint(0), uint(1));
int node = CTrain::FindClosestTrackNode(pos, &track); 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; pVeh = (CVehicle*)pTrain;
hVeh = CPools::GetVehicleRef(pVeh); hVeh = CPools::GetVehicleRef(pVeh);
@ -374,7 +374,7 @@ void VehiclePage::SpawnVehicle(std::string& smodel)
{ {
for (int i = 0; i < 20; ++i) 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)) if (VehCustmzr.IsSideskirtComponent(compID))
{ {

View File

@ -3,6 +3,8 @@
#include <fstream> #include <fstream>
#include <memory> #include <memory>
//#define _TEST
enum class eLogLevel enum class eLogLevel
{ {
Debug, Debug,
@ -46,7 +48,12 @@ public:
#endif #endif
} }
AppendLogLevel(fmt); AppendLogLevel(fmt);
#define _TEST
#ifndef _TEST
*pLog << std::vformat(fmt, std::make_format_args(std::forward<Args>(args)...)) << std::endl; *pLog << std::vformat(fmt, std::make_format_args(std::forward<Args>(args)...)) << std::endl;
#endif //_TEST
#undef _TEST
} }
template <eLogLevel T> template <eLogLevel T>

View File

@ -74,7 +74,8 @@ void RPC::Process()
} }
static std::string detailsText, stateText, smallImg, smallImgText, largeImg, largeImgText; 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; static size_t timer = CTimer::m_snTimeInMilliseconds;
CPlayerInfo *pInfo = &CWorld::Players[CWorld::PlayerInFocus]; CPlayerInfo *pInfo = &CWorld::Players[CWorld::PlayerInFocus];