Add compact exe support, fix VC & 3 build errors
This commit is contained in:
parent
42677147f1
commit
34c50c0f6e
@ -41,7 +41,7 @@ Let me know if you mind more.
|
||||
|
||||
## Things to do on crash
|
||||
1. Delete the `CheatMenu/json/config.json` file and try again.
|
||||
2. If it's happening after installing a recent mod try removing it. A list of incompatibile mods are [here](https://github.com/user-grinch/Cheat-Menu/issues/48).
|
||||
2. If it's happening after installing a recent mod try removing it.
|
||||
3. Try on a fresh installation of the game.
|
||||
4. If still doesn't fix your issue, go ahead and report it.
|
||||
|
||||
|
@ -82,7 +82,13 @@ BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved)
|
||||
{
|
||||
if (nReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
if (GetGameVersion() == BY_GAME(GAME_10US_HOODLUM, GAME_10EN, GAME_10EN))
|
||||
uint gameVer = GetGameVersion();
|
||||
|
||||
#ifdef GTASA
|
||||
if (gameVer == GAME_10US_HOODLUM || gameVer == GAME_10US_COMPACT)
|
||||
#else
|
||||
if (gameVer == BY_GAME(NULL, GAME_10EN, GAME_10EN))
|
||||
#endif
|
||||
{
|
||||
CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)&MenuThread, nullptr, NULL, nullptr);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "filehandler.h"
|
||||
|
||||
// TODO: Clean up this mess, use structures instead?
|
||||
#ifdef GTASA
|
||||
void FileHandler::GenerateHandlingFile(tHandlingData *pHandling, std::map<int, std::string>& storeMap)
|
||||
{
|
||||
FILE* fp = fopen("handling.txt", "w");
|
||||
@ -57,6 +57,58 @@ void FileHandler::GenerateHandlingFile(tHandlingData *pHandling, std::map<int, s
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void FileHandler::FetchHandlingID(std::map<int, std::string>& storeMap)
|
||||
{
|
||||
std::string m_FilePath = GAME_PATH((char*)"/data/vehicles.ide");
|
||||
if (!std::filesystem::exists(m_FilePath))
|
||||
{
|
||||
gLog << "Vehicle.ide not found";
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream file(m_FilePath);
|
||||
std::string line;
|
||||
while (getline(file, line))
|
||||
{
|
||||
/*
|
||||
Format: model, modelname, txdname, type, handlingId, ...
|
||||
Skip if first thing isn't model id
|
||||
*/
|
||||
if (line[0] <= '0' || line[0] >= '9')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// running inside try block to handle user errors, mostly commas
|
||||
try
|
||||
{
|
||||
std::string temp;
|
||||
std::stringstream ss(line);
|
||||
|
||||
// get model
|
||||
getline(ss, temp, ',');
|
||||
int model = std::stoi(temp);
|
||||
|
||||
// get modelname, txd, type, handlingId
|
||||
getline(ss, temp, ',');
|
||||
getline(ss, temp, ',');
|
||||
getline(ss, temp, ',');
|
||||
getline(ss, temp, ',');
|
||||
|
||||
temp.erase(std::remove_if(temp.begin(), temp.end(), isspace), temp.end());
|
||||
|
||||
storeMap[model] = temp;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
gLog << "Error parsing vehicles.ide, " << line << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
void FileHandler::FetchColorData(std::vector<std::vector<float>>& storeVec)
|
||||
{
|
||||
std::string m_FilePath = GAME_PATH((char*)"/data/carcols.dat");
|
||||
@ -130,54 +182,3 @@ void FileHandler::FetchColorData(std::vector<std::vector<float>>& storeVec)
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
void FileHandler::FetchHandlingID(std::map<int, std::string>& storeMap)
|
||||
{
|
||||
std::string m_FilePath = GAME_PATH((char*)"/data/vehicles.ide");
|
||||
if (!std::filesystem::exists(m_FilePath))
|
||||
{
|
||||
gLog << "Vehicle.ide not found";
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream file(m_FilePath);
|
||||
std::string line;
|
||||
while (getline(file, line))
|
||||
{
|
||||
/*
|
||||
Format: model, modelname, txdname, type, handlingId, ...
|
||||
Skip if first thing isn't model id
|
||||
*/
|
||||
if (line[0] <= '0' || line[0] >= '9')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// running inside try block to handle user errors, mostly commas
|
||||
try
|
||||
{
|
||||
std::string temp;
|
||||
std::stringstream ss(line);
|
||||
|
||||
// get model
|
||||
getline(ss, temp, ',');
|
||||
int model = std::stoi(temp);
|
||||
|
||||
// get modelname, txd, type, handlingId
|
||||
getline(ss, temp, ',');
|
||||
getline(ss, temp, ',');
|
||||
getline(ss, temp, ',');
|
||||
getline(ss, temp, ',');
|
||||
|
||||
temp.erase(std::remove_if(temp.begin(), temp.end(), isspace), temp.end());
|
||||
|
||||
storeMap[model] = temp;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
gLog << "Error parsing vehicles.ide, " << line << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
@ -17,11 +17,14 @@ public:
|
||||
TODO: Implement something that also parses modloader data
|
||||
*/
|
||||
static void FetchColorData(std::vector<std::vector<float>>& storeVec);
|
||||
|
||||
#ifdef GTASA
|
||||
/*
|
||||
Parses data/vehicles.ide file and stores handingId in a map
|
||||
TODO: Implement something that also parses modloader data
|
||||
*/
|
||||
static void FetchHandlingID(std::map<int, std::string>& storeMap);
|
||||
static void GenerateHandlingFile(tHandlingData *pHandling, std::map<int, std::string>& storeMap);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user