Push teleport, menu & player (vc)

This commit is contained in:
Grinch_ 2021-08-06 21:53:18 +06:00
parent 880ceba2c4
commit 0a15765771
26 changed files with 516 additions and 296 deletions

View File

@ -0,0 +1,48 @@
{
"Special" :
{
"Alex Shrub" : "IGalscb",
"Lance 1" : "IGbuddy",
"Lance Cop" : "IGBudy2",
"Lance Beaten Up" : "IGBudy3",
"Candy Suxxx" : "IGCandy",
"Colonel Cortez" : "IGColon",
"Ricardo Diaz" : "IGDiaz",
"Dick (Lovefist)" : "IGDick",
"Gonzalez" : "IGGonz",
"Hilary" : "IGHlary",
"Hilary (Bank Mission)" : "IGHlry2",
"Jezz Torrent" : "IGJezz",
"Ken Rosenberg" : "IGKen",
"Mercedes" : "IGMerc",
"Mercedes (purple dress)" : "IGMerc2",
"Cam Jones" : "IGmike",
"Cam Jones (Bank Mission)" : "IGMike2",
"Percy (Lovefist)" : "IGPercy",
"Phil Cassidy" : "IGPhil",
"Phil (Injured)" : "IGphil2",
"Phil (Bank Mission)" : "IGPhil3",
"Sonny Forelli" : "IGSonny"
},
"Misc" :
{
"Fsfa" : "FSFA",
"Courier" : "COURIER",
"Chef" : "CHEF",
"Sgc" : "SGC",
"Psycho" : "PSYCHO",
"Striper" : "STRIPA"
},
"Player" :
{
"Tommy Default" : "Player",
"Tommy Suit Plain" : "Player2",
"Tommy Worker" : "Player3",
"Tommy Golfer" : "Player4",
"Tommy Cuban" : "Player5",
"Tommy Cop" : "Player6",
"Tommy Bank" : "Player7",
"Tommy Simple" : "Player8",
"Tommy Suit Stripe" : "Player9"
}
}

View File

