1. Rename 'Auto heal' -> 'Health regen'
2. Block VCMP for VC build 3. Refactor code
This commit is contained in:
parent
b3d4fd10d0
commit
600ef84cef
@ -4,7 +4,6 @@
|
||||
class Animation
|
||||
{
|
||||
private:
|
||||
|
||||
// Animation player
|
||||
static inline ResourceStore m_AnimData{ "animation", eResourceType::TYPE_TEXT };
|
||||
static inline char m_nAnimBuffer[INPUT_BUFFER_SIZE];
|
||||
@ -36,21 +35,18 @@ private:
|
||||
};
|
||||
#endif
|
||||
|
||||
protected:
|
||||
Animation();
|
||||
|
||||
public:
|
||||
static void Draw();
|
||||
static void PlayAnimation(std::string& rootKey, std::string& anim, std::string& ifp);
|
||||
static void RemoveAnimation(std::string& rootKey, std::string& anim, std::string& ifp);
|
||||
|
||||
#ifdef GTASA
|
||||
static void PlayCutscene(std::string& rootKey, std::string& cutsceneId, std::string& interior);
|
||||
#elif GTAVC
|
||||
static bool _LoadAnimationBlock(const char* szBlockName);
|
||||
#endif
|
||||
|
||||
#ifndef GTASA
|
||||
static void _PlayAnimation(RpClump* pClump, int animGroup, int animID, float blend);
|
||||
#endif
|
||||
|
||||
public:
|
||||
Animation();
|
||||
static void Draw();
|
||||
};
|
@ -1,6 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "cheatMenu.h"
|
||||
#include "menuinfo.h"
|
||||
#include "version.h"
|
||||
#include "ui.h"
|
||||
#include "updater.h"
|
||||
#include "d3dhook.h"
|
||||
|
@ -50,9 +50,8 @@ void D3dHook::ProcessFrame(void* ptr)
|
||||
}
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
static bool bInit = false;
|
||||
|
||||
if (bInit)
|
||||
static bool init;
|
||||
if (init)
|
||||
{
|
||||
ProcessMouse();
|
||||
|
||||
@ -116,12 +115,11 @@ void D3dHook::ProcessFrame(void* ptr)
|
||||
}
|
||||
else
|
||||
{
|
||||
bInit = true;
|
||||
init = true;
|
||||
ImGui_ImplWin32_Init(RsGlobal.ps->window);
|
||||
|
||||
#ifdef GTASA
|
||||
// shift trigger fix
|
||||
patch::Nop(0x00531155, 5);
|
||||
patch::Nop(0x00531155, 5); // shift trigger fix
|
||||
#endif
|
||||
|
||||
if (gRenderer == Render_DirectX9)
|
||||
@ -245,6 +243,12 @@ void D3dHook::ProcessMouse()
|
||||
|
||||
bool D3dHook::InjectHook(void *pCallback)
|
||||
{
|
||||
static bool hookInjected;
|
||||
if (hookInjected)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ImGui::CreateContext();
|
||||
|
||||
/*
|
||||
@ -258,8 +262,7 @@ bool D3dHook::InjectHook(void *pCallback)
|
||||
kiero::bind(16, (void**)&oReset, hkReset);
|
||||
kiero::bind(42, (void**)&oEndScene, hkEndScene);
|
||||
pCallbackFunc = pCallback;
|
||||
|
||||
return true;
|
||||
hookInjected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -269,12 +272,11 @@ bool D3dHook::InjectHook(void *pCallback)
|
||||
gRenderer = Render_DirectX11;
|
||||
kiero::bind(8, (void**)&oPresent, hkPresent);
|
||||
pCallbackFunc = pCallback;
|
||||
|
||||
return true;
|
||||
hookInjected = true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return hookInjected;
|
||||
}
|
||||
|
||||
void D3dHook::RemoveHook()
|
||||
|
@ -5,11 +5,11 @@ class D3dHook
|
||||
{
|
||||
private:
|
||||
using f_EndScene = HRESULT(CALLBACK*)(IDirect3DDevice9*);
|
||||
using f_Present11 = HRESULT(CALLBACK*)(IDXGISwapChain*, UINT, UINT);
|
||||
using f_Present = HRESULT(CALLBACK*)(IDXGISwapChain*, UINT, UINT);
|
||||
using f_Reset = HRESULT(CALLBACK*)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
|
||||
|
||||
static inline WNDPROC oWndProc;
|
||||
static inline f_Present11 oPresent;
|
||||
static inline f_Present oPresent;
|
||||
static inline f_EndScene oEndScene;
|
||||
static inline f_Reset oReset;
|
||||
static inline bool mouseShown;
|
||||
|
@ -1,23 +1,12 @@
|
||||
#include "pch.h"
|
||||
#include "cheatmenu.h"
|
||||
#include "updater.h"
|
||||
#include "menuinfo.h"
|
||||
#include "d3dhook.h"
|
||||
#include "version.h"
|
||||
|
||||
void MenuThread(void* param)
|
||||
{
|
||||
static bool gameInit;
|
||||
|
||||
// Wait till game init
|
||||
Events::initRwEvent += []
|
||||
{
|
||||
gameInit = true;
|
||||
};
|
||||
|
||||
while (!gameInit)
|
||||
{
|
||||
Sleep(1000);
|
||||
}
|
||||
// wait for game init
|
||||
Sleep(3000);
|
||||
|
||||
/*
|
||||
Had to put this in place since some people put the folder in root
|
||||
@ -46,11 +35,11 @@ void MenuThread(void* param)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef GTASA
|
||||
/*
|
||||
TODO: Find a better way
|
||||
Since you could still name it something else
|
||||
*/
|
||||
#ifdef GTASA
|
||||
if (GetModuleHandle("SAMP.dll") || GetModuleHandle("SAMP.asi"))
|
||||
{
|
||||
gLog << "Error: CheatMenu doesn't support SAMP" << std::endl;
|
||||
@ -58,6 +47,13 @@ void MenuThread(void* param)
|
||||
return;
|
||||
}
|
||||
CFastman92limitAdjuster::Init();
|
||||
#elif GTAVC
|
||||
if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi"))
|
||||
{
|
||||
gLog << "Error: CheatMenu doesn't support VCMP" << std::endl;
|
||||
MessageBox(RsGlobal.ps->window, "VCMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
gLog << "Starting...\nVersion: " MENU_TITLE "\nAuthor: Grinch_\nDiscord: " DISCORD_INVITE "\nMore Info: "
|
||||
@ -69,12 +65,10 @@ void MenuThread(void* param)
|
||||
// Checking for updates once a day
|
||||
time_t now = time(0);
|
||||
struct tm tstruct = *localtime(&now);
|
||||
int lastCheckDate = gConfig.GetValue("config.last_update_checked", 0);
|
||||
|
||||
if (lastCheckDate != tstruct.tm_mday)
|
||||
if (gConfig.GetValue("config.update_date", 0) != tstruct.tm_mday)
|
||||
{
|
||||
Updater::CheckUpdate();
|
||||
gConfig.SetValue("config.last_update_checked", tstruct.tm_mday);
|
||||
gConfig.SetValue("config.update_date", tstruct.tm_mday);
|
||||
}
|
||||
|
||||
while (true)
|
||||
|
17
src/game.h
17
src/game.h
@ -3,14 +3,12 @@
|
||||
|
||||
class Game
|
||||
{
|
||||
public:
|
||||
private:
|
||||
static inline ResourceStore m_MissionData{ "mission", eResourceType::TYPE_TEXT };
|
||||
|
||||
static inline bool m_bDisableCheats;
|
||||
static inline bool m_bDisableReplay;
|
||||
static inline bool m_bMissionTimer;
|
||||
static inline bool m_bFreezeTime;
|
||||
static inline bool m_bSyncTime;
|
||||
|
||||
#ifdef GTASA
|
||||
static inline bool m_bForbiddenArea = true; // wanted level when going outside playable aea
|
||||
static inline bool m_bSolidWater; // walk on water hack
|
||||
@ -56,13 +54,18 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
Game();
|
||||
static void Draw();
|
||||
static void RealTimeClock();
|
||||
|
||||
#ifdef GTASA
|
||||
// TODO: Update freecam with aap's code
|
||||
static void FreeCam();
|
||||
static void ClearFreecamStuff();
|
||||
#endif
|
||||
|
||||
public:
|
||||
static inline bool m_bFreezeTime;
|
||||
static inline bool m_bSyncTime;
|
||||
|
||||
Game();
|
||||
static void Draw();
|
||||
|
||||
};
|
||||
|
@ -1,20 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "hotkeys.h"
|
||||
|
||||
Hotkey aimSkinChanger;
|
||||
Hotkey freeCam;
|
||||
Hotkey commandWindow;
|
||||
Hotkey fixVeh;
|
||||
Hotkey flipVeh;
|
||||
Hotkey freeCamTeleportPlayer;
|
||||
Hotkey godMode;
|
||||
Hotkey menuOpen;
|
||||
Hotkey quickSceenShot;
|
||||
Hotkey quickTeleport;
|
||||
Hotkey vehEngine;
|
||||
Hotkey vehInstantStart;
|
||||
Hotkey vehInstantStop;
|
||||
|
||||
bool Hotkey::DrawUI(const char* label)
|
||||
{
|
||||
bool active = (m_CurrentHotkey == label);
|
||||
|
@ -23,17 +23,3 @@ public:
|
||||
bool Pressed();
|
||||
std::string GetNameString();
|
||||
};
|
||||
|
||||
extern Hotkey aimSkinChanger;
|
||||
extern Hotkey freeCam;
|
||||
extern Hotkey commandWindow;
|
||||
extern Hotkey fixVeh;
|
||||
extern Hotkey flipVeh;
|
||||
extern Hotkey freeCamTeleportPlayer;
|
||||
extern Hotkey godMode;
|
||||
extern Hotkey menuOpen;
|
||||
extern Hotkey quickSceenShot;
|
||||
extern Hotkey quickTeleport;
|
||||
extern Hotkey vehEngine;
|
||||
extern Hotkey vehInstantStart;
|
||||
extern Hotkey vehInstantStop;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "pch.h"
|
||||
#include "menuinfo.h"
|
||||
#include "version.h"
|
||||
#include "menu.h"
|
||||
#include "ui.h"
|
||||
#include "util.h"
|
||||
|
14
src/pch.cpp
14
src/pch.cpp
@ -1,2 +1,16 @@
|
||||
#include "pch.h"
|
||||
CJson gConfig = CJson("config");
|
||||
|
||||
Hotkey aimSkinChanger;
|
||||
Hotkey freeCam;
|
||||
Hotkey commandWindow;
|
||||
Hotkey fixVeh;
|
||||
Hotkey flipVeh;
|
||||
Hotkey freeCamTeleportPlayer;
|
||||
Hotkey godMode;
|
||||
Hotkey menuOpen;
|
||||
Hotkey quickSceenShot;
|
||||
Hotkey quickTeleport;
|
||||
Hotkey vehEngine;
|
||||
Hotkey vehInstantStart;
|
||||
Hotkey vehInstantStop;
|
14
src/pch.h
14
src/pch.h
@ -105,3 +105,17 @@ static void SetHelpMessage(const char *message, bool b1, bool b2, bool b3)
|
||||
delete wc;
|
||||
#endif
|
||||
}
|
||||
|
||||
extern Hotkey aimSkinChanger;
|
||||
extern Hotkey freeCam;
|
||||
extern Hotkey commandWindow;
|
||||
extern Hotkey fixVeh;
|
||||
extern Hotkey flipVeh;
|
||||
extern Hotkey freeCamTeleportPlayer;
|
||||
extern Hotkey godMode;
|
||||
extern Hotkey menuOpen;
|
||||
extern Hotkey quickSceenShot;
|
||||
extern Hotkey quickTeleport;
|
||||
extern Hotkey vehEngine;
|
||||
extern Hotkey vehInstantStart;
|
||||
extern Hotkey vehInstantStop;
|
16
src/ped.h
16
src/ped.h
@ -41,8 +41,15 @@ private:
|
||||
#endif
|
||||
};
|
||||
};
|
||||
public:
|
||||
|
||||
#ifdef GTASA
|
||||
static void SpawnPed(std::string& model);
|
||||
static void BigHeadEffect(CPed *ped);
|
||||
#else
|
||||
static void SpawnPed(std::string& cat, std::string& name, std::string& model);
|
||||
#endif
|
||||
|
||||
public:
|
||||
#ifdef GTASA
|
||||
static inline CJson m_SpecialPedJson = CJson("ped special");
|
||||
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)};
|
||||
@ -53,11 +60,4 @@ public:
|
||||
Ped();
|
||||
~Ped();
|
||||
static void Draw();
|
||||
|
||||
#ifdef GTASA
|
||||
static void SpawnPed(std::string& model);
|
||||
static void BigHeadEffect(CPed *ped);
|
||||
#else
|
||||
static void SpawnPed(std::string& cat, std::string& name, std::string& model);
|
||||
#endif
|
||||
};
|
||||
|
@ -7,29 +7,6 @@
|
||||
#ifdef GTASA
|
||||
#include "ped.h"
|
||||
|
||||
// hardcoded cloth category names
|
||||
const char* cloth_category[18] =
|
||||
{
|
||||
"Shirts",
|
||||
"Heads",
|
||||
"Trousers",
|
||||
"Shoes",
|
||||
"Tattoos left lower arm",
|
||||
"Tattoos left upper arm",
|
||||
"Tattoos right upper arm",
|
||||
"Tattoos right lower arm",
|
||||
"Tattoos back",
|
||||
"Tattoos left chest",
|
||||
"Tattoos right chest",
|
||||
"Tattoos stomach",
|
||||
"Tattoos lower back",
|
||||
"Necklaces",
|
||||
"Watches",
|
||||
"Glasses",
|
||||
"Hats",
|
||||
"Extras"
|
||||
};
|
||||
|
||||
static inline void PlayerModelBrokenFix()
|
||||
{
|
||||
CPlayerPed* pPlayer = FindPlayerPed();
|
||||
@ -147,7 +124,7 @@ Player::Player()
|
||||
CPlayerPed* player = FindPlayerPed();
|
||||
int hplayer = CPools::GetPedRef(player);
|
||||
|
||||
if (m_bAutoHeal)
|
||||
if (m_bHealthRegen)
|
||||
{
|
||||
static uint lastDmgTimer = 0;
|
||||
static uint lastHealTimer = 0;
|
||||
@ -417,7 +394,6 @@ void Player::Draw()
|
||||
ImGui::BeginChild("CheckboxesChild");
|
||||
|
||||
ImGui::Columns(2, 0, false);
|
||||
Ui::CheckboxWithHint("Auto heal", &m_bAutoHeal, "Player will heal when not taken damage for 5 seconds");
|
||||
|
||||
#ifdef GTASA
|
||||
Ui::CheckboxAddress("Bounty on yourself", 0x96913F);
|
||||
@ -469,6 +445,7 @@ void Player::Draw()
|
||||
pPlayer->m_nEntityFlags.bMeleeProof = m_bGodMode;
|
||||
#endif
|
||||
}
|
||||
Ui::CheckboxWithHint("Health regeneration", &m_bHealthRegen, "Player heals if not taken damage for 5 seconds");
|
||||
#ifdef GTASA
|
||||
Ui::CheckboxAddress("Higher cycle jumps", 0x969161);
|
||||
Ui::CheckboxAddress("Infinite oxygen", 0x96916E);
|
||||
@ -759,7 +736,7 @@ void Player::Draw()
|
||||
getline(ss, temp, '$');
|
||||
|
||||
return temp;
|
||||
}, nullptr, cloth_category, sizeof(cloth_category) / sizeof(const char*));
|
||||
}, nullptr, clothNameList, sizeof(clothNameList) / sizeof(const char*));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -792,7 +769,7 @@ void Player::Draw()
|
||||
CClothes::RebuildPlayer(player, false);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
for (const char* clothName : cloth_category)
|
||||
for (const char* clothName : clothNameList)
|
||||
{
|
||||
if (ImGui::Button(clothName, ImVec2(Ui::GetSize(2))))
|
||||
{
|
||||
|
18
src/player.h
18
src/player.h
@ -4,7 +4,7 @@
|
||||
class Player
|
||||
{
|
||||
private:
|
||||
static inline bool m_bAutoHeal;
|
||||
static inline bool m_bHealthRegen;
|
||||
static inline bool m_bGodMode;
|
||||
static inline bool m_bModloaderInstalled;
|
||||
struct m_KeepPosition
|
||||
@ -31,14 +31,18 @@ private:
|
||||
static inline bool m_bEnabled = false;
|
||||
static inline float m_fOffset = 40.0f;
|
||||
};
|
||||
|
||||
static inline const char* clothNameList[18] =
|
||||
{
|
||||
"Shirts", "Heads", "Trousers", "Shoes", "Tattoos left lower arm", "Tattoos left upper arm",
|
||||
"Tattoos right upper arm", "Tattoos right lower arm", "Tattoos back", "Tattoos left chest",
|
||||
"Tattoos right chest", "Tattoos stomach", "Tattoos lower back", "Necklaces", "Watches",
|
||||
"Glasses", "Hats", "Extras"
|
||||
};
|
||||
#else
|
||||
static inline ResourceStore skinData { BY_GAME(NULL, "skin", "ped"), eResourceType::TYPE_TEXT };
|
||||
#endif
|
||||
|
||||
public:
|
||||
Player();
|
||||
static void Draw();
|
||||
|
||||
#ifdef GTASA
|
||||
static void ChangePlayerModel(std::string& model);
|
||||
static void ChangePlayerCloth(std::string& model);
|
||||
@ -46,4 +50,8 @@ public:
|
||||
#else
|
||||
static void ChangePlayerModel(std::string& cat, std::string& name, std::string& id);
|
||||
#endif
|
||||
|
||||
public:
|
||||
Player();
|
||||
static void Draw();
|
||||
};
|
||||
|
@ -32,11 +32,12 @@ private:
|
||||
static void FetchRadarSpriteData();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
Teleport();
|
||||
public:
|
||||
static void Draw();
|
||||
static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0);
|
||||
static void TeleportToLocation(std::string& rootkey, std::string& bLocName, std::string& loc);
|
||||
static void RemoveTeleportEntry(std::string& rootkey, std::string& key, std::string& val);
|
||||
|
||||
public:
|
||||
Teleport();
|
||||
|
||||
static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0);
|
||||
static void Draw();
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "util.h"
|
||||
#include "ui.h"
|
||||
#include "../depend/imgui/imgui_internal.h"
|
||||
#include "menuinfo.h"
|
||||
#include "version.h"
|
||||
|
||||
// Really messy code, cleanup someday
|
||||
bool Ui::DrawTitleBar()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "updater.h"
|
||||
#include "menuinfo.h"
|
||||
#include "version.h"
|
||||
|
||||
bool Updater::IsUpdateAvailable()
|
||||
{
|
||||
|
@ -91,6 +91,8 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
Vehicle();
|
||||
~Vehicle();
|
||||
#ifdef GTASA
|
||||
static void SpawnVehicle(std::string& name);
|
||||
#else
|
||||
@ -99,6 +101,4 @@ public:
|
||||
static std::string GetNameFromModel(int model);
|
||||
static int GetModelFromName(const char* name);
|
||||
static void Draw();
|
||||
Vehicle();
|
||||
~Vehicle();
|
||||
};
|
||||
|
@ -38,6 +38,7 @@ private:
|
||||
static bool TimeCycColorEdit4(const char* label, T* r, T* g, T* b, T* a, ImGuiColorEditFlags flags = 0);
|
||||
template <typename T>
|
||||
static void TimecycSlider(const char* label, T* data, int min, int max);
|
||||
|
||||
public:
|
||||
Visual();
|
||||
static void Draw();
|
||||
|
16
src/weapon.h
16
src/weapon.h
@ -3,10 +3,8 @@
|
||||
|
||||
class Weapon
|
||||
{
|
||||
public:
|
||||
private:
|
||||
#ifdef GTASA
|
||||
static inline ResourceStore m_WeaponData { "weapon", eResourceType::TYPE_BOTH, ImVec2(65, 65) };
|
||||
|
||||
static inline bool m_bAutoAim;
|
||||
static inline bool m_bRapidFire;
|
||||
static inline bool m_bDualWeild;
|
||||
@ -33,7 +31,6 @@ public:
|
||||
"Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"
|
||||
};
|
||||
#else
|
||||
static inline ResourceStore m_WeaponData { "weapon", eResourceType::TYPE_TEXT };
|
||||
static inline bool m_bInfiniteAmmo;
|
||||
#endif
|
||||
static inline bool m_bFastReload;
|
||||
@ -43,13 +40,18 @@ public:
|
||||
static inline uchar m_nCurrentWeaponSlot = -1;
|
||||
static inline int m_nSelectedWeapon;
|
||||
|
||||
Weapon();
|
||||
static void Draw();
|
||||
|
||||
public:
|
||||
#ifdef GTASA
|
||||
static inline ResourceStore m_WeaponData { "weapon", eResourceType::TYPE_BOTH, ImVec2(65, 65) };
|
||||
|
||||
static void GiveWeaponToPlayer(std::string& weapon_type);
|
||||
static void SetGangWeapon(std::string& weapon_type);
|
||||
#else
|
||||
static inline ResourceStore m_WeaponData { "weapon", eResourceType::TYPE_TEXT };
|
||||
|
||||
static void GiveWeaponToPlayer(std::string& rootkey, std::string& model, std::string& name);
|
||||
#endif
|
||||
|
||||
Weapon();
|
||||
static void Draw();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user