Fix color changer not working (vc)

This commit is contained in:
Grinch_ 2021-08-13 09:51:00 +06:00
parent 45f033f2d2
commit 09217144ac
5 changed files with 15 additions and 7 deletions

View File

@ -250,7 +250,6 @@ 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);
}
#elif GTAVC
MessageBox(RsGlobal.ps->window, "Unknown game version. GTA VC v1.0 EN is required.", "CheatMenu", MB_ICONERROR);
if (gameVersion == GAME_10EN)
{

View File

@ -23,7 +23,7 @@
#include "Weapon.h"
class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon
#elif GTAVC
class CheatMenu : Hook, Animation, Menu, Player, Ped, Teleport
class CheatMenu : Hook, Animation, Menu, Player, Ped, Teleport, Vehicle
#endif
{

View File

@ -2,5 +2,5 @@
#define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "2.9"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta"
#define BUILD_NUMBER "20210806"
#define BUILD_NUMBER "20210813"
#define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")"

View File

@ -10,7 +10,6 @@ ResourceStore::ResourceStore(const char* text, eResourceType type)
{
if (!m_bTexturesLoaded)
{
// LoadTextureDirectory(ResourceStore& data, char* path, bool pass_full_name)
LoadTextureResource(text);
m_bTexturesLoaded = true;
}

View File

@ -33,10 +33,10 @@ Vehicle::Vehicle()
#ifdef GTASA
ParseVehiclesIDE();
#endif
ParseCarcolsDAT();
Events::processScriptsEvent += [this]
{
ParseCarcolsDAT();
uint timer = CTimer::m_snTimeInMilliseconds;
CPlayerPed* pPlayer = FindPlayerPed();
CVehicle* pVeh = pPlayer->m_pVehicle;
@ -1145,8 +1145,11 @@ void Vehicle::Draw()
Paint::SetNodeColor(veh, Paint::veh_nodes::selected, { r, g, b, 255 }, m_Color::m_bMatFilter);
}
#endif
ImGui::Spacing();
ImGui::Columns(2, NULL, false);
#ifdef GTASA
ImGui::Checkbox("Material filter", &m_Color::m_bMatFilter);
ImGui::RadioButton("Primary", &m_Color::m_nRadioButton, 1);
ImGui::RadioButton("Secondary", &m_Color::m_nRadioButton, 2);
@ -1154,6 +1157,13 @@ void Vehicle::Draw()
ImGui::Checkbox("Show all", &m_Color::bShowAll);
ImGui::RadioButton("Tertiary", &m_Color::m_nRadioButton, 3);
ImGui::RadioButton("Quaternary", &m_Color::m_nRadioButton, 4);
#elif GTAVC
ImGui::Checkbox("Show all", &m_Color::bShowAll);
ImGui::RadioButton("Primary", &m_Color::m_nRadioButton, 1);
ImGui::NextColumn();
ImGui::NewLine();
ImGui::RadioButton("Secondary", &m_Color::m_nRadioButton, 2);
#endif
ImGui::Spacing();
ImGui::Columns(1);
ImGui::Text("Select color preset:");
@ -1174,7 +1184,7 @@ void Vehicle::Draw()
{
if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId], ImVec2(btnSize, btnSize)))
{
*(uint8_replacement*)(int(veh) + 0x433 + m_Color::m_nRadioButton) = colorId;
*(uint8_replacement*)(int(veh) + BY_GAME(0x433, 0x19F) + m_Color::m_nRadioButton) = colorId;
}
if ((colorId + 1) % btnsInRow != 0)
@ -1196,7 +1206,7 @@ void Vehicle::Draw()
if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId],
ImVec2(btnSize, btnSize)))
{
*(uint8_replacement*)(int(veh) + 0x433 + m_Color::m_nRadioButton) = colorId;
*(uint8_replacement*)(int(veh) + BY_GAME(0x433, 0x19F) + m_Color::m_nRadioButton) = colorId;
}
if (count % btnsInRow != 0)