@ -18,7 +18,7 @@ private:
inline static bool m_Loop; inline static bool m_Loop;
inline static bool m_bSecondary; inline static bool m_bSecondary;
inline static std::string m_nWalkingStyle = "default"; inline static std::string m_nWalkingStyle = "default";
inline static std::vector<std::string> m_FightingStyleList = {"Default", "Boxing", "Kung fu", "Kick Boxing", "Punch Kick"}; inline static std::vector<std::string> m_FightingStyleList = { "Default", "Boxing", "Kung fu", "Kick Boxing", "Punch Kick" };
inline static std::vector<std::string> m_WalkingStyleList = inline static std::vector<std::string> m_WalkingStyleList =
{ {
"default", "man", "shuffle", "oldman", "gang1", "gang2", "oldfatman", "default", "man", "shuffle", "oldman", "gang1", "gang2", "oldfatman",

View File

@ -9,11 +9,11 @@ void CheatMenu::DrawWindow()
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
static bool bRunning = true; static bool bRunning = true;
#ifdef GTASA #ifdef GTASA
if (FrontEndMenuManager.m_bMenuActive) if (FrontEndMenuManager.m_bMenuActive)
#elif GTAVC #elif GTAVC
if (FrontendMenuManager.m_bMenuVisible) if (FrontendMenuManager.m_bMenuVisible)
#endif #endif
{ {
if (bRunning) if (bRunning)
{ {
@ -25,11 +25,11 @@ void CheatMenu::DrawWindow()
else else
{ {
bRunning = true; bRunning = true;
#ifdef GTASA #ifdef GTASA
if (Globals::m_bShowMenu || m_Commands::m_bShowMenu) if (Globals::m_bShowMenu || m_Commands::m_bShowMenu)
#elif GTAVC #elif GTAVC
if (Globals::m_bShowMenu) if (Globals::m_bShowMenu)
#endif #endif
{ {
if (Globals::m_bShowMenu) if (Globals::m_bShowMenu)
{ {
@ -53,12 +53,12 @@ void CheatMenu::DrawWindow()
ImGui::End(); ImGui::End();
} }
} }
#ifdef GTASA #ifdef GTASA
else else
{ {
DrawShortcutsWindow(); DrawShortcutsWindow();
} }
#endif #endif
} }
} }
DrawOverlay(); DrawOverlay();
@ -78,11 +78,11 @@ CheatMenu::CheatMenu()
Events::processScriptsEvent += []() Events::processScriptsEvent += []()
{ {
if (Globals::m_bInit && if (Globals::m_bInit &&
#ifdef GTASA #ifdef GTASA
!FrontEndMenuManager.m_bMenuActive !FrontEndMenuManager.m_bMenuActive
#elif GTAVC #elif GTAVC
!FrontendMenuManager.m_bMenuVisible !FrontendMenuManager.m_bMenuVisible
#endif #endif
) )
{ {
if (Ui::HotKeyPressed(Menu::m_HotKeys::menuOpen)) if (Ui::HotKeyPressed(Menu::m_HotKeys::menuOpen))
@ -196,11 +196,11 @@ void MenuThread(void* param)
} }
static bool bGameInit = false; static bool bGameInit = false;
#ifdef GTASA #ifdef GTASA
Hook::ApplyMouseFix(); Hook::ApplyMouseFix();
#endif #endif
// Wait till the game is initialized // Wait till the game is initialized
Events::initRwEvent += [] Events::initRwEvent += []
{ {
bGameInit = true; bGameInit = true;
@ -244,7 +244,7 @@ BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved)
if (nReason == DLL_PROCESS_ATTACH) if (nReason == DLL_PROCESS_ATTACH)
{ {
uint gameVersion = GetGameVersion(); uint gameVersion = GetGameVersion();
#ifdef GTASA #ifdef GTASA
if (gameVersion == GAME_10US_HOODLUM || gameVersion == GAME_10US_COMPACT) if (gameVersion == GAME_10US_HOODLUM || gameVersion == GAME_10US_COMPACT)
{ {
CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)&MenuThread, nullptr, NULL, nullptr); CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)&MenuThread, nullptr, NULL, nullptr);
@ -253,7 +253,7 @@ BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved)
{ {
MessageBox(HWND_DESKTOP, "Unknown game version. GTA SA v1.0 US is required.", "CheatMenu", MB_ICONERROR); MessageBox(HWND_DESKTOP, "Unknown game version. GTA SA v1.0 US is required.", "CheatMenu", MB_ICONERROR);
} }
#elif GTAVC #elif GTAVC
if (gameVersion == GAME_10EN) if (gameVersion == GAME_10EN)
{ {
CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)&MenuThread, nullptr, NULL, nullptr); CreateThread(nullptr, NULL, (LPTHREAD_START_ROUTINE)&MenuThread, nullptr, NULL, nullptr);
@ -262,7 +262,7 @@ BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved)
{ {
MessageBox(HWND_DESKTOP, "Unknown game version. GTA VC v1.0 EN is required.", "CheatMenu", MB_ICONERROR); MessageBox(HWND_DESKTOP, "Unknown game version. GTA VC v1.0 EN is required.", "CheatMenu", MB_ICONERROR);
} }
#endif #endif
} }
return TRUE; return TRUE;

View File

@ -12,35 +12,35 @@
#include "Hook.h" #include "Hook.h"
#include "Menu.h" #include "Menu.h"
#include "Teleport.h" #include "Teleport.h"
#include "Player.h"
#ifdef GTASA #ifdef GTASA
#include "Animation.h" #include "Animation.h"
#include "Game.h" #include "Game.h"
#include "Ped.h" #include "Ped.h"
#include "Player.h" #include "Vehicle.h"
#include "Vehicle.h" #include "Visual.h"
#include "Visual.h" #include "Weapon.h"
#include "Weapon.h" class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon
class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon
#elif defined(GTAVC) #elif defined(GTAVC)
class CheatMenu : Hook, Menu, Teleport class CheatMenu : Hook, Menu, Player, Teleport
#endif #endif
{ {
private: private:
#ifdef GTASA #ifdef GTASA
inline static CallbackTable header inline static CallbackTable header
{ {
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw}, {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw},
{"Animation", &Animation::Draw}, {"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, {"Animation", &Animation::Draw}, {"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw},
{"Game", &Game::Draw}, {"Visual", &Visual::Draw}, {"Menu", &Menu::Draw} {"Game", &Game::Draw}, {"Visual", &Visual::Draw}, {"Menu", &Menu::Draw}
}; };
#elif GTAVC #elif GTAVC
inline static CallbackTable header inline static CallbackTable header
{ {
{"Teleport", &Teleport::Draw}, {"Menu", &Menu::Draw} {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Menu", &Menu::Draw}
}; };
#endif #endif
static void ApplyStyle(); static void ApplyStyle();
static void DrawWindow(); static void DrawWindow();

View File

@ -329,7 +329,7 @@ void Game::Draw()
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
int hplayer = CPools::GetPedRef(pPlayer); int hplayer = CPools::GetPedRef(pPlayer);
if (ImGui::Button("Save game (might cause game bugs)",Ui::GetSize())) if (ImGui::Button("Save game (might cause game bugs)", Ui::GetSize()))
{ {
FrontEndMenuManager.m_bActivateMenuNextFrame = true; FrontEndMenuManager.m_bActivateMenuNextFrame = true;
bSaveGameFlag = true; bSaveGameFlag = true;

View File

@ -2,7 +2,7 @@
class Game class Game
{ {
public: public:
inline static SSearchData m_MissionData{"mission"}; inline static SSearchData m_MissionData{ "mission" };
inline static std::vector<std::string> m_DayNames = inline static std::vector<std::string> m_DayNames =
{ {
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"

View File

@ -9,9 +9,9 @@ LRESULT Hook::WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (ImGui::GetIO().WantTextInput) if (ImGui::GetIO().WantTextInput)
{ {
#ifdef GTASA #ifdef GTASA
Call<0x53F1E0>(); // CPad::ClearKeyboardHistory Call<0x53F1E0>(); // CPad::ClearKeyboardHistory
#endif #endif
return 1; return 1;
} }
@ -113,10 +113,10 @@ void Hook::RenderFrame(void* ptr)
ImGui_ImplWin32_Init(RsGlobal.ps->window); ImGui_ImplWin32_Init(RsGlobal.ps->window);
#ifdef GTASA #ifdef GTASA
// shift trigger fix // shift trigger fix
patch::Nop(0x00531155, 5); patch::Nop(0x00531155, 5);
#endif #endif
if (Globals::renderer == Render_DirectX9) if (Globals::renderer == Render_DirectX9)
{ {
@ -165,9 +165,9 @@ void Hook::ShowMouse(bool state)
ImGui::GetIO().MouseDrawCursor = state; ImGui::GetIO().MouseDrawCursor = state;
#ifdef GTASA #ifdef GTASA
Hook::ApplyMouseFix(); // Reapply the patches Hook::ApplyMouseFix(); // Reapply the patches
#elif GTAVC #elif GTAVC
if (m_bShowMouse) if (m_bShowMouse)
{ {
patch::SetUChar(0x6020A0, 0xC3); // psSetMousePos patch::SetUChar(0x6020A0, 0xC3); // psSetMousePos
@ -178,7 +178,7 @@ void Hook::ShowMouse(bool state)
patch::SetUChar(0x6020A0, 0x53); patch::SetUChar(0x6020A0, 0x53);
patch::SetRaw(0x4AB6CA, (char*)"\xE8\x51\x21\x00\x00", 5); patch::SetRaw(0x4AB6CA, (char*)"\xE8\x51\x21\x00\x00", 5);
} }
#endif #endif
CPad::NewMouseControllerState.X = 0; CPad::NewMouseControllerState.X = 0;
CPad::NewMouseControllerState.Y = 0; CPad::NewMouseControllerState.Y = 0;

View File

@ -27,9 +27,9 @@ public:
inline static bool m_bShowMouse = false; inline static bool m_bShowMouse = false;
inline static std::function<void()> windowCallback = nullptr; inline static std::function<void()> windowCallback = nullptr;
#ifdef GTASA #ifdef GTASA
static void ApplyMouseFix(); static void ApplyMouseFix();
#endif #endif
Hook(); Hook();
~Hook(); ~Hook();

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#define MENU_NAME "Cheat Menu" #define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "2.8" #define MENU_VERSION_NUMBER "2.9"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta" #define MENU_VERSION MENU_VERSION_NUMBER"-beta"
#define BUILD_NUMBER "20210801" #define BUILD_NUMBER "20210806"
#define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")" #define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")"

View File

@ -1,10 +1,12 @@
#include "pch.h" #include "pch.h"
#include "Player.h" #include "Player.h"
#include "Ped.h"
#include "Menu.h" #include "Menu.h"
#include "Ui.h" #include "Ui.h"
#include "Util.h" #include "Util.h"
#ifdef GTASA
#include "Ped.h"
// hardcoded cloth category names // hardcoded cloth category names
const char* cloth_category[18] = const char* cloth_category[18] =
{ {
@ -35,17 +37,23 @@ inline static void PlayerModelBrokenFix()
if (pPlayer->m_nModelIndex == 0) if (pPlayer->m_nModelIndex == 0)
Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false); Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false);
} }
#elif GTAVC
inline static SSearchData tempPedData{ "peds" };
#endif
Player::Player() Player::Player()
{ {
// Fix player model being broken after rebuild #ifdef GTASA
// Fix player model being broken after rebuild
patch::RedirectCall(0x5A834D, &PlayerModelBrokenFix); patch::RedirectCall(0x5A834D, &PlayerModelBrokenFix);
#endif
m_bAimSkinChanger = config.GetValue("aim_skin_changer", false); m_bAimSkinChanger = config.GetValue("aim_skin_changer", false);
// Custom skins setup // Custom skins setup
if (GetModuleHandle("modloader.asi")) if (GetModuleHandle("modloader.asi"))
{ {
#ifdef GTASA
if (fs::is_directory(m_CustomSkins::m_Path)) if (fs::is_directory(m_CustomSkins::m_Path))
{ {
for (auto& p : fs::recursive_directory_iterator(m_CustomSkins::m_Path)) for (auto& p : fs::recursive_directory_iterator(m_CustomSkins::m_Path))
@ -61,7 +69,11 @@ Player::Player()
} }
} }
} }
else fs::create_directory(m_CustomSkins::m_Path); else
{
fs::create_directory(m_CustomSkins::m_Path);
}
#endif
m_bModloaderInstalled = true; m_bModloaderInstalled = true;
} }
@ -69,17 +81,25 @@ Player::Player()
Events::processScriptsEvent += [] Events::processScriptsEvent += []
{ {
uint timer = CTimer::m_snTimeInMilliseconds; uint timer = CTimer::m_snTimeInMilliseconds;
static CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
int hplayer = CPools::GetPedRef(player);
if (!m_bImagesLoaded) if (!m_bImagesLoaded)
{ {
#ifdef GTASA
Util::LoadTextureDirectory(m_ClothData, PLUGIN_PATH((char*)"CheatMenu\\clothes.txd"), true); Util::LoadTextureDirectory(m_ClothData, PLUGIN_PATH((char*)"CheatMenu\\clothes.txd"), true);
#elif GTAVC
tempPedData.m_Json.LoadData(tempPedData.m_Categories, tempPedData.m_Selected);
#endif
m_bImagesLoaded = true; m_bImagesLoaded = true;
} }
if (m_KeepPosition::m_bEnabled) if (m_KeepPosition::m_bEnabled)
{ {
if (!player->IsAlive()) if (Command<Commands::IS_CHAR_DEAD>(hplayer))
{ {
m_KeepPosition::m_fPos = player->GetPosition(); m_KeepPosition::m_fPos = player->GetPosition();
} }
@ -90,7 +110,8 @@ Player::Player()
if (m_KeepPosition::m_fPos.x != 0 && m_KeepPosition::m_fPos.x != cur_pos.x if (m_KeepPosition::m_fPos.x != 0 && m_KeepPosition::m_fPos.x != cur_pos.x
&& m_KeepPosition::m_fPos.y != 0 && m_KeepPosition::m_fPos.y != cur_pos.y) && m_KeepPosition::m_fPos.y != 0 && m_KeepPosition::m_fPos.y != cur_pos.y)
{ {
player->Teleport(m_KeepPosition::m_fPos, false); BY_GAME(player->Teleport(m_KeepPosition::m_fPos, false)
, player->Teleport(m_KeepPosition::m_fPos));
m_KeepPosition::m_fPos = CVector(0, 0, 0); m_KeepPosition::m_fPos = CVector(0, 0, 0);
} }
} }
@ -98,36 +119,53 @@ Player::Player()
if (m_bGodMode) if (m_bGodMode)
{ {
#ifdef GTASA
patch::Set<bool>(0x96916D, 1, false); patch::Set<bool>(0x96916D, 1, false);
player->m_nPhysicalFlags.bBulletProof = 1; player->m_nPhysicalFlags.bBulletProof = 1;
player->m_nPhysicalFlags.bCollisionProof = 1; player->m_nPhysicalFlags.bCollisionProof = 1;
player->m_nPhysicalFlags.bExplosionProof = 1; player->m_nPhysicalFlags.bExplosionProof = 1;
player->m_nPhysicalFlags.bFireProof = 1; player->m_nPhysicalFlags.bFireProof = 1;
player->m_nPhysicalFlags.bMeeleProof = 1; player->m_nPhysicalFlags.bMeeleProof = 1;
#elif GTAVC
player->m_nFlags.bBulletProof = 1;
player->m_nFlags.bCollisionProof = 1;
player->m_nFlags.bExplosionProof = 1;
player->m_nFlags.bFireProof = 1;
player->m_nFlags.bMeleeProof = 1;
#endif
} }
#ifdef GTASA
if (m_bAimSkinChanger && Ui::HotKeyPressed(Menu::m_HotKeys::aimSkinChanger)) if (m_bAimSkinChanger && Ui::HotKeyPressed(Menu::m_HotKeys::aimSkinChanger))
{ {
CPed* target_ped = player->m_pPlayerTargettedPed; CPed* targetPed = player->m_pPlayerTargettedPed;
if (target_ped) if (targetPed)
{ {
player->SetModelIndex(target_ped->m_nModelIndex); player->SetModelIndex(targetPed->m_nModelIndex);
Util::ClearCharTasksVehCheck(player); Util::ClearCharTasksVehCheck(player);
} }
} }
#endif
if (Ui::HotKeyPressed(Menu::m_HotKeys::godMode)) if (Ui::HotKeyPressed(Menu::m_HotKeys::godMode))
{ {
if (m_bGodMode) if (m_bGodMode)
{ {
SetHelpMessage("God mode disabled", false, false, false); SetHelpMessage("God mode disabled", false, false, false);
#ifdef GTASA
patch::Set<bool>(0x96916D, m_bGodMode, false); patch::Set<bool>(0x96916D, m_bGodMode, false);
player->m_nPhysicalFlags.bBulletProof = false; player->m_nPhysicalFlags.bBulletProof = 0;
player->m_nPhysicalFlags.bCollisionProof = false; player->m_nPhysicalFlags.bCollisionProof = 0;
player->m_nPhysicalFlags.bExplosionProof = false; player->m_nPhysicalFlags.bExplosionProof = 0;
player->m_nPhysicalFlags.bFireProof = false; player->m_nPhysicalFlags.bFireProof = 0;
player->m_nPhysicalFlags.bMeeleProof = false; player->m_nPhysicalFlags.bMeeleProof = 0;
#elif GTAVC
player->m_nFlags.bBulletProof = 0;
player->m_nFlags.bCollisionProof = 0;
player->m_nFlags.bExplosionProof = 0;
player->m_nFlags.bFireProof = 0;
player->m_nFlags.bMeleeProof = 0;
#endif
m_bGodMode = false; m_bGodMode = false;
} }
else else
@ -139,6 +177,7 @@ Player::Player()
}; };
} }
#ifdef GTASA
void Player::ChangePlayerCloth(std::string& name) void Player::ChangePlayerCloth(std::string& name)
{ {
std::stringstream ss(name); std::stringstream ss(name);
@ -176,11 +215,14 @@ void Player::ChangePlayerCloth(std::string& name)
} }
CClothes::RebuildPlayer(player, false); CClothes::RebuildPlayer(player, false);
} }
#endif
#ifdef GTASA
void Player::ChangePlayerModel(std::string& model) void Player::ChangePlayerModel(std::string& model)
{ {
bool custom_skin = std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) != bool custom_skin = std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) !=
m_CustomSkins::m_List.end(); m_CustomSkins::m_List.end();
if (Ped::m_PedData.m_Json.m_Data.contains(model) || custom_skin) if (Ped::m_PedData.m_Json.m_Data.contains(model) || custom_skin)
{ {
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
@ -210,12 +252,24 @@ void Player::ChangePlayerModel(std::string& model)
} }
} }
} }
#elif GTAVC
void Player::ChangePlayerModel(std::string& cat, std::string& name, std::string& id)
{
CPlayerPed* player = FindPlayerPed();
player->Undress(id.c_str());
CStreaming::LoadAllRequestedModels(false);
player->Dress();
}
#endif
void Player::Draw() void Player::Draw()
{ {
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
int hplayer = CPools::GetPedRef(pPlayer); int hplayer = CPools::GetPedRef(pPlayer);
#ifdef GTASA
CPad* pad = pPlayer->GetPadFromPlayer(); CPad* pad = pPlayer->GetPadFromPlayer();
#endif
CPlayerInfo *pInfo = &CWorld::Players[CWorld::PlayerInFocus];
if (ImGui::Button("Copy coordinates", ImVec2(Ui::GetSize(2)))) if (ImGui::Button("Copy coordinates", ImVec2(Ui::GetSize(2))))
{ {
@ -227,7 +281,9 @@ void Player::Draw()
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Suicide", ImVec2(Ui::GetSize(2)))) if (ImGui::Button("Suicide", ImVec2(Ui::GetSize(2))))
{
pPlayer->m_fHealth = 0.0; pPlayer->m_fHealth = 0.0;
}
ImGui::Spacing(); ImGui::Spacing();
@ -241,36 +297,60 @@ void Player::Draw()
ImGui::Columns(2, 0, false); ImGui::Columns(2, 0, false);
#ifdef GTASA
Ui::CheckboxAddress("Bounty on yourself", 0x96913F); Ui::CheckboxAddress("Bounty on yourself", 0x96913F);
#endif
Ui::CheckboxAddress("Free healthcare", (int)&pInfo->m_bFreeHealthCare);
if (Ui::CheckboxWithHint("God mode", &m_bGodMode)) if (Ui::CheckboxWithHint("God mode", &m_bGodMode))
{ {
#ifdef GTASA
patch::Set<bool>(0x96916D, m_bGodMode, false); patch::Set<bool>(0x96916D, m_bGodMode, false);
pPlayer->m_nPhysicalFlags.bBulletProof = m_bGodMode; pPlayer->m_nPhysicalFlags.bBulletProof = m_bGodMode;
pPlayer->m_nPhysicalFlags.bCollisionProof = m_bGodMode; pPlayer->m_nPhysicalFlags.bCollisionProof = m_bGodMode;
pPlayer->m_nPhysicalFlags.bExplosionProof = m_bGodMode; pPlayer->m_nPhysicalFlags.bExplosionProof = m_bGodMode;
pPlayer->m_nPhysicalFlags.bFireProof = m_bGodMode; pPlayer->m_nPhysicalFlags.bFireProof = m_bGodMode;
pPlayer->m_nPhysicalFlags.bMeeleProof = m_bGodMode; pPlayer->m_nPhysicalFlags.bMeeleProof = m_bGodMode;
#elif GTAVC
pPlayer->m_nFlags.bBulletProof = m_bGodMode;
pPlayer->m_nFlags.bCollisionProof = m_bGodMode;
pPlayer->m_nFlags.bExplosionProof = m_bGodMode;
pPlayer->m_nFlags.bFireProof = m_bGodMode;
pPlayer->m_nFlags.bMeleeProof = m_bGodMode;
#endif
} }
#ifdef GTASA
Ui::CheckboxAddress("Higher cycle jumps", 0x969161); Ui::CheckboxAddress("Higher cycle jumps", 0x969161);
Ui::CheckboxAddress("Infinite oxygen", 0x96916E); Ui::CheckboxAddress("Infinite oxygen", 0x96916E);
Ui::CheckboxAddress("Infinite run", 0xB7CEE4); Ui::CheckboxAddress("Infinite run", 0xB7CEE4);
if (Ui::CheckboxBitFlag("Invisible player", pPlayer->m_nPedFlags.bDontRender)) if (Ui::CheckboxBitFlag("Invisible player", pPlayer->m_nPedFlags.bDontRender))
{
pPlayer->m_nPedFlags.bDontRender = (pPlayer->m_nPedFlags.bDontRender == 1) ? 0 : 1; pPlayer->m_nPedFlags.bDontRender = (pPlayer->m_nPedFlags.bDontRender == 1) ? 0 : 1;
}
#elif GTAVC
Ui::CheckboxAddress("Infinite run", (int)&pInfo->m_bNeverGetsTired);
#endif
ImGui::NextColumn(); ImGui::NextColumn();
Ui::CheckboxWithHint("Keep position", &m_KeepPosition::m_bEnabled, "Teleport to the position you died from"); Ui::CheckboxWithHint("Keep position", &m_KeepPosition::m_bEnabled, "Teleport to the position you died from");
#ifdef GTASA
if (Ui::CheckboxBitFlag("Lock control", pad->bPlayerSafe)) if (Ui::CheckboxBitFlag("Lock control", pad->bPlayerSafe))
{
pad->bPlayerSafe = (pad->bPlayerSafe == 1) ? 0 : 1; pad->bPlayerSafe = (pad->bPlayerSafe == 1) ? 0 : 1;
}
Ui::CheckboxAddress("Mega jump", 0x96916C); Ui::CheckboxAddress("Mega jump", 0x96916C);
Ui::CheckboxAddress("Mega punch", 0x969173); Ui::CheckboxAddress("Mega punch", 0x969173);
Ui::CheckboxAddress("Never get hungry", 0x969174); Ui::CheckboxAddress("Never get hungry", 0x969174);
bool never_wanted = patch::Get<bool>(0x969171, false); bool never_wanted = patch::Get<bool>(0x969171, false);
if (Ui::CheckboxWithHint("Never wanted", &never_wanted)) if (Ui::CheckboxWithHint("Never wanted", &never_wanted))
{
CCheat::NotWantedCheat(); CCheat::NotWantedCheat();
}
#endif
Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree);
ImGui::Columns(1); ImGui::Columns(1);
@ -279,27 +359,37 @@ void Player::Draw()
ImGui::Columns(2, 0, false); ImGui::Columns(2, 0, false);
bool state = pPlayer->m_nPhysicalFlags.bBulletProof; bool state = BY_GAME(pPlayer->m_nPhysicalFlags.bBulletProof, pPlayer->m_nFlags.bBulletProof);
if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bGodMode)) if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bGodMode))
pPlayer->m_nPhysicalFlags.bBulletProof = state; {
BY_GAME(pPlayer->m_nPhysicalFlags.bBulletProof, pPlayer->m_nFlags.bBulletProof) = state;
}
state = pPlayer->m_nPhysicalFlags.bCollisionProof; state = BY_GAME(pPlayer->m_nPhysicalFlags.bCollisionProof, pPlayer->m_nFlags.bCollisionProof);
if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bGodMode)) if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bGodMode))
pPlayer->m_nPhysicalFlags.bCollisionProof = state; {
BY_GAME(pPlayer->m_nPhysicalFlags.bCollisionProof, pPlayer->m_nFlags.bCollisionProof) = state;
}
state = pPlayer->m_nPhysicalFlags.bExplosionProof; state = BY_GAME(pPlayer->m_nPhysicalFlags.bExplosionProof, pPlayer->m_nFlags.bExplosionProof);
if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bGodMode)) if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bGodMode))
pPlayer->m_nPhysicalFlags.bExplosionProof = state; {
BY_GAME(pPlayer->m_nPhysicalFlags.bExplosionProof, pPlayer->m_nFlags.bExplosionProof) = state;
}
ImGui::NextColumn(); ImGui::NextColumn();
state = pPlayer->m_nPhysicalFlags.bFireProof; state = BY_GAME(pPlayer->m_nPhysicalFlags.bFireProof, pPlayer->m_nFlags.bFireProof);
if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bGodMode)) if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bGodMode))
pPlayer->m_nPhysicalFlags.bFireProof = state; {
BY_GAME(pPlayer->m_nPhysicalFlags.bFireProof, pPlayer->m_nFlags.bFireProof) = state;
}
state = pPlayer->m_nPhysicalFlags.bMeeleProof; state = BY_GAME(pPlayer->m_nPhysicalFlags.bMeeleProof, pPlayer->m_nFlags.bMeleeProof);
if (Ui::CheckboxWithHint("Meele proof", &state, nullptr, m_bGodMode)) if (Ui::CheckboxWithHint("Meele proof", &state, nullptr, m_bGodMode))
pPlayer->m_nPhysicalFlags.bMeeleProof = state; {
BY_GAME(pPlayer->m_nPhysicalFlags.bMeeleProof, pPlayer->m_nFlags.bMeleeProof) = state;
}
ImGui::EndChild(); ImGui::EndChild();
ImGui::EndTabItem(); ImGui::EndTabItem();
@ -310,6 +400,7 @@ void Player::Draw()
ImGui::BeginChild("PlayerMenus"); ImGui::BeginChild("PlayerMenus");
Ui::EditReference("Armour", pPlayer->m_fArmour, 0, 100, 150); Ui::EditReference("Armour", pPlayer->m_fArmour, 0, 100, 150);
#ifdef GTASA
if (ImGui::CollapsingHeader("Body")) if (ImGui::CollapsingHeader("Body"))
{ {
if (pPlayer->m_nModelIndex == 0) if (pPlayer->m_nModelIndex == 0)
@ -347,18 +438,35 @@ void Player::Draw()
Ui::EditStat("Energy", STAT_ENERGY); Ui::EditStat("Energy", STAT_ENERGY);
Ui::EditStat("Fat", STAT_FAT); Ui::EditStat("Fat", STAT_FAT);
Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100, static_cast<int>(pPlayer->m_fMaxHealth)); #endif
Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100, BY_GAME(static_cast<int>(pPlayer->m_fMaxHealth), 100));
#ifdef GTASA
Ui::EditStat("Lung capacity", STAT_LUNG_CAPACITY); Ui::EditStat("Lung capacity", STAT_LUNG_CAPACITY);
Ui::EditStat("Max health", STAT_MAX_HEALTH, 0, 569, 1450); Ui::EditStat("Max health", STAT_MAX_HEALTH, 0, 569, 1450);
Ui::EditAddress<int>("Money", 0xB7CE50, -99999999, 0, 99999999); Ui::EditAddress<int>("Money", 0xB7CE50, -99999999, 0, 99999999);
#elif GTAVC
int money = pInfo->m_nMoney;
Ui::EditAddress<int>("Money", (int)&money, -9999999, 0, 99999999);
pInfo->m_nMoney = money;
pInfo->m_nDisplayMoney = money;
#endif
#ifdef GTASA
Ui::EditStat("Muscle", STAT_MUSCLE); Ui::EditStat("Muscle", STAT_MUSCLE);
Ui::EditStat("Respect", STAT_RESPECT); Ui::EditStat("Respect", STAT_RESPECT);
Ui::EditStat("Stamina", STAT_STAMINA); Ui::EditStat("Stamina", STAT_STAMINA);
#endif
if (ImGui::CollapsingHeader("Wanted level")) if (ImGui::CollapsingHeader("Wanted level"))
{ {
#ifdef GTASA
int val = pPlayer->m_pPlayerData->m_pWanted->m_nWantedLevel; int val = pPlayer->m_pPlayerData->m_pWanted->m_nWantedLevel;
int max_wl = pPlayer->m_pPlayerData->m_pWanted->MaximumWantedLevel; int max_wl = pPlayer->m_pPlayerData->m_pWanted->MaximumWantedLevel;
max_wl = max_wl < 6 ? 6 : max_wl; max_wl = max_wl < 6 ? 6 : max_wl;
#elif GTAVC
int val = pPlayer->m_pWanted->m_nWantedLevel;
int max_wl = 6;
#endif
ImGui::Columns(3, 0, false); ImGui::Columns(3, 0, false);
ImGui::Text("Min: 0"); ImGui::Text("Min: 0");
@ -371,21 +479,45 @@ void Player::Draw()
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::InputInt("Set value##Wanted level", &val)) if (ImGui::InputInt("Set value##Wanted level", &val))
{
#ifdef GTASA
pPlayer->CheatWantedLevel(val); pPlayer->CheatWantedLevel(val);
#elif GTAVC
pPlayer->m_pWanted->CheatWantedLevel(val);
#endif
}
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button("Minimum##Wanted level", Ui::GetSize(3))) if (ImGui::Button("Minimum##Wanted level", Ui::GetSize(3)))
{
#ifdef GTASA
pPlayer->CheatWantedLevel(0); pPlayer->CheatWantedLevel(0);
#elif GTAVC
pPlayer->m_pWanted->CheatWantedLevel(0);
#endif
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Default##Wanted level", Ui::GetSize(3))) if (ImGui::Button("Default##Wanted level", Ui::GetSize(3)))
{
#ifdef GTASA
pPlayer->CheatWantedLevel(0); pPlayer->CheatWantedLevel(0);
#elif GTAVC
pPlayer->m_pWanted->CheatWantedLevel(0);
#endif
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Maximum##Wanted level", Ui::GetSize(3))) if (ImGui::Button("Maximum##Wanted level", Ui::GetSize(3)))
{
#ifdef GTASA
pPlayer->CheatWantedLevel(max_wl); pPlayer->CheatWantedLevel(max_wl);
#elif GTAVC
pPlayer->m_pWanted->CheatWantedLevel(max_wl);
#endif
}
ImGui::Spacing(); ImGui::Spacing();
ImGui::Separator(); ImGui::Separator();
@ -395,14 +527,15 @@ void Player::Draw()
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
#ifdef GTASA
if (ImGui::BeginTabItem("Appearance")) if (ImGui::BeginTabItem("Appearance"))
{ {
ImGui::Spacing(); ImGui::Spacing();
if (Ui::CheckboxWithHint("Aim skin changer", &m_bAimSkinChanger, if (Ui::CheckboxWithHint("Aim skin changer", &m_bAimSkinChanger,
(("Changes to the ped, player is targeting with a weapon.\nTo use aim a ped with a weapon and press ") (("Changes to the ped, player is targeting with a weapon.\nTo use aim a ped with a weapon and press ")
+ Ui::GetHotKeyNameString(Menu::m_HotKeys::aimSkinChanger)).c_str())) + Ui::GetHotKeyNameString(Menu::m_HotKeys::aimSkinChanger)).c_str()))
config.SetValue("aim_skin_changer", m_bAimSkinChanger); config.SetValue("aim_skin_changer", m_bAimSkinChanger);
if (ImGui::BeginTabBar("AppearanceTabBar")) if (ImGui::BeginTabBar("AppearanceTabBar"))
{ {
if (ImGui::BeginTabItem("Clothes")) if (ImGui::BeginTabItem("Clothes"))
@ -428,13 +561,13 @@ void Player::Draw()
getline(ss, temp, '$'); getline(ss, temp, '$');
return temp; return temp;
}, nullptr, cloth_category, sizeof(cloth_category)/ sizeof(const char*)); }, nullptr, cloth_category, sizeof(cloth_category) / sizeof(const char*));
} }
else else
{ {
size_t count = 0; size_t count = 0;
if(ImGui::Button("Remove all", ImVec2(Ui::GetSize(2)))) if (ImGui::Button("Remove all", ImVec2(Ui::GetSize(2))))
{ {
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
for (uint i = 0; i < 18; i++) for (uint i = 0; i < 18; i++)
@ -446,14 +579,14 @@ void Player::Draw()
ImGui::SameLine(); ImGui::SameLine();
for (const char* clothName : cloth_category) for (const char* clothName : cloth_category)
{ {
if(ImGui::Button(clothName, ImVec2(Ui::GetSize(2)))) if (ImGui::Button(clothName, ImVec2(Ui::GetSize(2))))
{ {
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(0u, 0u, count); player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(0u, 0u, count);
CClothes::RebuildPlayer(player, false); CClothes::RebuildPlayer(player, false);
} }
if (count %2 != 0) if (count % 2 != 0)
{ {
ImGui::SameLine(); ImGui::SameLine();
} }
@ -533,7 +666,16 @@ Limitations:\n\
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
#elif GTAVC
if (ImGui::BeginTabItem("Skins"))
{
ImGui::Spacing();
ImGui::Text("Info");
Ui::ShowTooltip("Not all ped skins work. I've added the ones that works!");
Ui::DrawJSON(tempPedData.m_Json, tempPedData.m_Categories, tempPedData.m_Selected, tempPedData.m_Filter, ChangePlayerModel, nullptr);
ImGui::EndTabItem();
}
#endif
ImGui::EndTabBar(); ImGui::EndTabBar();
} }
} }

View File

@ -1,11 +1,11 @@
#pragma once #pragma once
#include "pch.h"
class Player class Player
{ {
private: private:
inline static bool m_bGodMode; inline static bool m_bGodMode;
inline static int m_nUiBodyState;
inline static bool m_bAimSkinChanger; inline static bool m_bAimSkinChanger;
inline static SSearchData m_ClothData;
inline static bool m_bImagesLoaded; inline static bool m_bImagesLoaded;
inline static bool m_bModloaderInstalled; inline static bool m_bModloaderInstalled;
struct m_KeepPosition struct m_KeepPosition
@ -13,16 +13,29 @@ private:
inline static bool m_bEnabled = false; inline static bool m_bEnabled = false;
inline static CVector m_fPos; inline static CVector m_fPos;
}; };
#ifdef GTASA
inline static int m_nUiBodyState;
inline static SSearchData m_ClothData;
struct m_CustomSkins struct m_CustomSkins
{ {
inline static std::string m_Path = paths::GetGameDirPathA() + std::string("\\modloader\\Custom Skins\\");; inline static std::string m_Path = paths::GetGameDirPathA() + std::string("\\modloader\\Custom Skins\\");;
inline static ImGuiTextFilter m_Filter; inline static ImGuiTextFilter m_Filter;
inline static std::vector<std::string> m_List; inline static std::vector<std::string> m_List;
}; };
#endif
public: public:
Player(); Player();
static void ChangePlayerCloth(std::string& model);
#ifdef GTASA
static void ChangePlayerModel(std::string& model); static void ChangePlayerModel(std::string& model);
#elif GTAVC
static void ChangePlayerModel(std::string& cat, std::string& name, std::string& id);
#endif
static void Draw(); static void Draw();
#ifdef GTASA
static void ChangePlayerCloth(std::string& model);
#endif
}; };

