[VC] Add don't lose clothes on wasted/busted
This commit is contained in:
parent
8db76a2ce7
commit
9e1b5db4d9
@ -368,6 +368,8 @@ NeedCJSkin = "You need to be in CJ skin"
|
||||
NeverGetHungry = "Never get hungry"
|
||||
NeverWanted = "Never wanted"
|
||||
NoFee = "No arrest fee"
|
||||
NoUndress = "Don't lose clothes"
|
||||
NoUndressTip = "Don't lose clothes after being busted/wasted"
|
||||
PedSkinsTab = "Ped skins"
|
||||
PlayerFlags = "Player flags,"
|
||||
PlayerRegen = "Player regeneration"
|
||||
|
@ -237,7 +237,7 @@ void CheatMenu::Init()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!D3dHook::InjectHook(DrawWindow))
|
||||
if (!D3dHook::Init(DrawWindow))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ private:
|
||||
};
|
||||
|
||||
static inline eMenuPages m_nMenuPage = eMenuPages::WELCOME; // current visible menu page
|
||||
static inline bool m_bShowMenu = false;
|
||||
static inline bool m_bShowMenu = false; // should the menu be drawn
|
||||
static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2);
|
||||
static inline bool m_bSizeChangedExternal = false; // Was menu size change requested
|
||||
static inline bool m_bSizeChangedExternal = false; // Was menu size change requested
|
||||
static inline std::vector<HeaderData> m_headerList;
|
||||
|
||||
// Applies imgui theme to the menu
|
||||
@ -44,8 +44,13 @@ public:
|
||||
CheatMenu() = delete;
|
||||
CheatMenu(const CheatMenu&) = delete;
|
||||
|
||||
// Initilizes the menu, page, hooks etc
|
||||
static void Init();
|
||||
|
||||
// Returns true if the menu is being shown
|
||||
static bool IsMenuShown();
|
||||
|
||||
// Resets the menu height & width to default
|
||||
static void ResetMenuSize();
|
||||
|
||||
// Generates menu headers
|
||||
|
@ -253,7 +253,7 @@ void D3dHook::ProcessMouse()
|
||||
}
|
||||
}
|
||||
|
||||
bool D3dHook::InjectHook(void *pCallback)
|
||||
bool D3dHook::Init(void *pCallback)
|
||||
{
|
||||
static bool hookInjected;
|
||||
if (hookInjected)
|
||||
@ -291,7 +291,7 @@ bool D3dHook::InjectHook(void *pCallback)
|
||||
return hookInjected;
|
||||
}
|
||||
|
||||
void D3dHook::RemoveHook()
|
||||
void D3dHook::Shutdown()
|
||||
{
|
||||
pCallbackFunc = nullptr;
|
||||
SetWindowLongPtr(RsGlobal.ps->window, GWL_WNDPROC, (LRESULT)oWndProc);
|
||||
|
@ -36,8 +36,15 @@ public:
|
||||
D3dHook(D3dHook const&) = delete;
|
||||
void operator=(D3dHook const&) = delete;
|
||||
|
||||
// Returns the current mouse visibility state
|
||||
static bool GetMouseState();
|
||||
static bool InjectHook(void *pCallback);
|
||||
static void RemoveHook();
|
||||
|
||||
// Injects game hooks & stuff
|
||||
static bool Init(void *pCallback);
|
||||
|
||||
// Sets the current mouse visibility state
|
||||
static void SetMouseState(bool state);
|
||||
|
||||
// Cleans up hooks
|
||||
static void Shutdown();
|
||||
};
|
||||
|
@ -28,6 +28,11 @@ void Menu::ShowPage()
|
||||
static int selected = Locale::GetCurrentLocaleIndex();
|
||||
static std::vector<std::string>& vec = Locale::GetLocaleList();
|
||||
|
||||
|
||||
/*
|
||||
Chinese fonts is huge & adds overhead
|
||||
Only download & use it if the user asks for it
|
||||
*/
|
||||
if (Locale::GetLocaleList()[Locale::GetCurrentLocaleIndex()] == "Chinese"
|
||||
&& !FontMgr::IsSupportPackageInstalled())
|
||||
{
|
||||
|
13
src/menu.h
13
src/menu.h
@ -1,16 +1,23 @@
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
|
||||
/*
|
||||
Menu Class
|
||||
Handles code for the Menu page
|
||||
*/
|
||||
class Menu
|
||||
{
|
||||
public:
|
||||
static inline bool m_bAutoCheckUpdate;
|
||||
static inline bool m_bDiscordRPC;
|
||||
static inline bool m_bTextOnlyMode;
|
||||
static inline bool m_bAutoCheckUpdate; // Should updates be checked automatically
|
||||
static inline bool m_bDiscordRPC; // Is the discord rich presence enabled
|
||||
static inline bool m_bTextOnlyMode; // Hide all menu images mode
|
||||
|
||||
Menu() = delete;
|
||||
Menu(const Menu&) = delete;
|
||||
|
||||
// Inits the class
|
||||
static void Init();
|
||||
|
||||
// Displays the menu page
|
||||
static void ShowPage();
|
||||
};
|
||||
|
@ -178,7 +178,7 @@ static RwTexture* LoadTextureFromMemory(char* data, unsigned int size)
|
||||
return RwTextureCreate(raster);
|
||||
}
|
||||
|
||||
void Neon::InjectHooks()
|
||||
void Neon::Init()
|
||||
{
|
||||
static bool init;
|
||||
if (init)
|
||||
@ -235,7 +235,7 @@ void Neon::InjectHooks()
|
||||
init = true;
|
||||
}
|
||||
|
||||
void Neon::RemoveHooks()
|
||||
void Neon::Shutdown()
|
||||
{
|
||||
if (m_pNeonTexture)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
Neon(Neon&) = delete;
|
||||
|
||||
// Injects necessary hooks into the game
|
||||
static void InjectHooks();
|
||||
static void Init();
|
||||
|
||||
// Installs neons with color
|
||||
static void Install(CVehicle* veh, int r, int g, int b);
|
||||
@ -51,7 +51,7 @@ public:
|
||||
static void SetPulsing(CVehicle* veh, bool state);
|
||||
|
||||
// Removes the neon game hooks
|
||||
static void RemoveHooks();
|
||||
static void Shutdown();
|
||||
|
||||
// Removes neon from vehicle
|
||||
static void Remove(CVehicle* veh);
|
||||
|
@ -447,6 +447,39 @@ void Player::ShowPage()
|
||||
patch::Set<float>(0x8D2458, m_bFastSprint ? 0.1f : 5.0f);
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
#endif
|
||||
#ifdef GTAVC
|
||||
if (Widget::Checkbox(TEXT("Player.NoUndress"), &m_bNoUndress, TEXT("Player.NoUndressTip")))
|
||||
{
|
||||
if (m_bNoUndress)
|
||||
{
|
||||
// pop ecx
|
||||
patch::SetUChar(0x42BDC5, 0x59);
|
||||
patch::SetUChar(0x42C1B0, 0x59);
|
||||
patch::SetUChar(0x42C3B2, 0x59);
|
||||
patch::SetUChar(0x42BDC5, 0x59);
|
||||
patch::SetUChar(0x42C1B0, 0x59);
|
||||
patch::SetUChar(0x42C3B2, 0x59);
|
||||
// nop Undress()
|
||||
patch::RedirectShortJump(0x42BDC6, (void*)0x42BDE1);
|
||||
patch::RedirectShortJump(0x42C1B1, (void*)0x42C1CC);
|
||||
patch::RedirectShortJump(0x42C3B3, (void*)0x42C3CE);
|
||||
// nop Dress()
|
||||
patch::RedirectShortJump(0x42BDC6, (void*)0x42BE05);
|
||||
patch::RedirectShortJump(0x42C1B1, (void*)0x42C1F0);
|
||||
patch::RedirectShortJump(0x42C3B3, (void*)0x42C3F2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// restore
|
||||
patch::SetRaw(0x42BDC5, (void*)"\x0F\xB6\x05\xFB\x0A\xA1", 6);
|
||||
patch::SetRaw(0x42C1B0, (void*)"\x0F\xB6\x05\xFB\x0A\xA1", 6);
|
||||
patch::SetRaw(0x42C3B2, (void*)"\x0F\xB6\x05\xFB\x0A\xA1", 6);
|
||||
patch::SetRaw(0x42BDC5, (void*)"\x0F\xB6\x05\xFB\x0A\xA1", 6);
|
||||
patch::SetRaw(0x42C1B0, (void*)"\x0F\xB6\x05\xFB\x0A\xA1", 6);
|
||||
patch::SetRaw(0x42C3B2, (void*)"\x0F\xB6\x05\xFB\x0A\xA1", 6);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Widget::CheckboxAddr(TEXT("Player.FreeHealthcare"), (int)&pInfo->m_bGetOutOfHospitalFree);
|
||||
|
||||
@ -575,6 +608,7 @@ void Player::ShowPage()
|
||||
}
|
||||
#endif
|
||||
Widget::CheckboxAddr(TEXT("Player.NoFee"), (int)&pInfo->m_bGetOutOfJailFree);
|
||||
|
||||
Widget::Checkbox(TEXT("Player.RespawnDieLoc"), &KeepPosition::m_bEnabled, TEXT("Player.RespawnDieLocTip"));
|
||||
Widget::Checkbox(TEXT("Player.PlayerRegen"), &m_bPlayerRegen, TEXT("Player.PlayerRegenTip"));
|
||||
#ifdef GTASA
|
||||
|
@ -14,6 +14,10 @@ private:
|
||||
};
|
||||
static inline bool m_bFreezeWantedLevel;
|
||||
|
||||
#ifdef GTAVC
|
||||
static inline bool m_bNoUndress;
|
||||
#endif
|
||||
|
||||
#ifdef GTASA
|
||||
static inline bool m_bAimSkinChanger;
|
||||
static inline bool m_bDrunkEffect;
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
Teleport() = delete;
|
||||
Teleport(const Teleport&) = delete;
|
||||
|
||||
// Initialized the class, hooks etc.
|
||||
static void Init();
|
||||
|
||||
// Warp player to position, marker, map etc
|
||||
|
@ -18,7 +18,7 @@ void Vehicle::Init()
|
||||
{
|
||||
#ifdef GTASA
|
||||
FileHandler::FetchHandlingID(m_VehicleIDE);
|
||||
Neon::InjectHooks();
|
||||
Neon::Init();
|
||||
Paint::InjectHooks();
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user