Add option to remove each cloth item separately
This commit is contained in:
parent
b90d95fd75
commit
46549d8558
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
build/
|
build/
|
||||||
|
|
||||||
|
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
@ -6,7 +6,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Build Debug",
|
"label": "Build Debug",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "Debug.bat",
|
"command": "${workspaceFolder}/tools/Debug.bat",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
"reveal": "always",
|
"reveal": "always",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Build Release",
|
"label": "Build Release",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "Release.bat",
|
"command": "${workspaceFolder}/tools/Release.bat",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
"reveal": "always",
|
"reveal": "always",
|
||||||
|
File diff suppressed because one or more lines are too long
@ -55,7 +55,7 @@ void CheatMenu::DrawWindow()
|
|||||||
CheatMenu::CheatMenu()
|
CheatMenu::CheatMenu()
|
||||||
{
|
{
|
||||||
ApplyStyle();
|
ApplyStyle();
|
||||||
window_callback = std::bind(&DrawWindow);
|
windowCallback = std::bind(&DrawWindow);
|
||||||
|
|
||||||
// Load menu settings
|
// Load menu settings
|
||||||
Globals::m_HeaderId = config.GetValue("window.id", std::string(""));
|
Globals::m_HeaderId = config.GetValue("window.id", std::string(""));
|
||||||
|
51
src/Game.cpp
51
src/Game.cpp
@ -91,10 +91,14 @@ Game::Game()
|
|||||||
Command<Commands::CREATE_OBJECT>(3095, pos.x, pos.y, waterHeight, &m_nSolidWaterObj);
|
Command<Commands::CREATE_OBJECT>(3095, pos.x, pos.y, waterHeight, &m_nSolidWaterObj);
|
||||||
Command<Commands::SET_OBJECT_VISIBLE>(m_nSolidWaterObj, false);
|
Command<Commands::SET_OBJECT_VISIBLE>(m_nSolidWaterObj, false);
|
||||||
if (pos.z < (waterHeight + 1))
|
if (pos.z < (waterHeight + 1))
|
||||||
|
{
|
||||||
pPlayer->SetPosn(pos.x, pos.y, waterHeight + 1);
|
pPlayer->SetPosn(pos.x, pos.y, waterHeight + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Command<Commands::SET_OBJECT_COORDINATES>(m_nSolidWaterObj, pos.x, pos.y, waterHeight);
|
Command<Commands::SET_OBJECT_COORDINATES>(m_nSolidWaterObj, pos.x, pos.y, waterHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -216,10 +220,14 @@ void Game::FreeCam()
|
|||||||
m_Freecam::m_fTotalMouse.y = m_Freecam::m_fTotalMouse.y + m_Freecam::m_fMouse.y / 3;
|
m_Freecam::m_fTotalMouse.y = m_Freecam::m_fTotalMouse.y + m_Freecam::m_fMouse.y / 3;
|
||||||
|
|
||||||
if (m_Freecam::m_fTotalMouse.x > 150)
|
if (m_Freecam::m_fTotalMouse.x > 150)
|
||||||
|
{
|
||||||
m_Freecam::m_fTotalMouse.y = 150;
|
m_Freecam::m_fTotalMouse.y = 150;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_Freecam::m_fTotalMouse.y < -150)
|
if (m_Freecam::m_fTotalMouse.y < -150)
|
||||||
|
{
|
||||||
m_Freecam::m_fTotalMouse.y = -150;
|
m_Freecam::m_fTotalMouse.y = -150;
|
||||||
|
}
|
||||||
|
|
||||||
if (Ui::HotKeyPressed(Menu::m_HotKeys::freeCamTeleportPlayer))
|
if (Ui::HotKeyPressed(Menu::m_HotKeys::freeCamTeleportPlayer))
|
||||||
{
|
{
|
||||||
@ -236,15 +244,21 @@ void Game::FreeCam()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (KeyPressed(VK_RCONTROL))
|
if (KeyPressed(VK_RCONTROL))
|
||||||
|
{
|
||||||
deltaSpeed /= 2;
|
deltaSpeed /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (KeyPressed(VK_RSHIFT))
|
if (KeyPressed(VK_RSHIFT))
|
||||||
|
{
|
||||||
deltaSpeed *= 2;
|
deltaSpeed *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (KeyPressed(VK_KEY_I) || KeyPressed(VK_KEY_K))
|
if (KeyPressed(VK_KEY_I) || KeyPressed(VK_KEY_K))
|
||||||
{
|
{
|
||||||
if (KeyPressed(VK_KEY_K))
|
if (KeyPressed(VK_KEY_K))
|
||||||
|
{
|
||||||
deltaSpeed *= -1;
|
deltaSpeed *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
float angle;
|
float angle;
|
||||||
Command<Commands::GET_CHAR_HEADING>(m_Freecam::m_nPed, &angle);
|
Command<Commands::GET_CHAR_HEADING>(m_Freecam::m_nPed, &angle);
|
||||||
@ -256,7 +270,9 @@ void Game::FreeCam()
|
|||||||
if (KeyPressed(VK_KEY_J) || KeyPressed(VK_KEY_L))
|
if (KeyPressed(VK_KEY_J) || KeyPressed(VK_KEY_L))
|
||||||
{
|
{
|
||||||
if (KeyPressed(VK_KEY_J))
|
if (KeyPressed(VK_KEY_J))
|
||||||
|
{
|
||||||
deltaSpeed *= -1;
|
deltaSpeed *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
float angle;
|
float angle;
|
||||||
Command<Commands::GET_CHAR_HEADING>(m_Freecam::m_nPed, &angle);
|
Command<Commands::GET_CHAR_HEADING>(m_Freecam::m_nPed, &angle);
|
||||||
@ -269,7 +285,9 @@ void Game::FreeCam()
|
|||||||
if (CPad::NewMouseControllerState.wheelUp)
|
if (CPad::NewMouseControllerState.wheelUp)
|
||||||
{
|
{
|
||||||
if (m_Freecam::m_fFOV > 10.0f)
|
if (m_Freecam::m_fFOV > 10.0f)
|
||||||
|
{
|
||||||
m_Freecam::m_fFOV -= 2.0f * deltaSpeed;
|
m_Freecam::m_fFOV -= 2.0f * deltaSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 250, true);
|
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 250, true);
|
||||||
Command<Commands::CAMERA_PERSIST_FOV>(true);
|
Command<Commands::CAMERA_PERSIST_FOV>(true);
|
||||||
@ -278,7 +296,9 @@ void Game::FreeCam()
|
|||||||
if (CPad::NewMouseControllerState.wheelDown)
|
if (CPad::NewMouseControllerState.wheelDown)
|
||||||
{
|
{
|
||||||
if (m_Freecam::m_fFOV < 115.0f)
|
if (m_Freecam::m_fFOV < 115.0f)
|
||||||
|
{
|
||||||
m_Freecam::m_fFOV += 2.0f * deltaSpeed;
|
m_Freecam::m_fFOV += 2.0f * deltaSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 250, true);
|
TheCamera.LerpFOV(TheCamera.FindCamFOV(), m_Freecam::m_fFOV, 250, true);
|
||||||
Command<Commands::CAMERA_PERSIST_FOV>(true);
|
Command<Commands::CAMERA_PERSIST_FOV>(true);
|
||||||
@ -341,9 +361,13 @@ void Game::Draw()
|
|||||||
if (ImGui::Checkbox("Disable F1 & F3 replay", &m_bDisableReplay))
|
if (ImGui::Checkbox("Disable F1 & F3 replay", &m_bDisableReplay))
|
||||||
{
|
{
|
||||||
if (m_bDisableReplay)
|
if (m_bDisableReplay)
|
||||||
|
{
|
||||||
patch::SetInt(0x460500, 0xC3, false);
|
patch::SetInt(0x460500, 0xC3, false);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
patch::SetInt(0x460500, 0xBD844BB, false);
|
patch::SetInt(0x460500, 0xBD844BB, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::CheckboxAddress("Faster clock", 0x96913B);
|
Ui::CheckboxAddress("Faster clock", 0x96913B);
|
||||||
@ -352,9 +376,13 @@ void Game::Draw()
|
|||||||
of LS without completing missions"))
|
of LS without completing missions"))
|
||||||
{
|
{
|
||||||
if (m_bForbiddenArea)
|
if (m_bForbiddenArea)
|
||||||
|
{
|
||||||
patch::Set<BYTE>(0x441770, 0x83, false);
|
patch::Set<BYTE>(0x441770, 0x83, false);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
patch::Set<BYTE>(0x441770, 0xC3, false);
|
patch::Set<BYTE>(0x441770, 0xC3, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::CheckboxAddress("Free pay n spray", 0x96C009);
|
Ui::CheckboxAddress("Free pay n spray", 0x96C009);
|
||||||
@ -421,7 +449,10 @@ Lowers armour, health, stamina etc."))
|
|||||||
{
|
{
|
||||||
int day = CClock::CurrentDay - 1;
|
int day = CClock::CurrentDay - 1;
|
||||||
if (Ui::ListBox("Select day", m_DayNames, day))
|
if (Ui::ListBox("Select day", m_DayNames, day))
|
||||||
|
{
|
||||||
CClock::CurrentDay = day + 1;
|
CClock::CurrentDay = day + 1;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
}
|
}
|
||||||
@ -483,26 +514,38 @@ Lowers armour, health, stamina etc."))
|
|||||||
{
|
{
|
||||||
using func = void(void);
|
using func = void(void);
|
||||||
if (ImGui::Button("Foggy", Ui::GetSize(3)))
|
if (ImGui::Button("Foggy", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
((func*)0x438F80)();
|
((func*)0x438F80)();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Overcast", Ui::GetSize(3)))
|
if (ImGui::Button("Overcast", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
((func*)0x438F60)();
|
((func*)0x438F60)();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Rainy", Ui::GetSize(3)))
|
if (ImGui::Button("Rainy", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
((func*)0x438F70)();
|
((func*)0x438F70)();
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Sandstorm", Ui::GetSize(3)))
|
if (ImGui::Button("Sandstorm", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
((func*)0x439590)();
|
((func*)0x439590)();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Thunderstorm", Ui::GetSize(3)))
|
if (ImGui::Button("Thunderstorm", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
((func*)0x439570)();
|
((func*)0x439570)();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Very sunny", Ui::GetSize(3)))
|
if (ImGui::Button("Very sunny", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
((func*)0x438F50)();
|
((func*)0x438F50)();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@ -560,9 +603,11 @@ It's recommanded not to save after using the mission loader. Use it at your own
|
|||||||
{
|
{
|
||||||
for (auto _data : root.value().items())
|
for (auto _data : root.value().items())
|
||||||
{
|
{
|
||||||
auto name = _data.value().get<std::string>();
|
std::string name = _data.value().get<std::string>();
|
||||||
if (m_StatData.m_Filter.PassFilter(name.c_str()))
|
if (m_StatData.m_Filter.PassFilter(name.c_str()))
|
||||||
|
{
|
||||||
Ui::EditStat(name.c_str(), std::stoi(_data.key()));
|
Ui::EditStat(name.c_str(), std::stoi(_data.key()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -586,12 +631,14 @@ It's recommanded not to save after using the mission loader. Use it at your own
|
|||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if (ImGui::BeginChild("Cheats list"))
|
if (ImGui::BeginChild("Cheats list"))
|
||||||
{
|
{
|
||||||
for (auto element : m_RandomCheats::m_EnabledCheats)
|
for (std::string* element : m_RandomCheats::m_EnabledCheats)
|
||||||
{
|
{
|
||||||
bool selected = (element[1] == "true") ? true : false;
|
bool selected = (element[1] == "true") ? true : false;
|
||||||
|
|
||||||
if (ImGui::MenuItem(element[0].c_str(), nullptr, selected))
|
if (ImGui::MenuItem(element[0].c_str(), nullptr, selected))
|
||||||
|
{
|
||||||
element[1] = selected ? "false" : "true";
|
element[1] = selected ? "false" : "true";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
}
|
}
|
||||||
|
42
src/Hook.cpp
42
src/Hook.cpp
@ -37,7 +37,9 @@ HRESULT Hook::Reset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentat
|
|||||||
void Hook::RenderFrame(void* ptr)
|
void Hook::RenderFrame(void* ptr)
|
||||||
{
|
{
|
||||||
if (!ImGui::GetCurrentContext())
|
if (!ImGui::GetCurrentContext())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
@ -49,15 +51,19 @@ void Hook::RenderFrame(void* ptr)
|
|||||||
ImVec2 size(screen::GetScreenWidth(), screen::GetScreenHeight());
|
ImVec2 size(screen::GetScreenWidth(), screen::GetScreenHeight());
|
||||||
if (Globals::m_fScreenSize.x != size.x && Globals::m_fScreenSize.y != size.y)
|
if (Globals::m_fScreenSize.x != size.x && Globals::m_fScreenSize.y != size.y)
|
||||||
{
|
{
|
||||||
int font_size = static_cast<int>(size.y / 54.85f); // manually tested
|
int fontSize = static_cast<int>(size.y / 54.85f); // manually tested
|
||||||
|
|
||||||
io.FontDefault = io.Fonts->AddFontFromFileTTF("C:/Windows/Fonts/trebucbd.ttf", font_size);
|
io.FontDefault = io.Fonts->AddFontFromFileTTF("C:/Windows/Fonts/trebucbd.ttf", fontSize);
|
||||||
io.Fonts->Build();
|
io.Fonts->Build();
|
||||||
|
|
||||||
if (Globals::renderer == Render_DirectX9)
|
if (Globals::renderer == Render_DirectX9)
|
||||||
|
{
|
||||||
ImGui_ImplDX9_InvalidateDeviceObjects();
|
ImGui_ImplDX9_InvalidateDeviceObjects();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ImGui_ImplDX11_InvalidateDeviceObjects();
|
ImGui_ImplDX11_InvalidateDeviceObjects();
|
||||||
|
}
|
||||||
|
|
||||||
if (Globals::m_fScreenSize.x != -1 && Globals::m_fScreenSize.y != -1)
|
if (Globals::m_fScreenSize.x != -1 && Globals::m_fScreenSize.y != -1)
|
||||||
{
|
{
|
||||||
@ -66,36 +72,46 @@ void Hook::RenderFrame(void* ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGuiStyle* style = &ImGui::GetStyle();
|
ImGuiStyle* style = &ImGui::GetStyle();
|
||||||
float scale_x = size.x / 1366.0f;
|
float scaleX = size.x / 1366.0f;
|
||||||
float scale_y = size.y / 768.0f;
|
float scaleY = size.y / 768.0f;
|
||||||
|
|
||||||
style->FramePadding = ImVec2(5 * scale_x, 3 * scale_y);
|
style->FramePadding = ImVec2(5 * scaleX, 3 * scaleY);
|
||||||
style->ItemSpacing = ImVec2(8 * scale_x, 4 * scale_y);
|
style->ItemSpacing = ImVec2(8 * scaleX, 4 * scaleY);
|
||||||
style->ScrollbarSize = 12 * scale_x;
|
style->ScrollbarSize = 12 * scaleX;
|
||||||
style->IndentSpacing = 20 * scale_x;
|
style->IndentSpacing = 20 * scaleX;
|
||||||
style->ItemInnerSpacing = ImVec2(4 * scale_x, 4 * scale_y);
|
style->ItemInnerSpacing = ImVec2(4 * scaleX, 4 * scaleY);
|
||||||
|
|
||||||
Globals::m_fScreenSize = size;
|
Globals::m_fScreenSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui_ImplWin32_NewFrame();
|
ImGui_ImplWin32_NewFrame();
|
||||||
if (Globals::renderer == Render_DirectX9)
|
if (Globals::renderer == Render_DirectX9)
|
||||||
|
{
|
||||||
ImGui_ImplDX9_NewFrame();
|
ImGui_ImplDX9_NewFrame();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ImGui_ImplDX11_NewFrame();
|
ImGui_ImplDX11_NewFrame();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
|
||||||
if (window_callback != nullptr)
|
if (windowCallback != nullptr)
|
||||||
window_callback();
|
{
|
||||||
|
windowCallback();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::EndFrame();
|
ImGui::EndFrame();
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
|
|
||||||
if (Globals::renderer == Render_DirectX9)
|
if (Globals::renderer == Render_DirectX9)
|
||||||
|
{
|
||||||
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
|
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -240,10 +256,14 @@ static int _cdecl _GetMouseState(Mouse* pMouse)
|
|||||||
GetCursorPos(&Point);
|
GetCursorPos(&Point);
|
||||||
|
|
||||||
if (mouseInfo.x >= 0)
|
if (mouseInfo.x >= 0)
|
||||||
|
{
|
||||||
pMouse->x = int(Point.x - mouseInfo.x);
|
pMouse->x = int(Point.x - mouseInfo.x);
|
||||||
|
}
|
||||||
|
|
||||||
if (mouseInfo.y >= 0)
|
if (mouseInfo.y >= 0)
|
||||||
|
{
|
||||||
pMouse->y = int(Point.y - mouseInfo.y);
|
pMouse->y = int(Point.y - mouseInfo.y);
|
||||||
|
}
|
||||||
|
|
||||||
mouseInfo.wheelDelta = 0;
|
mouseInfo.wheelDelta = 0;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
inline static bool m_bShowMouse = false;
|
inline static bool m_bShowMouse = false;
|
||||||
inline static std::function<void()> window_callback = nullptr;
|
inline static std::function<void()> windowCallback = nullptr;
|
||||||
static void ApplyMouseFix();
|
static void ApplyMouseFix();
|
||||||
|
|
||||||
Hook();
|
Hook();
|
||||||
|
@ -407,23 +407,17 @@ void Player::Draw()
|
|||||||
{
|
{
|
||||||
if (ImGui::BeginTabItem("Clothes"))
|
if (ImGui::BeginTabItem("Clothes"))
|
||||||
{
|
{
|
||||||
|
static int bClothOption = 0;
|
||||||
|
ImGui::RadioButton("Add", &bClothOption, 0);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::RadioButton("Remove", &bClothOption, 1);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
if (pPlayer->m_nModelIndex == 0)
|
if (pPlayer->m_nModelIndex == 0)
|
||||||
{
|
{
|
||||||
if (ImGui::Button("Remove clothes", ImVec2(Ui::GetSize())))
|
if (bClothOption == 0)
|
||||||
{
|
{
|
||||||
CPlayerPed* player = FindPlayerPed();
|
Ui::DrawImages(m_ClothData.m_ImagesList, ImVec2(70, 100), m_ClothData.m_Categories, m_ClothData.m_Selected,
|
||||||
|
|
||||||
int temp = 0;
|
|
||||||
for (uint i = 0; i < 18; i++)
|
|
||||||
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(temp, temp, i);
|
|
||||||
|
|
||||||
CClothes::RebuildPlayer(player, false);
|
|
||||||
}
|
|
||||||
ImGui::Spacing();
|
|
||||||
|
|
||||||
Ui::DrawImages(m_ClothData.m_ImagesList, ImVec2(70, 100), m_ClothData.m_Categories, m_ClothData.m_Selected,
|
|
||||||
m_ClothData.m_Filter, ChangePlayerCloth, nullptr,
|
m_ClothData.m_Filter, ChangePlayerCloth, nullptr,
|
||||||
[](std::string str)
|
[](std::string str)
|
||||||
{
|
{
|
||||||
@ -435,6 +429,40 @@ void Player::Draw()
|
|||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}, nullptr, cloth_category, sizeof(cloth_category)/ sizeof(const char*));
|
}, nullptr, cloth_category, sizeof(cloth_category)/ sizeof(const char*));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
size_t count = 0;
|
||||||
|
|
||||||
|
if(ImGui::Button("Remove all", ImVec2(Ui::GetSize(2))))
|
||||||
|
{
|
||||||
|
CPlayerPed* player = FindPlayerPed();
|
||||||
|
for (uint i = 0; i < 18; i++)
|
||||||
|
{
|
||||||
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(0u, 0u, i);
|
||||||
|
}
|
||||||
|
CClothes::RebuildPlayer(player, false);
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
for (const char* clothName : cloth_category)
|
||||||
|
{
|
||||||
|
if(ImGui::Button(clothName, ImVec2(Ui::GetSize(2))))
|
||||||
|
{
|
||||||
|
CPlayerPed* player = FindPlayerPed();
|
||||||
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(0u, 0u, count);
|
||||||
|
CClothes::RebuildPlayer(player, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count %2 != 0)
|
||||||
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
}
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::TextWrapped("If CJ is wearing a full suit, click 'Extras/ Remove all' to remove it.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -20,41 +20,55 @@ Weapon::Weapon()
|
|||||||
if (CPad::NewMouseControllerState.X == 0 && CPad::NewMouseControllerState.Y == 0)
|
if (CPad::NewMouseControllerState.X == 0 && CPad::NewMouseControllerState.Y == 0)
|
||||||
{
|
{
|
||||||
if (KeyPressed(2))
|
if (KeyPressed(2))
|
||||||
|
{
|
||||||
CCamera::m_bUseMouse3rdPerson = false;
|
CCamera::m_bUseMouse3rdPerson = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
CCamera::m_bUseMouse3rdPerson = true;
|
CCamera::m_bUseMouse3rdPerson = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uchar slot = player->m_nActiveWeaponSlot;
|
uchar slot = player->m_nActiveWeaponSlot;
|
||||||
if (m_nCurrentWeaponSlot != slot)
|
if (m_nCurrentWeaponSlot != slot)
|
||||||
{
|
{
|
||||||
auto weapon_type = player->m_aWeapons[slot].m_nType;
|
eWeaponType weaponType = player->m_aWeapons[slot].m_nType;
|
||||||
CWeaponInfo* pweapon_info = CWeaponInfo::GetWeaponInfo(weapon_type, player->GetWeaponSkill(weapon_type));
|
CWeaponInfo* pWeaponInfo = CWeaponInfo::GetWeaponInfo(weaponType, player->GetWeaponSkill(weaponType));
|
||||||
|
|
||||||
if (m_bHugeDamage)
|
if (m_bHugeDamage)
|
||||||
pweapon_info->m_nDamage = 1000;
|
{
|
||||||
|
pWeaponInfo->m_nDamage = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_bLongRange)
|
if (m_bLongRange)
|
||||||
{
|
{
|
||||||
pweapon_info->m_fTargetRange = 1000.0f;
|
pWeaponInfo->m_fTargetRange = 1000.0f;
|
||||||
pweapon_info->m_fWeaponRange = 1000.0f;
|
pWeaponInfo->m_fWeaponRange = 1000.0f;
|
||||||
pweapon_info->m_fAccuracy = 1.0f;
|
pWeaponInfo->m_fAccuracy = 1.0f;
|
||||||
pweapon_info->m_nFlags.bReload2Start = true;
|
pWeaponInfo->m_nFlags.bReload2Start = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_bRapidFire && weapon_type != WEAPON_MINIGUN) // mingun doesn't work with rapidfire
|
if (m_bRapidFire && weaponType != WEAPON_MINIGUN) // mingun doesn't work with rapidfire
|
||||||
pweapon_info->m_nFlags.bContinuosFire = true;
|
{
|
||||||
|
pWeaponInfo->m_nFlags.bContinuosFire = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_bDualWeild && (weapon_type == WEAPON_PISTOL || weapon_type == WEAPON_MICRO_UZI || weapon_type ==
|
if (m_bDualWeild && (weaponType == WEAPON_PISTOL || weaponType == WEAPON_MICRO_UZI || weaponType ==
|
||||||
WEAPON_TEC9 || weapon_type == WEAPON_SAWNOFF))
|
WEAPON_TEC9 || weaponType == WEAPON_SAWNOFF))
|
||||||
pweapon_info->m_nFlags.bTwinPistol = true;
|
{
|
||||||
|
pWeaponInfo->m_nFlags.bTwinPistol = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_bMoveAim)
|
if (m_bMoveAim)
|
||||||
pweapon_info->m_nFlags.bMoveAim = true;
|
{
|
||||||
|
pWeaponInfo->m_nFlags.bMoveAim = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_bMoveFire)
|
if (m_bMoveFire)
|
||||||
pweapon_info->m_nFlags.bMoveFire = true;
|
{
|
||||||
|
pWeaponInfo->m_nFlags.bMoveFire = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_nCurrentWeaponSlot = slot;
|
m_nCurrentWeaponSlot = slot;
|
||||||
}
|
}
|
||||||
@ -75,7 +89,9 @@ void Weapon::GiveWeaponToPlayer(std::string& weapon_type)
|
|||||||
int hplayer = CPools::GetPedRef(player);
|
int hplayer = CPools::GetPedRef(player);
|
||||||
|
|
||||||
if (weapon_type == "-1") // Jetpack
|
if (weapon_type == "-1") // Jetpack
|
||||||
|
{
|
||||||
Command<Commands::TASK_JETPACK>(hplayer);
|
Command<Commands::TASK_JETPACK>(hplayer);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int iweapon_type = std::stoi(weapon_type);
|
int iweapon_type = std::stoi(weapon_type);
|
||||||
@ -86,14 +102,17 @@ void Weapon::GiveWeaponToPlayer(std::string& weapon_type)
|
|||||||
CStreaming::RequestModel(model, PRIORITY_REQUEST);
|
CStreaming::RequestModel(model, PRIORITY_REQUEST);
|
||||||
|
|
||||||
if (model == 363) // remote bomb
|
if (model == 363) // remote bomb
|
||||||
|
{
|
||||||
CStreaming::RequestModel(364, PRIORITY_REQUEST); // detonator
|
CStreaming::RequestModel(364, PRIORITY_REQUEST); // detonator
|
||||||
|
}
|
||||||
|
|
||||||
CStreaming::LoadAllRequestedModels(false);
|
CStreaming::LoadAllRequestedModels(false);
|
||||||
|
|
||||||
Command<Commands::GIVE_WEAPON_TO_CHAR>(hplayer, iweapon_type, m_nAmmoCount);
|
Command<Commands::GIVE_WEAPON_TO_CHAR>(hplayer, iweapon_type, m_nAmmoCount);
|
||||||
|
|
||||||
if (model == 363) // remote bomb
|
if (model == 363) // remote bomb
|
||||||
|
{
|
||||||
Command<Commands::MARK_MODEL_AS_NO_LONGER_NEEDED>(364); // detonator
|
Command<Commands::MARK_MODEL_AS_NO_LONGER_NEEDED>(364); // detonator
|
||||||
|
}
|
||||||
|
|
||||||
Command<Commands::MARK_MODEL_AS_NO_LONGER_NEEDED>(model);
|
Command<Commands::MARK_MODEL_AS_NO_LONGER_NEEDED>(model);
|
||||||
}
|
}
|
||||||
@ -101,33 +120,37 @@ void Weapon::GiveWeaponToPlayer(std::string& weapon_type)
|
|||||||
|
|
||||||
void Weapon::Draw()
|
void Weapon::Draw()
|
||||||
{
|
{
|
||||||
CPlayerPed* player = FindPlayerPed();
|
CPlayerPed* pPlayer = FindPlayerPed();
|
||||||
uint hplayer = CPools::GetPedRef(player);
|
uint hplayer = CPools::GetPedRef(pPlayer);
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::Button("Drop weapon", Ui::GetSize(3)))
|
if (ImGui::Button("Drop weapon", Ui::GetSize(3)))
|
||||||
{
|
{
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
Command<Commands::GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS>(hplayer, 0.0, 3.0, 0.0, &x, &y, &z);
|
Command<Commands::GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS>(hplayer, 0.0, 3.0, 0.0, &x, &y, &z);
|
||||||
auto type = player->m_aWeapons[player->m_nActiveWeaponSlot].m_nType;
|
eWeaponType weaponType = pPlayer->m_aWeapons[pPlayer->m_nActiveWeaponSlot].m_nType;
|
||||||
|
|
||||||
if (type)
|
if (weaponType)
|
||||||
{
|
{
|
||||||
int model = 0, pickup = 0;
|
int model = 0, pickup = 0;
|
||||||
|
|
||||||
Command<Commands::GET_WEAPONTYPE_MODEL>(type, &model);
|
Command<Commands::GET_WEAPONTYPE_MODEL>(weaponType, &model);
|
||||||
Command<Commands::CREATE_PICKUP_WITH_AMMO>(model, 3, 999, x, y, z, &pickup);
|
Command<Commands::CREATE_PICKUP_WITH_AMMO>(model, 3, 999, x, y, z, &pickup);
|
||||||
|
|
||||||
Command<Commands::REMOVE_WEAPON_FROM_CHAR>(hplayer, type);
|
Command<Commands::REMOVE_WEAPON_FROM_CHAR>(hplayer, weaponType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Remove all", Ui::GetSize(3)))
|
if (ImGui::Button("Remove all", Ui::GetSize(3)))
|
||||||
|
{
|
||||||
Command<Commands::REMOVE_ALL_CHAR_WEAPONS>(hplayer);
|
Command<Commands::REMOVE_ALL_CHAR_WEAPONS>(hplayer);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Remove current", Ui::GetSize(3)))
|
if (ImGui::Button("Remove current", Ui::GetSize(3)))
|
||||||
Command<Commands::REMOVE_WEAPON_FROM_CHAR>(hplayer, player->m_aWeapons[player->m_nActiveWeaponSlot].m_nType);
|
{
|
||||||
|
Command<Commands::REMOVE_WEAPON_FROM_CHAR>(hplayer, pPlayer->m_aWeapons[pPlayer->m_nActiveWeaponSlot].m_nType);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
@ -145,12 +168,16 @@ void Weapon::Draw()
|
|||||||
"Dual wield pistol, shawoff, uzi, tec9\n(Other weapons don't work)"))
|
"Dual wield pistol, shawoff, uzi, tec9\n(Other weapons don't work)"))
|
||||||
{
|
{
|
||||||
if (!m_bDualWeild)
|
if (!m_bDualWeild)
|
||||||
|
{
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Ui::CheckboxWithHint("Huge damage", &m_bHugeDamage))
|
if (Ui::CheckboxWithHint("Huge damage", &m_bHugeDamage))
|
||||||
{
|
{
|
||||||
if (!m_bHugeDamage)
|
if (!m_bHugeDamage)
|
||||||
|
{
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Ui::CheckboxWithHint("Fast reload", &m_bFastReload))
|
if (Ui::CheckboxWithHint("Fast reload", &m_bFastReload))
|
||||||
Command<Commands::SET_PLAYER_FAST_RELOAD>(hplayer, m_bFastReload);
|
Command<Commands::SET_PLAYER_FAST_RELOAD>(hplayer, m_bFastReload);
|
||||||
@ -162,22 +189,30 @@ void Weapon::Draw()
|
|||||||
if (Ui::CheckboxWithHint("Long range", &m_bLongRange))
|
if (Ui::CheckboxWithHint("Long range", &m_bLongRange))
|
||||||
{
|
{
|
||||||
if (!m_bLongRange)
|
if (!m_bLongRange)
|
||||||
|
{
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Ui::CheckboxWithHint("Move when aiming", &m_bMoveAim))
|
if (Ui::CheckboxWithHint("Move when aiming", &m_bMoveAim))
|
||||||
{
|
{
|
||||||
if (!m_bMoveAim)
|
if (!m_bMoveAim)
|
||||||
|
{
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Ui::CheckboxWithHint("Move when firing", &m_bMoveFire))
|
if (Ui::CheckboxWithHint("Move when firing", &m_bMoveFire))
|
||||||
{
|
{
|
||||||
if (!m_bMoveFire)
|
if (!m_bMoveFire)
|
||||||
|
{
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Ui::CheckboxWithHint("Rapid fire", &m_bRapidFire))
|
if (Ui::CheckboxWithHint("Rapid fire", &m_bRapidFire))
|
||||||
{
|
{
|
||||||
if (!m_bRapidFire)
|
if (!m_bRapidFire)
|
||||||
|
{
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::Columns(1, 0, false);
|
ImGui::Columns(1, 0, false);
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
cd tools
|
||||||
premake5.exe vs2019
|
premake5.exe vs2019
|
||||||
cd build
|
cd ../build
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
|
||||||
MsBuild CheatMenu.sln /property:Configuration=Debug
|
MsBuild CheatMenu.sln /property:Configuration=Debug
|
||||||
cd ..
|
cd ..
|
@ -1,6 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
cd tools
|
||||||
premake5.exe vs2019
|
premake5.exe vs2019
|
||||||
cd build
|
cd ../build
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
|
||||||
MsBuild CheatMenu.sln /property:Configuration=Release
|
MsBuild CheatMenu.sln /property:Configuration=Release
|
||||||
cd ..
|
cd ..
|
@ -24,17 +24,17 @@ workspace "CheatMenu"
|
|||||||
cppdialect "C++20"
|
cppdialect "C++20"
|
||||||
characterset "MBCS"
|
characterset "MBCS"
|
||||||
staticruntime "On"
|
staticruntime "On"
|
||||||
location "build"
|
location "../build"
|
||||||
|
|
||||||
project "Depend"
|
project "Depend"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
targetdir "build/bin"
|
targetdir "../build/bin"
|
||||||
|
|
||||||
files {
|
files {
|
||||||
"depned/**.h",
|
"../depned/**.h",
|
||||||
"depend/**.hpp",
|
"../depend/**.hpp",
|
||||||
"depend/**.c",
|
"../depend/**.c",
|
||||||
"depend/**.cpp"
|
"../depend/**.cpp"
|
||||||
}
|
}
|
||||||
libdirs (PSDK_DIR .. "/output/lib")
|
libdirs (PSDK_DIR .. "/output/lib")
|
||||||
|
|
||||||
@ -52,9 +52,9 @@ project "CheatMenu"
|
|||||||
targetextension ".asi"
|
targetextension ".asi"
|
||||||
|
|
||||||
files {
|
files {
|
||||||
"src/**.h",
|
"../src/**.h",
|
||||||
"src/**.hpp",
|
"../src/**.hpp",
|
||||||
"src/**.cpp"
|
"../src/**.cpp"
|
||||||
}
|
}
|
||||||
includedirs {
|
includedirs {
|
||||||
PSDK_DIR .. "/plugin_sa/",
|
PSDK_DIR .. "/plugin_sa/",
|
||||||
@ -75,7 +75,7 @@ project "CheatMenu"
|
|||||||
}
|
}
|
||||||
|
|
||||||
pchheader "pch.h"
|
pchheader "pch.h"
|
||||||
pchsource "src/pch.cpp"
|
pchsource "../src/pch.cpp"
|
||||||
|
|
||||||
filter "configurations:Debug"
|
filter "configurations:Debug"
|
||||||
symbols "On"
|
symbols "On"
|
Loading…
Reference in New Issue
Block a user