View File

@ -51,7 +51,7 @@ Teleport::Teleport()
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
#ifdef GTASA #ifdef GTASA
CEntity* player_entity = FindPlayerEntity(); CEntity* player_entity = FindPlayerEntity(-1);
m_Teleport::m_fPos.z = CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y, m_Teleport::m_fPos.z = CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y,
m_Teleport::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f; m_Teleport::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f;
#elif GTAVC #elif GTAVC

View File

@ -8,29 +8,29 @@ private:
inline static bool m_bInsertCoord; inline static bool m_bInsertCoord;
inline static bool m_bQuickTeleport; inline static bool m_bQuickTeleport;
inline static char m_nInputBuffer[INPUT_BUFFER_SIZE]; inline static char m_nInputBuffer[INPUT_BUFFER_SIZE];
inline static SSearchData tp_data{"teleport"}; inline static SSearchData tp_data{ "teleport" };
inline static char m_nLocationBuffer[INPUT_BUFFER_SIZE]; inline static char m_nLocationBuffer[INPUT_BUFFER_SIZE];
inline static uint m_nQuickTeleportTimer; inline static uint m_nQuickTeleportTimer;
#ifdef GTASA #ifdef GTASA
inline static CJson m_SpriteJson = CJson("radar sprite"); inline static CJson m_SpriteJson = CJson("radar sprite");
#endif #endif
struct m_Teleport struct m_Teleport
{ {
inline static bool m_bEnabled; inline static bool m_bEnabled;
inline static CVector m_fPos = {-1, -1, -1}; inline static CVector m_fPos = { -1, -1, -1 };
inline static uint m_nTimer; inline static uint m_nTimer;
}; };
#ifdef GTASA #ifdef GTASA
/* /*
Generates radar sprite coordinates on the fly. Generates radar sprite coordinates on the fly.
Shouldn't get saved in 'teleport.json', needs to be cleared at game shutdown. Shouldn't get saved in 'teleport.json', needs to be cleared at game shutdown.
*/ */
static void FetchRadarSpriteData(); static void FetchRadarSpriteData();
#endif #endif
protected: protected:
Teleport(); Teleport();

