Update paths & readme

This commit is contained in:
Grinch_ 2022-06-17 00:44:33 +06:00
parent 1802b17029
commit 6aca1cb99e
11 changed files with 1759 additions and 1759 deletions

View File

@ -40,7 +40,7 @@ If you have those mentioned versions installed follow the steps below,
Let me know if you mind more. Let me know if you mind more.
## Things to do on crash ## Things to do on crash
1. Delete the `CheatMenu/json/config.json` file and try again. 1. Delete the `CheatMenuXX.toml` config file and try again.
2. If it's happening after installing a recent mod try removing it. 2. If it's happening after installing a recent mod try removing it.
3. Try on a fresh installation of the game. 3. Try on a fresh installation of the game.
4. If still doesn't fix your issue, go ahead and report it. 4. If still doesn't fix your issue, go ahead and report it.
@ -80,7 +80,7 @@ You can either open a issue here or directly contact me on discord (Recommended)
## Submit Translations ## Submit Translations
*How to translate Cheat Menu to another language* *How to translate Cheat Menu to another language*
The translations are loaded from `CheatMenu/locale/*.json` files. Make a copy of the `English.json` file and translate the texts there to your language. Rename the file to `your_language.json` and make a pull request. The translations are loaded from `CheatMenuXX/locale/*.toml` files. Make a copy of the `English.toml` file and translate the texts there to your language. Rename the file to `your_language.toml` and make a pull request.
## Required to build ## Required to build
@ -99,7 +99,7 @@ All credits are given in Menu/About tab.
## How to add ___ to CheatMenu (SA Only) ## How to add ___ to CheatMenu (SA Only)
*Be careful about editing 'json' files, especially commas! Check [here](https://en.wikipedia.org/wiki/JSON). Use [Magic TXD](https://gtaforums.com/topic/851436-relopensrc-magictxd/) to open **.txd** files* *Use [Magic TXD](https://gtaforums.com/topic/851436-relopensrc-magictxd/) to open **.txd** files*
### Player Skins (Recommended) ### Player Skins (Recommended)
*If you just want more player skins without much hassel use this* *If you just want more player skins without much hassel use this*
@ -113,27 +113,27 @@ All credits are given in Menu/About tab.
*If you want to add both peds & skin then follow this* *If you want to add both peds & skin then follow this*
1. Add peds to your game following a tutorial. 1. Add peds to your game following a tutorial.
2. Then create a image of your ped and put it in *CheatMenu\peds.txd*. 2. Then create a image of your ped and put it in *CheatMenuXX\peds.txd*.
3. The image name should be the model name of the ped. 3. The image name should be the model name of the ped.
4. Open this file *CheatMenu\json\ped.json* and add an entry for your ped there. <br/> 4. Open this file *CheatMenuXX\data\peds.toml* and add an entry for your ped there. <br/>
**Format: "PedModel" : "PedName"** **Format: "PedModel" : "PedName"**
### Vehicles ### Vehicles
1. Add vehicles to your game following [this](https://www.mixmods.com.br/2015/12/tutorial-adicionar-carros-sem-substituir.html) tutorial first. (Use translator) 1. Add vehicles to your game following [this](https://www.mixmods.com.br/2015/12/tutorial-adicionar-carros-sem-substituir.html) tutorial first. (Use translator)
2. Then create an image of your vehicle in and put it in *CheatMenu\vehicles.txd*. 2. Then create an image of your vehicle in and put it in *CheatMenuXX\vehicles.txd*.
3. The image name should be the model id of the vehicle. 3. The image name should be the model id of the vehicle.
### Vehicle Tunes ### Vehicle Tunes
1. Add tunes to your game following a [tutorial](https://gtaforums.com/topic/481926-tutorial-how-to-add-tuning-parts/). 1. Add tunes to your game following a [tutorial](https://gtaforums.com/topic/481926-tutorial-how-to-add-tuning-parts/).
2. Then create a image of your tune part and put it in *CheatMenu\components.txd*. 2. Then create a image of your tune part and put it in *CheatMenuXX\components.txd*.
### Vehicle Paintjobs ### Vehicle Paintjobs
1. Put your paintjob images *CheatMenu\textures.txd. 1. Put your paintjob images *CheatMenuXX\textures.txd.
2. You can use any name for these images. 2. You can use any name for these images.
### Weapons ### Weapons
1. Add weapons to your game following [this](https://www.mixmods.com.br/2016/05/tutorial-adicionar-armas-sem-substituir.html) tutorial first. (Use translator) 1. Add weapons to your game following [this](https://www.mixmods.com.br/2016/05/tutorial-adicionar-armas-sem-substituir.html) tutorial first. (Use translator)
2. Then create an image of your vehicle and put it *CheatMenu\weapons.txd*. 2. Then create an image of your vehicle and put it *CheatMenuXX\weapons.txd*.
3. The image name should be the weapon id (not model!) of the weapon. 3. The image name should be the weapon id (not model!) of the weapon.
4. Open this file *CheatMenu\json\weapon.json* and add an entry for your weapon there.<br/> 4. Open this file *CheatMenuXX\data\weapons.toml* and add an entry for your weapon there.<br/>
**Format: "WeaponID" : "WeaponName"** **Format: "WeaponID" : "WeaponName"**

File diff suppressed because it is too large Load Diff

View File

@ -178,7 +178,7 @@ void Animation::_PlayAnimation(RpClump* pClump, int animGroup, int animID, float
#endif #endif
void Animation::PlayAnimation(std::string& root, std::string& anim, std::string& ifp) void Animation::PlayAnimation(std::string& ifp, std::string& anim, std::string& _)
{ {
CPed *pPed = m_PedAnim ? m_pTarget : FindPlayerPed(); CPed *pPed = m_PedAnim ? m_pTarget : FindPlayerPed();

View File

@ -198,7 +198,7 @@ void CheatMenu::GenHeaderList()
void CheatMenu::Init() void CheatMenu::Init()
{ {
if (!std::filesystem::exists(PLUGIN_PATH((char*)"CheatMenu"))) if (!std::filesystem::exists(PLUGIN_PATH((char*)FILE_NAME)))
{ {
Log::Print<eLogLevel::Error>(TEXT("Menu.CheatMenuNoDir")); Log::Print<eLogLevel::Error>(TEXT("Menu.CheatMenuNoDir"));
return; return;
@ -216,7 +216,7 @@ void CheatMenu::Init()
srand(CTimer::m_snTimeInMilliseconds); srand(CTimer::m_snTimeInMilliseconds);
ApplyStyle(); ApplyStyle();
Locale::Init("CheatMenu/locale/", "English", "English"); Locale::Init(FILE_NAME "/locale/", "English", "English");
GenHeaderList(); GenHeaderList();
// Init menu parts // Init menu parts

View File

@ -9,7 +9,7 @@ DataStore::DataStore(const char* fileName, bool isPathPredefined) noexcept
} }
else else
{ {
path = PLUGIN_PATH((char*)"/CheatMenu/data/") + std::string(fileName) + fileExt; path = PLUGIN_PATH((char*)FILE_NAME "/data/") + std::string(fileName) + fileExt;
} }
if (std::filesystem::exists(path)) if (std::filesystem::exists(path))

View File

@ -25,10 +25,11 @@ void MenuThread(void* param)
Had to put this in place since some people put the folder in root Had to put this in place since some people put the folder in root
directory and the asi in modloader. Why?? directory and the asi in modloader. Why??
*/ */
if (!std::filesystem::is_directory(PLUGIN_PATH((char*)"CheatMenu"))) if (!std::filesystem::is_directory(PLUGIN_PATH((char*)FILE_NAME)))
{ {
Log::Print<eLogLevel::Error>("CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory"); std::string msg = std::format("{} folder not found. You need to put both '{}.asi' & '{}' folder in the same directory", FILE_NAME, FILE_NAME, FILE_NAME);
MessageBox(NULL, "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory", "CheatMenu", MB_ICONERROR); Log::Print<eLogLevel::Error>(msg.c_str());
MessageBox(NULL, msg.c_str(), FILE_NAME, MB_ICONERROR);
return; return;
} }
@ -39,7 +40,7 @@ void MenuThread(void* param)
if (!GetModuleHandle(BY_GAME("SilentPatchSA.asi","SilentPatchVC.asi","SilentPatchIII.asi"))) if (!GetModuleHandle(BY_GAME("SilentPatchSA.asi","SilentPatchVC.asi","SilentPatchIII.asi")))
{ {
Log::Print<eLogLevel::Error>("SilentPatch not found. Please install it from here https://gtaforums.com/topic/669045-silentpatch/"); Log::Print<eLogLevel::Error>("SilentPatch not found. Please install it from here https://gtaforums.com/topic/669045-silentpatch/");
int msgID = MessageBox(NULL, "SilentPatch not found. Do you want to install Silent Patch? (Game restart required)", "CheatMenu", MB_OKCANCEL | MB_DEFBUTTON1); int msgID = MessageBox(NULL, "SilentPatch not found. Do you want to install Silent Patch? (Game restart required)", FILE_NAME, MB_OKCANCEL | MB_DEFBUTTON1);
if (msgID == IDOK) if (msgID == IDOK)
{ {
@ -55,16 +56,16 @@ void MenuThread(void* param)
#ifdef GTASA #ifdef GTASA
if (GetModuleHandle("SAMP.dll") || GetModuleHandle("SAMP.asi")) if (GetModuleHandle("SAMP.dll") || GetModuleHandle("SAMP.asi"))
{ {
Log::Print<eLogLevel::Error>("CheatMenu doesn't support SAMP"); Log::Print<eLogLevel::Error>(FILE_NAME " doesn't support SAMP");
MessageBox(NULL, "SAMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR); MessageBox(NULL, "SAMP detected. Exiting " FILE_NAME, FILE_NAME, MB_ICONERROR);
return; return;
} }
CFastman92limitAdjuster::Init(); CFastman92limitAdjuster::Init();
#elif GTAVC #elif GTAVC
if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi")) if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi"))
{ {
Log::Print<eLogLevel::Error>("CheatMenu doesn't support VCMP"); Log::Print<eLogLevel::Error>(FILE_NAME " doesn't support VCMP");
MessageBox(NULL, "VCMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR); MessageBox(NULL, "VCMP detected. Exiting " FILE_NAME, FILE_NAME, MB_ICONERROR);
return; return;
} }
#endif #endif
@ -108,7 +109,7 @@ BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved)
else else
{ {
Log::Print<eLogLevel::Error>("Unknown game version. GTA " BY_GAME("SA v1.0 US Hoodlum or Compact", "VC v1.0 EN", "III v1.0 EN") " is required."); Log::Print<eLogLevel::Error>("Unknown game version. GTA " BY_GAME("SA v1.0 US Hoodlum or Compact", "VC v1.0 EN", "III v1.0 EN") " is required.");
MessageBox(HWND_DESKTOP, "Unknown game version. GTA " BY_GAME("SA v1.0 US Hoodlum or Compact", "VC v1.0 EN", "III v1.0 EN") " is required.", "CheatMenu", MB_ICONERROR); MessageBox(HWND_DESKTOP, "Unknown game version. GTA " BY_GAME("SA v1.0 US Hoodlum or Compact", "VC v1.0 EN", "III v1.0 EN") " is required.", FILE_NAME, MB_ICONERROR);
} }
} }

View File

@ -18,7 +18,7 @@ ImFont* FontMgr::Load(const char* fontName, float fontMul)
{ {
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
size_t fontSize = static_cast<int>(screen::GetScreenHeight() / 54.85f) * fontMul; size_t fontSize = static_cast<int>(screen::GetScreenHeight() / 54.85f) * fontMul;
std::string fullPath = std::format("{}{}.ttf", PLUGIN_PATH((char*)"CheatMenu/fonts/"), fontName); std::string fullPath = std::format("{}{}.ttf", PLUGIN_PATH((char*)FILE_NAME "/fonts/"), fontName);
ImFont *pFont = io.Fonts->AddFontFromFileTTF(fullPath.c_str(), fontSize); ImFont *pFont = io.Fonts->AddFontFromFileTTF(fullPath.c_str(), fontSize);
m_vecFonts.push_back({pFont, fontSize, fontMul, std::string(fontName)}); m_vecFonts.push_back({pFont, fontSize, fontMul, std::string(fontName)});
@ -40,7 +40,7 @@ void FontMgr::ReloadAll()
for (auto &data : m_vecFonts) for (auto &data : m_vecFonts)
{ {
size_t fontSize = static_cast<int>(screen::GetScreenHeight() / 54.85f) * data.m_fMul; size_t fontSize = static_cast<int>(screen::GetScreenHeight() / 54.85f) * data.m_fMul;
std::string fullPath = PLUGIN_PATH((char*)"CheatMenu/fonts/") + data.m_path + ".ttf"; std::string fullPath = PLUGIN_PATH((char*)FILE_NAME "/fonts/") + data.m_path + ".ttf";
data.m_pFont = io.Fonts->AddFontFromFileTTF(fullPath.c_str(), data.m_nSize); data.m_pFont = io.Fonts->AddFontFromFileTTF(fullPath.c_str(), data.m_nSize);
} }
io.FontDefault = Get("text"); io.FontDefault = Get("text");

View File

@ -52,7 +52,7 @@ RwTexDictionary* LoadTexDictionary(char const* filename) {
void ResourceStore::LoadTextureResource(std::string&& name) void ResourceStore::LoadTextureResource(std::string&& name)
{ {
std::string fullPath = PLUGIN_PATH((char*)"CheatMenu\\") + name + ".txd"; std::string fullPath = PLUGIN_PATH((char*)FILE_NAME "\\") + name + ".txd";
if (!std::filesystem::exists(fullPath)) if (!std::filesystem::exists(fullPath))
{ {

View File

@ -28,7 +28,7 @@ void RPC::Shutdown()
void RPC::Init() void RPC::Init()
{ {
const char* dllPath = PLUGIN_PATH((char*)"CheatMenu/dlls/discord-rpc.dll"); const char* dllPath = PLUGIN_PATH((char*)FILE_NAME "/dlls/discord-rpc.dll");
// check if the dll exits // check if the dll exits
if (!std::filesystem::exists(dllPath)) if (!std::filesystem::exists(dllPath))

View File

@ -37,7 +37,7 @@ void Updater::Process()
} }
const char* link = "https://api.github.com/repos/user-grinch/Cheat-Menu/tags"; const char* link = "https://api.github.com/repos/user-grinch/Cheat-Menu/tags";
char* path = PLUGIN_PATH((char*)"CheatMenu/data/versioninfo.json"); char* path = PLUGIN_PATH((char*)FILE_NAME "/data/versioninfo.json");
HRESULT res = URLDownloadToFile(NULL, link, path, 0, NULL); HRESULT res = URLDownloadToFile(NULL, link, path, 0, NULL);
if (res == E_OUTOFMEMORY || res == INET_E_DOWNLOAD_FAILURE) if (res == E_OUTOFMEMORY || res == INET_E_DOWNLOAD_FAILURE)

View File

@ -34,13 +34,9 @@ rd /S /Q %archivePath% /Q
@REM Copy the files to a temp folder @REM Copy the files to a temp folder
@REM straight xcopy doesn't seem to work on my system, broken registry? @REM straight xcopy doesn't seem to work on my system, broken registry?
%systemroot%\System32\xcopy /s %asiPath% "pack\" /K /D /H /Y xcopy /s %asiPath% "pack\" /K /D /H /Y
%systemroot%\System32\xcopy /s %folderpath% "pack\CheatMenu\" /K /D /H /Y xcopy /s %folderpath% "pack\%~1\" /K /D /H /Y
%systemroot%\System32\xcopy /s "..\resource\common\" "pack\CheatMenu\" /K /D /H /Y xcopy /s "..\resource\common\" "pack\%~1\" /K /D /H /Y
@REM Remove the config and versioninfo files since we don't want to distribute them
del "pack\CheatMenu\json\config.json" /Q
del "pack\CheatMenu\json\versioninfo.json" /Q
@REM Guessing we have 7zip installed already, well I have @REM Guessing we have 7zip installed already, well I have
"C:\Program Files\7-Zip\7z.exe" a -t7z %archivePath% ".\pack\*" "C:\Program Files\7-Zip\7z.exe" a -t7z %archivePath% ".\pack\*"