View File

@ -45,7 +45,7 @@ bool Ui::ListBoxStr(const char* label, std::vector<std::string>& all_items, std:
bool Ui::ListBoxCustomNames(const char* label, std::vector<std::string>& all_items, std::string& selected, const char* custom_names[], size_t length) bool Ui::ListBoxCustomNames(const char* label, std::vector<std::string>& all_items, std::string& selected, const char* custom_names[], size_t length)
{ {
bool rtn = false; bool rtn = false;
std::string display_selected = (selected == "All") ? selected: custom_names[std::stoi(selected)]; std::string display_selected = (selected == "All") ? selected : custom_names[std::stoi(selected)];
if (ImGui::BeginCombo(label, display_selected.c_str())) if (ImGui::BeginCombo(label, display_selected.c_str()))
{ {
@ -540,8 +540,7 @@ void Ui::DrawImages(std::vector<std::unique_ptr<STextureStructure>>& img_vec, Im
} }
else else
{ {
IDirect3DTexture9* texture = (IDirect3DTexture9*)Util::GetTextureFromRaster(img_vec[i]->m_pRwTexture); if (ImGui::ImageButton(img_vec[i]->m_pTexture, image_size, ImVec2(0, 0), ImVec2(1, 1), 1, ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
if (ImGui::ImageButton(texture, image_size, ImVec2(0, 0), ImVec2(1, 1), 1, ImVec4(1, 1, 1, 1),ImVec4(1, 1, 1, 1)))
{ {
on_left_click(text); on_left_click(text);
} }

View File

@ -52,7 +52,7 @@ public:
ImGuiTextFilter& filter, ImGuiTextFilter& filter,
std::function<void(std::string&, std::string&, std::string&)> func_left_click, std::function<void(std::string&, std::string&, std::string&)> func_left_click,
std::function<void(std::string&, std::string&, std::string&)> func_right_click); std::function<void(std::string&, std::string&, std::string&)> func_right_click);
static void DrawImages( std::vector<std::unique_ptr<STextureStructure>>& img_vec, ImVec2 image_size, static void DrawImages(std::vector<std::unique_ptr<STextureStructure>>& img_vec, ImVec2 image_size,
std::vector<std::string>& category_vec, std::string& selected_item, ImGuiTextFilter& filter, std::vector<std::string>& category_vec, std::string& selected_item, ImGuiTextFilter& filter,
std::function<void(std::string&)> on_left_click, std::function<void(std::string&)> on_left_click,
std::function<void(std::string&)> on_right_click, std::function<void(std::string&)> on_right_click,
@ -69,9 +69,9 @@ public:
static void EditRadioButtonAddress(const char* label, std::vector<NamedMemory>& named_mem); static void EditRadioButtonAddress(const char* label, std::vector<NamedMemory>& named_mem);
static void EditRadioButtonAddressEx(const char* label, int addr, std::vector<NamedValue>& named_val); static void EditRadioButtonAddressEx(const char* label, int addr, std::vector<NamedValue>& named_val);
#ifdef GTASA #ifdef GTASA
static void EditStat(const char* label, int stat_id, int min = 0, int def = 0, int max = 1000); static void EditStat(const char* label, int stat_id, int min = 0, int def = 0, int max = 1000);
#endif #endif
static void FilterWithHint(const char* label, ImGuiTextFilter& filter, const char* hint); static void FilterWithHint(const char* label, ImGuiTextFilter& filter, const char* hint);

View File

@ -3,10 +3,11 @@
#include "psapi.h" #include "psapi.h"
#include "CFileLoader.h" #include "CFileLoader.h"
void Util::LoadTextureDirectory(SSearchData& data, char *path, bool pass_full_name) void Util::LoadTextureDirectory(SSearchData& data, char* path, bool pass_full_name)
{ {
RwTexDictionary* pRwTexDictionary = &data.txd; RwTexDictionary* pRwTexDictionary = &data.txd;
// allow SA textures for VC
pRwTexDictionary = CFileLoader::LoadTexDictionary(path); pRwTexDictionary = CFileLoader::LoadTexDictionary(path);
if (pRwTexDictionary) if (pRwTexDictionary)
@ -19,6 +20,7 @@ void Util::LoadTextureDirectory(SSearchData& data, char *path, bool pass_full_na
SSearchData* sdata = reinterpret_cast<SSearchData*>(data); SSearchData* sdata = reinterpret_cast<SSearchData*>(data);
sdata->m_ImagesList.push_back(std::make_unique<STextureStructure>()); sdata->m_ImagesList.push_back(std::make_unique<STextureStructure>());
sdata->m_ImagesList.back().get()->m_pRwTexture = tex; sdata->m_ImagesList.back().get()->m_pRwTexture = tex;
sdata->m_ImagesList.back().get()->m_pTexture = Util::GetTextureFromRaster(tex);
std::stringstream ss(tex->name); std::stringstream ss(tex->name);
std::string str; std::string str;
@ -41,6 +43,7 @@ void Util::LoadTextureDirectory(SSearchData& data, char *path, bool pass_full_na
SSearchData* sdata = reinterpret_cast<SSearchData*>(data); SSearchData* sdata = reinterpret_cast<SSearchData*>(data);
sdata->m_ImagesList.push_back(std::make_unique<STextureStructure>()); sdata->m_ImagesList.push_back(std::make_unique<STextureStructure>());
sdata->m_ImagesList.back().get()->m_pRwTexture = tex; sdata->m_ImagesList.back().get()->m_pRwTexture = tex;
sdata->m_ImagesList.back().get()->m_pTexture = Util::GetTextureFromRaster(tex);
std::stringstream ss(tex->name); std::stringstream ss(tex->name);
std::string str; std::string str;
@ -60,7 +63,8 @@ void Util::LoadTextureDirectory(SSearchData& data, char *path, bool pass_full_na
} }
} }
void* Util::GetTextureFromRaster(RwTexture *pTexture)
void* Util::GetTextureFromRaster(RwTexture* pTexture)
{ {
RwRasterEx* raster = (RwRasterEx*)(&pTexture->raster->parent); RwRasterEx* raster = (RwRasterEx*)(&pTexture->raster->parent);
@ -69,7 +73,7 @@ void* Util::GetTextureFromRaster(RwTexture *pTexture)
std::string Util::GetLocationName(CVector* pos) std::string Util::GetLocationName(CVector* pos)
{ {
#ifdef GTASA #ifdef GTASA
int hplayer = CPools::GetPedRef(FindPlayerPed()); int hplayer = CPools::GetPedRef(FindPlayerPed());
int interior = 0; int interior = 0;
@ -99,9 +103,9 @@ std::string Util::GetLocationName(CVector* pos)
return CTheZones::FindSmallestZoneForPosition(*pos, true)->GetTranslatedName() + std::string(", ") + town; return CTheZones::FindSmallestZoneForPosition(*pos, true)->GetTranslatedName() + std::string(", ") + town;
return std::string("Interior ") + std::to_string(interior) + ", " + town; return std::string("Interior ") + std::to_string(interior) + ", " + town;
#elif GTAVC #elif GTAVC
return "Vice City"; return "Vice City";
#endif #endif
} }
#ifdef GTASA #ifdef GTASA

View File

@ -12,14 +12,14 @@ class Util
{ {
public: public:
#ifdef GTASA #ifdef GTASA
static void ClearCharTasksVehCheck(CPed* ped); static void ClearCharTasksVehCheck(CPed* ped);
static CPed* GetClosestPed(); static CPed* GetClosestPed();
static CVehicle* GetClosestVehicle(); static CVehicle* GetClosestVehicle();
static int GetLargestGangInZone(); static int GetLargestGangInZone();
static bool IsOnCutscene(); static bool IsOnCutscene();
static RwTexture* LoadTextureFromMemory(char* data, unsigned int size); static RwTexture* LoadTextureFromMemory(char* data, unsigned int size);
#endif #endif
static std::string GetLocationName(CVector* pos); static std::string GetLocationName(CVector* pos);
static bool IsOnMission(); static bool IsOnMission();

View File

@ -329,7 +329,7 @@ void Vehicle::ParseCarcolsDAT()
getline(ss, temp, ','); getline(ss, temp, ',');
int blue = std::stoi(temp); int blue = std::stoi(temp);
std::vector<float> color = {red / 255.0f, green / 255.0f, blue / 255.0f}; std::vector<float> color = { red / 255.0f, green / 255.0f, blue / 255.0f };
m_CarcolsColorData.push_back(color); m_CarcolsColorData.push_back(color);
++count; ++count;
@ -796,7 +796,7 @@ void Vehicle::Draw()
if (ImGui::Button("Remove vehicles", Ui::GetSize(1))) if (ImGui::Button("Remove vehicles", Ui::GetSize(1)))
{ {
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
for (CVehicle *pVeh : CPools::ms_pVehiclePool) for (CVehicle* pVeh : CPools::ms_pVehiclePool)
{ {
if (DistanceBetweenPoints(pVeh->GetPosition(), player->GetPosition()) < m_nVehRemoveRadius if (DistanceBetweenPoints(pVeh->GetPosition(), player->GetPosition()) < m_nVehRemoveRadius
&& !(player->m_nPedFlags.bInVehicle && player->m_pVehicle == pVeh)) && !(player->m_nPedFlags.bInVehicle && player->m_pVehicle == pVeh))
@ -810,7 +810,7 @@ void Vehicle::Draw()
} }
if (ImGui::CollapsingHeader("Traffic options")) if (ImGui::CollapsingHeader("Traffic options"))
{ {
static std::vector<Ui::NamedMemory> color{{"Black", 0x969151}, {"Pink", 0x969150}}; static std::vector<Ui::NamedMemory> color{ {"Black", 0x969151}, {"Pink", 0x969150} };
static std::vector<Ui::NamedMemory> type{ static std::vector<Ui::NamedMemory> type{
{"Cheap", 0x96915E}, {"Country", 0x96917B}, {"Fast", 0x96915F} {"Cheap", 0x96915E}, {"Country", 0x96917B}, {"Fast", 0x96915F}
}; };
@ -966,7 +966,7 @@ void Vehicle::Draw()
uchar r = m_Color::m_fColorPicker[0] * 255; uchar r = m_Color::m_fColorPicker[0] * 255;
uchar g = m_Color::m_fColorPicker[1] * 255; uchar g = m_Color::m_fColorPicker[1] * 255;
uchar b = m_Color::m_fColorPicker[2] * 255; uchar b = m_Color::m_fColorPicker[2] * 255;
Paint::SetNodeColor(veh, Paint::veh_nodes::selected, {r, g, b, 255}, m_Color::m_bMatFilter); Paint::SetNodeColor(veh, Paint::veh_nodes::selected, { r, g, b, 255 }, m_Color::m_bMatFilter);
} }
ImGui::Spacing(); ImGui::Spacing();
@ -1188,7 +1188,7 @@ void Vehicle::Draw()
ImGui::BeginChild("HandlingChild"); ImGui::BeginChild("HandlingChild");
static std::vector<Ui::NamedValue> abs{{"On", 1}, {"Off", 0}}; static std::vector<Ui::NamedValue> abs{ {"On", 1}, {"Off", 0} };
Ui::EditRadioButtonAddressEx("Abs", pHandling + 0x9C, abs); Ui::EditRadioButtonAddressEx("Abs", pHandling + 0x9C, abs);
Ui::EditFloat("Anti dive multiplier", pHandling + 0xC4, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Anti dive multiplier", pHandling + 0xC4, 0.0f, 0.0f, 1.0f);
@ -1209,10 +1209,10 @@ void Vehicle::Draw()
Ui::EditFloat("Engine acceleration", pHandling + 0x7C, 0.0f, 0.0f, 49.0f, 12500.0f); Ui::EditFloat("Engine acceleration", pHandling + 0x7C, 0.0f, 0.0f, 49.0f, 12500.0f);
Ui::EditFloat("Engine inertia", pHandling + 0x80, 0.0f, 0.0f, 400.0f); Ui::EditFloat("Engine inertia", pHandling + 0x80, 0.0f, 0.0f, 400.0f);
static std::vector<Ui::NamedValue> engine_type{{"Petrol", 80}, {"Diseal", 68}, {"Electric", 69}}; static std::vector<Ui::NamedValue> engine_type{ {"Petrol", 80}, {"Diseal", 68}, {"Electric", 69} };
Ui::EditRadioButtonAddressEx("Engine type", pHandling + 0x75, engine_type); Ui::EditRadioButtonAddressEx("Engine type", pHandling + 0x75, engine_type);
std::vector<Ui::NamedValue> front_lights{{"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3}}; std::vector<Ui::NamedValue> front_lights{ {"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3} };
Ui::EditRadioButtonAddressEx("Front lights", pHandling + 0xDC, front_lights); Ui::EditRadioButtonAddressEx("Front lights", pHandling + 0xDC, front_lights);
Ui::EditFloat("Force level", pHandling + 0xAC, -10.0f, -10.0f, 10.0f); // test later Ui::EditFloat("Force level", pHandling + 0xAC, -10.0f, -10.0f, 10.0f); // test later
@ -1231,7 +1231,7 @@ void Vehicle::Draw()
Ui::EditAddress<BYTE>("Number of gears", pHandling + 0x76, 1, 1, 10); Ui::EditAddress<BYTE>("Number of gears", pHandling + 0x76, 1, 1, 10);
Ui::EditAddress<BYTE>("Percent submerged", pHandling + 0x20, 10, 10, 120); Ui::EditAddress<BYTE>("Percent submerged", pHandling + 0x20, 10, 10, 120);
static std::vector<Ui::NamedValue> rear_lights{{"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3}}; static std::vector<Ui::NamedValue> rear_lights{ {"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3} };
Ui::EditRadioButtonAddressEx("Rear lights", pHandling + 0xDD, rear_lights); Ui::EditRadioButtonAddressEx("Rear lights", pHandling + 0xDD, rear_lights);
Ui::EditFloat("Seat offset distance", pHandling + 0xD4, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Seat offset distance", pHandling + 0xD4, 0.0f, 0.0f, 1.0f);

View File

@ -12,7 +12,7 @@ private:
inline static bool m_bNoDamage; inline static bool m_bNoDamage;
inline static int m_nDoorMenuButton; inline static int m_nDoorMenuButton;
inline static std::string m_DoorNames[6] = inline static std::string m_DoorNames[6] =
{"Hood", "Boot", "Front left door", "Front right door", "Rear left door", "Rear right door"}; { "Hood", "Boot", "Front left door", "Front right door", "Rear left door", "Rear right door" };
inline static int m_nVehRemoveRadius; inline static int m_nVehRemoveRadius;
inline static bool m_bLockSpeed; inline static bool m_bLockSpeed;
inline static float m_fLockSpeed; inline static float m_fLockSpeed;
@ -24,11 +24,11 @@ private:
inline static bool m_bMatFilter = true; inline static bool m_bMatFilter = true;
inline static int m_nRadioButton = 1; inline static int m_nRadioButton = 1;
inline static bool bShowAll; inline static bool bShowAll;
inline static float m_fColorPicker[3]{0, 0, 0}; inline static float m_fColorPicker[3]{ 0, 0, 0 };
}; };
struct m_Neon struct m_Neon
{ {
inline static float m_fColorPicker[3]{0, 0, 0}; inline static float m_fColorPicker[3]{ 0, 0, 0 };
inline static bool m_bRainbowEffect; inline static bool m_bRainbowEffect;
inline static uint m_nRainbowTimer; inline static uint m_nRainbowTimer;
inline static bool m_bApplyOnTraffic; inline static bool m_bApplyOnTraffic;
@ -49,7 +49,7 @@ private:
inline static bool m_bCompAdded; inline static bool m_bCompAdded;
}; };
inline static std::vector<std::string> (m_HandlingFlagNames) = // 32 flags inline static std::vector<std::string>(m_HandlingFlagNames) = // 32 flags
{ {
"1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", "NO_HANDBRAKE", "STEER_REARWHEELS", "1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", "NO_HANDBRAKE", "STEER_REARWHEELS",
"HB_REARWHEEL_STEER", "ALT_STEER_OPT", "HB_REARWHEEL_STEER", "ALT_STEER_OPT",
@ -61,7 +61,7 @@ private:
"Unused 4" "Unused 4"
}; };
inline static std::vector<std::string> (m_ModelFlagNames) = // 32 flags inline static std::vector<std::string>(m_ModelFlagNames) = // 32 flags
{ {
"IS_VAN", "IS_BUS", "IS_LOW", "IS_BIG", "REVERSE_BONNET", "HANGING_BOOT", "TAILGATE_BOOT", "NOSWING_BOOT", "IS_VAN", "IS_BUS", "IS_LOW", "IS_BIG", "REVERSE_BONNET", "HANGING_BOOT", "TAILGATE_BOOT", "NOSWING_BOOT",
"NO_DOORS", "TANDEM_SEATS", "NO_DOORS", "TANDEM_SEATS",

View File

@ -57,7 +57,7 @@ bool Visual::TimeCycColorEdit3(const char* label, uchar* r, uchar* g, uchar* b,
auto green = static_cast<uchar*>(patch::GetPointer(int(g))); auto green = static_cast<uchar*>(patch::GetPointer(int(g)));
auto blue = static_cast<uchar*>(patch::GetPointer(int(b))); auto blue = static_cast<uchar*>(patch::GetPointer(int(b)));
float col[3]{red[val] / 255.0f, green[val] / 255.0f, blue[val] / 255.0f}; float col[3]{ red[val] / 255.0f, green[val] / 255.0f, blue[val] / 255.0f };
if (ImGui::ColorEdit3(label, col, flags)) if (ImGui::ColorEdit3(label, col, flags))
{ {
@ -80,7 +80,7 @@ bool Visual::TimeCycColorEdit4(const char* label, uchar* r, uchar* g, uchar* b,
auto blue = static_cast<uchar*>(patch::GetPointer(int(b))); auto blue = static_cast<uchar*>(patch::GetPointer(int(b)));
auto alpha = static_cast<uchar*>(patch::GetPointer(int(a))); auto alpha = static_cast<uchar*>(patch::GetPointer(int(a)));
float col[4]{red[val] / 255.0f, green[val] / 255.0f, blue[val] / 255.0f, alpha[val] / 255.0f}; float col[4]{ red[val] / 255.0f, green[val] / 255.0f, blue[val] / 255.0f, alpha[val] / 255.0f };
if (ImGui::ColorEdit4(label, col, flags)) if (ImGui::ColorEdit4(label, col, flags))
{ {
@ -322,7 +322,7 @@ void Visual::Draw()
{"No outline", 0}, {"Thin outline", 1}, {"Default outline", 2} {"No outline", 0}, {"Thin outline", 1}, {"Default outline", 2}
}; };
Ui::EditRadioButtonAddressEx("Money font outline", 0x58F58D, font_outline); Ui::EditRadioButtonAddressEx("Money font outline", 0x58F58D, font_outline);
static std::vector<Ui::NamedValue> style{{"Style 1", 1}, {"Style 2", 2}, {"Default style", 3}}; static std::vector<Ui::NamedValue> style{ {"Style 1", 1}, {"Style 2", 2}, {"Default style", 3} };
Ui::EditRadioButtonAddressEx("Money font style", 0x58F57F, style); Ui::EditRadioButtonAddressEx("Money font style", 0x58F57F, style);
Ui::EditAddress<float>("Radar Height", *(int*)0x5834F6, 0, 76, 999); Ui::EditAddress<float>("Radar Height", *(int*)0x5834F6, 0, 76, 999);
Ui::EditAddress<float>("Radar Width", *(int*)0x5834C2, 0, 94, 999); Ui::EditAddress<float>("Radar Width", *(int*)0x5834C2, 0, 94, 999);
@ -330,7 +330,7 @@ void Visual::Draw()
Ui::EditAddress<float>("Radar posY", *(int*)0x583500, -999, 104, 999); Ui::EditAddress<float>("Radar posY", *(int*)0x583500, -999, 104, 999);
Ui::EditAddress<int>("Radar zoom", 0xA444A3, 0, 0, 170); Ui::EditAddress<int>("Radar zoom", 0xA444A3, 0, 0, 170);
Ui::ColorPickerAddress("Radio station color", 0xBAB24C, ImVec4(150, 150, 150, 255)); Ui::ColorPickerAddress("Radio station color", 0xBAB24C, ImVec4(150, 150, 150, 255));
static std::vector<Ui::NamedValue> star_border{{"No border", 0}, {"Default", 1}, {"Bold border", 2}}; static std::vector<Ui::NamedValue> star_border{ {"No border", 0}, {"Default", 1}, {"Bold border", 2} };
Ui::EditRadioButtonAddressEx("Wanted star border", 0x58DD41, star_border); Ui::EditRadioButtonAddressEx("Wanted star border", 0x58DD41, star_border);
Ui::EditAddress<float>("Wanted posX", *(int*)0x58DD0F, -999, 29, 999); Ui::EditAddress<float>("Wanted posX", *(int*)0x58DD0F, -999, 29, 999);
Ui::EditAddress<float>("Wanted posY", *(int*)0x58DDFC, -999, 114, 999); Ui::EditAddress<float>("Wanted posY", *(int*)0x58DDFC, -999, 114, 999);
@ -400,6 +400,17 @@ void Visual::Draw()
Ui::ShowTooltip("Sync system time is enabled.\n(Game/Sync system time)"); Ui::ShowTooltip("Sync system time is enabled.\n(Game/Sync system time)");
} }
if (ImGui::Checkbox("Freeze game time", &Game::m_bFreezeTime))
{
if (Game::m_bFreezeTime)
{
patch::SetRaw(0x52CF10, (char*)"\xEB\xEF", 2);
}
else
{
patch::SetRaw(0x52CF10, (char*)"\x56\x8B", 2);
}
}
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::BeginTabBar("Timecyc subtab", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) if (ImGui::BeginTabBar("Timecyc subtab", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
{ {

View File

@ -3,7 +3,7 @@
class Weapon class Weapon
{ {
public: public:
inline static SSearchData m_WeaponData{"weapon"}; inline static SSearchData m_WeaponData{ "weapon" };
inline static bool m_bImagesLoaded; inline static bool m_bImagesLoaded;
inline static bool m_bAutoAim; inline static bool m_bAutoAim;
inline static bool m_bFastReload; inline static bool m_bFastReload;

View File

@ -131,6 +131,7 @@ struct STextureStructure
std::string m_FileName; std::string m_FileName;
std::string m_CategoryName; std::string m_CategoryName;
RwTexture *m_pRwTexture = nullptr; RwTexture *m_pRwTexture = nullptr;
void *m_pTexture = nullptr;
}; };
struct SSearchData struct SSearchData

View File

@ -65,6 +65,8 @@ project "CheatMenuVC"
"../src/Json.cpp", "../src/Json.cpp",
"../src/Teleport.h", "../src/Teleport.h",
"../src/Teleport.cpp", "../src/Teleport.cpp",
"../src/Player.h",
"../src/Player.cpp",
"../src/Ui.h", "../src/Ui.h",
"../src/Ui.cpp", "../src/Ui.cpp",
"../src/Util.h", "../src/Util.h",