Finish visual tab

This commit is contained in:
Grinch_ 2021-10-25 20:03:27 +06:00
parent 26a671c4e5
commit 2a18a72b9e
47 changed files with 7444 additions and 7291 deletions

View File

@ -1,11 +0,0 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: Microsoft
IndentWidth: 4
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Right
AccessModifierOffset: -4
---

View File

@ -1,14 +1,13 @@
#include "animation.h"
#include "pch.h" #include "pch.h"
#include "animation.h"
#ifdef GTASA #ifdef GTASA
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
Animation::Animation() Animation::Animation()
{ {
Events::processScriptsEvent += [this] { Events::processScriptsEvent += [this]
{
if (m_Cutscene::m_bRunning) if (m_Cutscene::m_bRunning)
{ {
if (Command<Commands::HAS_CUTSCENE_FINISHED>()) if (Command<Commands::HAS_CUTSCENE_FINISHED>())

View File

@ -5,6 +5,7 @@
class Animation class Animation
{ {
private: private:
// Animation player // Animation player
static inline ResourceStore m_AnimData{ "animation", eResourceType::TYPE_TEXT }; static inline ResourceStore m_AnimData{ "animation", eResourceType::TYPE_TEXT };
static inline char m_nAnimBuffer[INPUT_BUFFER_SIZE]; static inline char m_nAnimBuffer[INPUT_BUFFER_SIZE];
@ -23,12 +24,14 @@ private:
static inline int m_nFightingStyle; static inline int m_nFightingStyle;
static inline std::string m_nWalkingStyle = "default"; static inline std::string m_nWalkingStyle = "default";
static inline std::vector<std::string> m_FightingStyleList = {"Default", "Boxing", "Kung fu", "Kick Boxing", static inline std::vector<std::string> m_FightingStyleList =
"Punch Kick"}; { "Default", "Boxing", "Kung fu", "Kick Boxing", "Punch Kick" };
static inline std::vector<std::string> m_WalkingStyleList = { static inline std::vector<std::string> m_WalkingStyleList =
"default", "man", "shuffle", "oldman", "gang1", "gang2", "oldfatman", "fatman", {
"jogger", "drunkman", "blindman", "swat", "woman", "shopping", "busywoman", "sexywoman", "default", "man", "shuffle", "oldman", "gang1", "gang2", "oldfatman",
"pro", "oldwoman", "fatwoman", "jogwoman", "oldfatwoman", "skate"}; "fatman", "jogger", "drunkman", "blindman", "swat", "woman", "shopping", "busywoman",
"sexywoman", "pro", "oldwoman", "fatwoman", "jogwoman", "oldfatwoman", "skate"
};
protected: protected:
Animation(); Animation();
@ -42,7 +45,5 @@ public:
#else #else
// Dummy Class for VC & III // Dummy Class for VC & III
class Animation class Animation{};
{
};
#endif #endif

View File

@ -1,6 +1,6 @@
#include "pch.h"
#include "cheatMenu.h" #include "cheatMenu.h"
#include "menuinfo.h" #include "menuinfo.h"
#include "pch.h"
#include "ui.h" #include "ui.h"
#include "updater.h" #include "updater.h"
@ -9,8 +9,7 @@ void CheatMenu::DrawWindow()
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
static bool bRunning = true; static bool bRunning = true;
if (BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible, if (BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible, FrontEndMenuManager.m_bMenuActive))
FrontEndMenuManager.m_bMenuActive))
{ {
if (bRunning) if (bRunning)
{ {
@ -77,9 +76,9 @@ CheatMenu::CheatMenu()
m_fMenuSize.y = gConfig.GetValue("window.sizeY", screen::GetScreenHeight() / 1.2f); m_fMenuSize.y = gConfig.GetValue("window.sizeY", screen::GetScreenHeight() / 1.2f);
srand(CTimer::m_snTimeInMilliseconds); srand(CTimer::m_snTimeInMilliseconds);
Events::processScriptsEvent += []() { Events::processScriptsEvent += []()
if (!BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible, {
FrontEndMenuManager.m_bMenuActive)) if (!BY_GAME(FrontEndMenuManager.m_bMenuActive, FrontendMenuManager.m_bMenuVisible, FrontEndMenuManager.m_bMenuActive))
{ {
if (menuOpen.Pressed()) if (menuOpen.Pressed())
{ {

View File

@ -9,9 +9,6 @@
*/ */
#pragma once #pragma once
#ifndef GTA3
#include "visual.h"
#endif
#include "animation.h" #include "animation.h"
#include "game.h" #include "game.h"
#include "hook.h" #include "hook.h"
@ -20,24 +17,15 @@
#include "player.h" #include "player.h"
#include "teleport.h" #include "teleport.h"
#include "vehicle.h" #include "vehicle.h"
#include "visual.h"
#include "weapon.h" #include "weapon.h"
#ifndef GTA3
class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Visual, Weapon
#else
class CheatMenu : Hook, Animation, Game, Menu, Ped, Player, Teleport, Vehicle, Weapon
#endif
{ {
private: private:
static inline bool m_bShowMenu = false; static inline bool m_bShowMenu = false;
static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2); static inline ImVec2 m_fMenuSize = ImVec2(screen::GetScreenWidth() / 4, screen::GetScreenHeight() / 1.2);
#ifdef GTA3
static inline CallbackTable header{
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw}, {"Dummy", nullptr},
{"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, {"Game", &Game::Draw}, {"Menu", &Menu::Draw},
};
#else
static inline CallbackTable header{ static inline CallbackTable header{
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw}, {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw},
#ifdef GTASA #ifdef GTASA
@ -46,8 +34,8 @@ private:
{"Dummy", nullptr}, {"Dummy", nullptr},
#endif #endif
{"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, {"Game", &Game::Draw}, {"Vehicle", &Vehicle::Draw}, {"Weapon", &Weapon::Draw}, {"Game", &Game::Draw},
{"Visual", &Visual::Draw}, {"Menu", &Menu::Draw}}; {"Visual", &Visual::Draw}, {"Menu", &Menu::Draw}
#endif };
static void ApplyStyle(); static void ApplyStyle();
static void DrawWindow(); static void DrawWindow();

View File

@ -1,8 +1,8 @@
#include "cheatmenu.h"
#include "hook.h"
#include "menuinfo.h"
#include "pch.h" #include "pch.h"
#include "hook.h"
#include "cheatmenu.h"
#include "updater.h" #include "updater.h"
#include "menuinfo.h"
void MenuThread(void* param) void MenuThread(void* param)
{ {
@ -14,9 +14,7 @@ void MenuThread(void *param)
*/ */
if (!std::filesystem::is_directory(PLUGIN_PATH((char*)"CheatMenu"))) if (!std::filesystem::is_directory(PLUGIN_PATH((char*)"CheatMenu")))
{ {
gLog << "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same " gLog << "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory" << std::endl;
"directory"
<< std::endl;
return; return;
} }
@ -27,7 +25,10 @@ void MenuThread(void *param)
static bool bGameInit = false; static bool bGameInit = false;
// Wait till game init // Wait till game init
Events::initRwEvent += [] { bGameInit = true; }; Events::initRwEvent += []
{
bGameInit = true;
};
while (!bGameInit) while (!bGameInit)
{ {
@ -47,11 +48,11 @@ void MenuThread(void *param)
CFastman92limitAdjuster::Init(); CFastman92limitAdjuster::Init();
#endif #endif
gLog << "Starting...\nVersion: " MENU_TITLE "\nAuthor: Grinch_\nDiscord: " DISCORD_INVITE gLog << "Starting...\nVersion: " MENU_TITLE "\nAuthor: Grinch_\nDiscord: " DISCORD_INVITE "\nMore Info: "
"\nMore Info: " GITHUB_LINK "\n" GITHUB_LINK "\n" << std::endl;
<< std::endl;
CheatMenu menu; CheatMenu menu;
// Checking for updates once a day // Checking for updates once a day
time_t now = time(0); time_t now = time(0);
struct tm tstruct = *localtime(&now); struct tm tstruct = *localtime(&now);

View File

@ -1,5 +1,5 @@
#include "filehandler.h"
#include "pch.h" #include "pch.h"
#include "filehandler.h"
#include "visual.h" #include "visual.h"
// TODO: Clean up this mess, use structures instead? // TODO: Clean up this mess, use structures instead?
@ -46,16 +46,17 @@ void FileHandler::GenerateHandlingFile(int pHandling, std::map<int, std::string>
float fSeatOffsetDistance = patch::Get<float>(pHandling + 0xD4); float fSeatOffsetDistance = patch::Get<float>(pHandling + 0xD4);
// TODO: make this more readable // TODO: make this more readable
fprintf(fp, fprintf(
"\n%s\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%d\t%d\t%.5g\t%.5g\t%c\t%c\t%.5g\t%.5g\t%" fp,
"d\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%d\t%d\t%d\t%d\t%d", "\n%s\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%d\t%d\t%.5g\t%.5g\t%c\t%c\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%d\t%d\t%d\t%d\t%d",
handlingId.c_str(), fMass, fTurnMass, fDragMult, CentreOfMassX, CentreOfMassY, CentreOfMassZ, handlingId.c_str(), fMass, fTurnMass, fDragMult, CentreOfMassX, CentreOfMassY, CentreOfMassZ, nPercentSubmerged,
nPercentSubmerged, fTractionMultiplier, fTractionLoss, TractionBias, nNumberOfGears, MaxVelocity, fTractionMultiplier, fTractionLoss, TractionBias, nNumberOfGears,
fEngineAcceleration, fEngineInertia, nDriveType, nEngineType, BrakeDeceleration, BrakeBias, ABS, MaxVelocity, fEngineAcceleration, fEngineInertia, nDriveType, nEngineType, BrakeDeceleration, BrakeBias, ABS,
SteeringLock, SuspensionForceLevel, SuspensionDampingLevel, SuspensionHighSpdComDamp, SteeringLock, SuspensionForceLevel, SuspensionDampingLevel,
Suspension_upper_limit, Suspension_lower_limit, Suspension_bias, Suspension_anti_dive_multiplier, SuspensionHighSpdComDamp, Suspension_upper_limit, Suspension_lower_limit, Suspension_bias,
fSeatOffsetDistance, fCollisionDamageMultiplier, nMonetaryValue, modelFlags, handlingFlags, front_lights, Suspension_anti_dive_multiplier, fSeatOffsetDistance,
rear_lights, vehicle_anim_group); fCollisionDamageMultiplier, nMonetaryValue, modelFlags, handlingFlags, front_lights, rear_lights,
vehicle_anim_group);
fclose(fp); fclose(fp);
} }

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <map> #include <map>
#include <string>
#include <vector> #include <vector>
#include <string>
class FileHandler class FileHandler
{ {
@ -21,3 +21,4 @@ public:
static void FetchHandlingID(std::map<int, std::string>& storeMap); static void FetchHandlingID(std::map<int, std::string>& storeMap);
static void GenerateHandlingFile(int pHandling, std::map<int, std::string>& storeMap); static void GenerateHandlingFile(int pHandling, std::map<int, std::string>& storeMap);
}; };

View File

@ -1,9 +1,8 @@
#include "game.h"
#include "menu.h"
#include "pch.h" #include "pch.h"
#include "menu.h"
#include "game.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#ifdef GTASA #ifdef GTASA
#include <CIplStore.h> #include <CIplStore.h>
#include <CMessages.h> #include <CMessages.h>
@ -51,7 +50,8 @@ Game::Game()
m_RandomCheats::m_EnabledCheats[std::stoi(element.key())][1] = "true"; m_RandomCheats::m_EnabledCheats[std::stoi(element.key())][1] = "true";
} }
Events::drawMenuBackgroundEvent += []() { Events::drawMenuBackgroundEvent += []()
{
if (bSaveGameFlag) if (bSaveGameFlag)
{ {
FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE; FrontEndMenuManager.m_nCurrentMenuPage = MENUPAGE_GAME_SAVE;
@ -59,7 +59,8 @@ Game::Game()
} }
}; };
Events::drawingEvent += []() { Events::drawingEvent += []()
{
if (m_RandomCheats::m_bEnabled && m_RandomCheats::m_bProgressBar) if (m_RandomCheats::m_bEnabled && m_RandomCheats::m_bProgressBar)
{ {
// Next cheat timer bar // Next cheat timer bar
@ -80,7 +81,8 @@ Game::Game()
}; };
#endif #endif
Events::processScriptsEvent += [] { Events::processScriptsEvent += []
{
uint timer = CTimer::m_snTimeInMilliseconds; uint timer = CTimer::m_snTimeInMilliseconds;
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
int hplayer = CPools::GetPedRef(pPlayer); int hplayer = CPools::GetPedRef(pPlayer);
@ -185,8 +187,7 @@ Game::Game()
if (m_RandomCheats::m_EnabledCheats[i][1] == "true") if (m_RandomCheats::m_EnabledCheats[i][1] == "true")
{ {
Call<0x00438370>(id); // cheatEnableLegimate(int CheatID) Call<0x00438370>(id); // cheatEnableLegimate(int CheatID)
CMessages::AddMessage((char *)m_RandomCheats::m_EnabledCheats[i][0].c_str(), 2000, 0, CMessages::AddMessage((char*)m_RandomCheats::m_EnabledCheats[i][0].c_str(), 2000, 0, false);
false);
m_RandomCheats::m_nTimer = timer; m_RandomCheats::m_nTimer = timer;
} }
break; break;
@ -222,7 +223,8 @@ void SetPlayerMission(std::string &rootkey, std::string &name, std::string &id)
#ifdef GTASA #ifdef GTASA
void Game::FreeCam() void Game::FreeCam()
{ {
int delta = (CTimer::m_snTimeInMillisecondsNonClipped - CTimer::m_snPreviousTimeInMillisecondsNonClipped); int delta = (CTimer::m_snTimeInMillisecondsNonClipped -
CTimer::m_snPreviousTimeInMillisecondsNonClipped);
int ratio = 1 / (1 + (delta * m_Freecam::m_nMul)); int ratio = 1 / (1 + (delta * m_Freecam::m_nMul));
int speed = m_Freecam::m_nMul + m_Freecam::m_nMul * ratio * delta; int speed = m_Freecam::m_nMul + m_Freecam::m_nMul * ratio * delta;
@ -351,8 +353,7 @@ void Game::FreeCam()
} }
m_Freecam::m_pPed->SetHeading(m_Freecam::m_fTotalMouse.x); m_Freecam::m_pPed->SetHeading(m_Freecam::m_fTotalMouse.x);
Command<Commands::ATTACH_CAMERA_TO_CHAR>(m_Freecam::m_nPed, 0.0, 0.0, 20.0, 90.0, 180, m_Freecam::m_fTotalMouse.y, Command<Commands::ATTACH_CAMERA_TO_CHAR>(m_Freecam::m_nPed, 0.0, 0.0, 20.0, 90.0, 180, m_Freecam::m_fTotalMouse.y, 0.0, 2);
0.0, 2);
m_Freecam::m_pPed->SetPosn(pos); m_Freecam::m_pPed->SetPosn(pos);
CIplStore::AddIplsNeededAtPosn(pos); CIplStore::AddIplsNeededAtPosn(pos);
} }
@ -467,8 +468,7 @@ of LS without completing missions"))
} }
else else
{ {
patch::SetRaw(BY_GAME(0x52CF10, 0x487010, 0x473460), patch::SetRaw(BY_GAME(0x52CF10, 0x487010, 0x473460), (char*)BY_GAME("\x56\x8B", "\x6A\x01", "\x6A\x01"), 2);
(char *)BY_GAME("\x56\x8B", "\x6A\x01", "\x6A\x01"), 2);
} }
} }
@ -480,8 +480,7 @@ of LS without completing missions"))
Command<Commands::FREEZE_ONSCREEN_TIMER>(m_bMissionTimer); Command<Commands::FREEZE_ONSCREEN_TIMER>(m_bMissionTimer);
} }
#ifdef GTASA #ifdef GTASA
if (Ui::CheckboxWithHint("Hard mode", &m_HardMode::m_bEnabled, if (Ui::CheckboxWithHint("Hard mode", &m_HardMode::m_bEnabled, "Makes the game more challanging to play. \n\
"Makes the game more challanging to play. \n\
Lowers armour, health, stamina etc.")) Lowers armour, health, stamina etc."))
{ {
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
@ -509,9 +508,8 @@ Lowers armour, health, stamina etc."))
Command<Commands::SWITCH_DEATH_PENALTIES>(m_bKeepStuff); Command<Commands::SWITCH_DEATH_PENALTIES>(m_bKeepStuff);
} }
Ui::CheckboxWithHint("Screenshot shortcut", &m_bScreenShot, Ui::CheckboxWithHint("Screenshot shortcut", &m_bScreenShot,
(("Take screenshot using ") + quickSceenShot.GetNameString() + (("Take screenshot using ") + quickSceenShot.GetNameString()
"\nSaved inside 'GTA San Andreas User Files\\Gallery'") + "\nSaved inside 'GTA San Andreas User Files\\Gallery'").c_str());
.c_str());
Ui::CheckboxWithHint("Solid water", &m_bSolidWater, Ui::CheckboxWithHint("Solid water", &m_bSolidWater,
"Player can walk on water\nTurn this off if you want to swim."); "Player can walk on water\nTurn this off if you want to swim.");
#endif #endif
@ -578,19 +576,15 @@ Lowers armour, health, stamina etc."))
if (ImGui::InputInt("Hour", &hour)) if (ImGui::InputInt("Hour", &hour))
{ {
if (hour < 0) if (hour < 0) hour = 23;
hour = 23; if (hour > 23) hour = 0;
if (hour > 23)
hour = 0;
CClock::ms_nGameClockHours = hour; CClock::ms_nGameClockHours = hour;
} }
if (ImGui::InputInt("Minute", &minute)) if (ImGui::InputInt("Minute", &minute))
{ {
if (minute < 0) if (minute < 0) minute = 59;
minute = 59; if (minute > 59) minute = 0;
if (minute > 59)
minute = 0;
CClock::ms_nGameClockMinutes = minute; CClock::ms_nGameClockMinutes = minute;
} }
@ -599,7 +593,8 @@ Lowers armour, health, stamina etc."))
} }
#ifdef GTASA #ifdef GTASA
static std::vector<Ui::NamedMemory> themes{ static std::vector<Ui::NamedMemory> themes{
{"Beach", 0x969159}, {"Country", 0x96917D}, {"Fun house", 0x969176}, {"Ninja", 0x96915C}}; {"Beach", 0x969159}, {"Country", 0x96917D}, {"Fun house", 0x969176}, {"Ninja", 0x96915C}
};
Ui::EditRadioButtonAddress("Themes", themes); Ui::EditRadioButtonAddress("Themes", themes);
#endif #endif
if (ImGui::CollapsingHeader("Weather")) if (ImGui::CollapsingHeader("Weather"))
@ -658,6 +653,23 @@ Lowers armour, health, stamina etc."))
{ {
CWeather::ForceWeatherNow(3); CWeather::ForceWeatherNow(3);
} }
#ifdef GTAVC
ImGui::SameLine();
if (ImGui::Button("Extra sunny", Ui::GetSize(3)))
{
CWeather::ForceWeatherNow(4);
}
ImGui::SameLine();
if (ImGui::Button("Hurricane", Ui::GetSize(3)))
{
CWeather::ForceWeatherNow(5);
}
if (ImGui::Button("Extra colors", Ui::GetSize(3)))
{
CWeather::ForceWeatherNow(6);
}
#endif
#endif #endif
ImGui::Spacing(); ImGui::Spacing();
ImGui::Separator(); ImGui::Separator();

View File

@ -17,8 +17,10 @@ public:
static inline bool m_bKeepStuff; static inline bool m_bKeepStuff;
static inline ResourceStore m_StatData{ "stat", eResourceType::TYPE_TEXT }; static inline ResourceStore m_StatData{ "stat", eResourceType::TYPE_TEXT };
static inline std::vector<std::string> m_DayNames = {"Sunday", "Monday", "Tuesday", "Wednesday", static inline std::vector<std::string> m_DayNames =
"Thursday", "Friday", "Saturday"}; {
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
struct m_RandomCheats struct m_RandomCheats
{ {

View File

@ -1,10 +1,10 @@
#include "pch.h"
#include "hook.h" #include "hook.h"
#include "../depend/imgui/imgui_impl_dx11.h"
#include "../depend/imgui/imgui_impl_dx9.h"
#include "../depend/imgui/imgui_impl_win32.h"
#include "../depend/kiero/kiero.h" #include "../depend/kiero/kiero.h"
#include "../depend/kiero/minhook/MinHook.h" #include "../depend/kiero/minhook/MinHook.h"
#include "pch.h" #include "../depend/imgui/imgui_impl_dx9.h"
#include "../depend/imgui/imgui_impl_dx11.h"
#include "../depend/imgui/imgui_impl_win32.h"
#include <dinput.h> #include <dinput.h>
#define DIMOUSE ((LPDIRECTINPUTDEVICE8)(RsGlobal.ps->diMouse)) #define DIMOUSE ((LPDIRECTINPUTDEVICE8)(RsGlobal.ps->diMouse))
@ -168,6 +168,7 @@ void Hook::ShowMouse(bool state)
isController = patch::Get<BYTE>(0xBA6818); isController = patch::Get<BYTE>(0xBA6818);
#endif #endif
if (isController && (m_bShowMouse || bMouseDisabled)) if (isController && (m_bShowMouse || bMouseDisabled))
{ {
@ -317,8 +318,7 @@ static int _cdecl _GetMouseState(Mouse *pMouse)
{ {
if (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED) if (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED)
{ {
while (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED) while (DIMOUSE->Acquire() == DIERR_NOTINITIALIZED);
;
} }
} }

View File

@ -1,5 +1,5 @@
#include "hotkeys.h"
#include "pch.h" #include "pch.h"
#include "hotkeys.h"
Hotkey aimSkinChanger; Hotkey aimSkinChanger;
Hotkey freeCam; Hotkey freeCam;

View File

@ -11,9 +11,9 @@ public:
int m_key1; int m_key1;
int m_key2; int m_key2;
Hotkey(int key1 = -1, int key2 = -1) : m_key1(key1), m_key2(key2) Hotkey(int key1 = -1, int key2 = -1)
{ : m_key1(key1), m_key2(key2)
} {}
// Draws ui to change the hotkeys from frontend // Draws ui to change the hotkeys from frontend
bool DrawUI(const char* label); bool DrawUI(const char* label);

View File

@ -1,5 +1,5 @@
#include "json.h"
#include "pch.h" #include "pch.h"
#include "json.h"
CJson::CJson(const char* name) CJson::CJson(const char* name)
{ {

View File

@ -19,7 +19,8 @@ public:
*/ */
// specialize since typeid(std::string) doesn't work // specialize since typeid(std::string) doesn't work
template <typename T> T GetValue(std::string &&key, T &&defaultVal) template <typename T>
T GetValue(std::string&& key, T&& defaultVal)
{ {
try try
{ {
@ -46,7 +47,8 @@ public:
} }
} }
template <> std::string GetValue(std::string &&key, std::string &&defaultVal) template <>
std::string GetValue(std::string&& key, std::string&& defaultVal)
{ {
try try
{ {
@ -72,7 +74,8 @@ public:
Allows to save values in json hierarchy using '.' Allows to save values in json hierarchy using '.'
Example: "Menu.Window.X" Example: "Menu.Window.X"
*/ */
template <typename T> void SetValue(std::string &&key, T &val) template <typename T>
void SetValue(std::string&& key, T& val)
{ {
std::stringstream ss(key); std::stringstream ss(key);
std::string line; std::string line;
@ -82,6 +85,7 @@ public:
while (getline(ss, line, '.')) while (getline(ss, line, '.'))
{ {
json = &((*json)[line]); json = &((*json)[line]);
} }
// json library bugs with bool, using int instead // json library bugs with bool, using int instead
@ -95,7 +99,8 @@ public:
} }
} }
template <> void SetValue(std::string &&key, std::string &val) template <>
void SetValue(std::string&& key, std::string& val)
{ {
std::stringstream ss(key); std::stringstream ss(key);
std::string line; std::string line;

View File

@ -1,15 +1,14 @@
#include "menu.h"
#include "menuinfo.h"
#include "pch.h" #include "pch.h"
#include "menuinfo.h"
#include "menu.h"
#include "ui.h" #include "ui.h"
#include "updater.h"
#include "util.h" #include "util.h"
#include "updater.h"
#ifdef GTASA #ifdef GTASA
#include "teleport.h" #include "teleport.h"
#include "vehicle.h"
#include "weapon.h" #include "weapon.h"
#include "vehicle.h"
#endif #endif
Menu::Menu() Menu::Menu()
@ -78,16 +77,13 @@ void Menu::DrawOverlay()
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
if (pPlayer) if (pPlayer)
{ {
bool m_bShowMenu = m_Overlay::bCoord || m_Overlay::bFPS || m_Overlay::bLocName || m_Overlay::bCpuUsage || bool m_bShowMenu = m_Overlay::bCoord || m_Overlay::bFPS || m_Overlay::bLocName || m_Overlay::bCpuUsage || m_Overlay::bMemUsage ||
m_Overlay::bMemUsage || ((m_Overlay::bVehHealth || m_Overlay::bVehSpeed) && pPlayer && pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer);
((m_Overlay::bVehHealth || m_Overlay::bVehSpeed) && pPlayer && pPlayer->m_pVehicle &&
pPlayer->m_pVehicle->m_pDriver == pPlayer);
const float offset = 10.0f; const float offset = 10.0f;
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
ImGuiWindowFlags_NoNav;
if (m_Overlay::mSelectedPos == DISPLAY_POS::CUSTOM) if (m_Overlay::mSelectedPos == DISPLAY_POS::CUSTOM)
{ {
@ -147,8 +143,7 @@ void Menu::DrawOverlay()
memInfo.dwLength = sizeof(MEMORYSTATUSEX); memInfo.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&memInfo); GlobalMemoryStatusEx(&memInfo);
int mUsedRam = static_cast<int>((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6); int mUsedRam = static_cast<int>((memInfo.ullTotalPhys - memInfo.ullAvailPhys) * 1e-6);
m_Overlay::fMemUsage = m_Overlay::fMemUsage = 100.0f * (static_cast<float>(mUsedRam) / static_cast<float>(m_Overlay::mTotalRam));
100.0f * (static_cast<float>(mUsedRam) / static_cast<float>(m_Overlay::mTotalRam));
m_Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate)); m_Overlay::mFPS = static_cast<size_t>(BY_GAME(CTimer::game_FPS, io.Framerate, io.Framerate));
m_Overlay::mLastInterval = game_ms; m_Overlay::mLastInterval = game_ms;
@ -211,7 +206,8 @@ void Menu::DrawShortcutsWindow()
ImGui::SetNextWindowSize(ImVec2(resX, 40)); ImGui::SetNextWindowSize(ImVec2(resX, 40));
ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration + ImGuiWindowFlags_AlwaysAutoResize + ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration + ImGuiWindowFlags_AlwaysAutoResize +
ImGuiWindowFlags_NoSavedSettings + ImGuiWindowFlags_NoMove; ImGuiWindowFlags_NoSavedSettings
+ ImGuiWindowFlags_NoMove;
if (ImGui::Begin("Shortcuts window", nullptr, flags)) if (ImGui::Begin("Shortcuts window", nullptr, flags))
{ {

View File

@ -3,6 +3,7 @@
class Menu class Menu
{ {
private: private:
enum DISPLAY_POS enum DISPLAY_POS
{ {
CUSTOM, CUSTOM,
@ -25,8 +26,9 @@ private:
static inline float fCpuUsage = 0.0f; static inline float fCpuUsage = 0.0f;
static inline bool bMemUsage = false; static inline bool bMemUsage = false;
static inline float fMemUsage = 0.0f; static inline float fMemUsage = 0.0f;
static inline std::vector<std::string> posNames = {"Custom", "Top left", "Top right", "Bottom left", static inline std::vector<std::string> posNames = {
"Bottom right"}; "Custom", "Top left", "Top right", "Bottom left", "Bottom right"
};
static inline DISPLAY_POS mSelectedPos = DISPLAY_POS::BOTTOM_RIGHT; static inline DISPLAY_POS mSelectedPos = DISPLAY_POS::BOTTOM_RIGHT;
static inline float fPosX = 0.0f; static inline float fPosX = 0.0f;
static inline float fPosY = 0.0f; static inline float fPosY = 0.0f;

View File

@ -1,109 +1,178 @@
#include "neon.h"
#include "pch.h" #include "pch.h"
#include "neon.h"
#include "util.h" #include "util.h"
// Neon sprite // Neon sprite
const unsigned char neon_mask[1689] = { const unsigned char neon_mask[1689] =
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, {
0x40, 0x00, 0x00, 0x00, 0x80, 0x08, 0x06, 0x00, 0x00, 0x00, 0xbb, 0x81, 0x6f, 0x6a, 0x00, 0x00, 0x00, 0x09, 0x70, 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00,
0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25, 0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0x00, 0x80, 0x08, 0x06, 0x00, 0x00, 0x00, 0xbb, 0x81, 0x6f, 0x6a,
0x80, 0xe9, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, 0x3a, 0x98, 0x00, 0x00, 0x17, 0x6f, 0x92, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b,
0x5f, 0xc5, 0x46, 0x00, 0x00, 0x06, 0x1f, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xec, 0x5d, 0xdb, 0x8e, 0xe4, 0x2a, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00,
0x0c, 0x64, 0xa3, 0xf3, 0x10, 0x45, 0x49, 0x2b, 0xe2, 0xff, 0xbf, 0x11, 0x45, 0x09, 0x42, 0x79, 0x9b, 0xf3, 0x34, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, 0x7a, 0x25,
0xda, 0xde, 0x08, 0x70, 0xd9, 0x18, 0x42, 0x66, 0x1a, 0x69, 0xb4, 0xdb, 0x37, 0x3a, 0x55, 0x2e, 0x97, 0x0d, 0xdd, 0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0x80,
0x6a, 0xfe, 0x7c, 0x7d, 0x7d, 0x99, 0x86, 0x63, 0x01, 0x9f, 0x77, 0xb4, 0xba, 0xa0, 0x3f, 0x95, 0x09, 0x58, 0x14, 0xe9, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00,
0xe6, 0x38, 0x9e, 0x46, 0x00, 0x02, 0xda, 0x26, 0xee, 0x77, 0xad, 0xc9, 0xd0, 0x24, 0x60, 0x11, 0x82, 0x36, 0x02, 0x3a, 0x98, 0x00, 0x00, 0x17, 0x6f, 0x92, 0x5f, 0xc5, 0x46, 0x00,
0x32, 0x8e, 0xde, 0x08, 0x58, 0x98, 0xa0, 0x2d, 0x03, 0xb0, 0xab, 0x49, 0x82, 0x06, 0x01, 0x4b, 0x21, 0x70, 0x14, 0x00, 0x06, 0x1f, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xec, 0x5d,
0x74, 0x15, 0x22, 0x4a, 0x09, 0x40, 0xc1, 0x53, 0xf7, 0xa1, 0xd1, 0x77, 0xbd, 0x10, 0x80, 0x4a, 0xde, 0x0a, 0x14, 0xdb, 0x8e, 0xe4, 0x2a, 0x0c, 0x64, 0xa3, 0xf3, 0x10, 0x45, 0x49,
0xe0, 0x84, 0x6a, 0x38, 0x5a, 0x11, 0xa0, 0x01, 0x7e, 0x8d, 0xbc, 0x7e, 0x63, 0x12, 0xa1, 0x42, 0x82, 0x16, 0x01, 0x2b, 0xe2, 0xff, 0xbf, 0x11, 0x45, 0x09, 0x42, 0x79, 0x9b, 0xf3,
0x96, 0x41, 0xc4, 0x9a, 0x99, 0xbb, 0x39, 0x09, 0x5c, 0x02, 0x16, 0x66, 0xe4, 0x53, 0x51, 0x7f, 0x45, 0xe6, 0xd9, 0x34, 0xda, 0xde, 0x08, 0x70, 0xd9, 0x18, 0x42, 0x66, 0x1a, 0x69,
0x41, 0x22, 0x9c, 0xa6, 0x31, 0x72, 0x08, 0xa8, 0x01, 0x7e, 0x36, 0xc6, 0x78, 0x90, 0x08, 0x0e, 0x09, 0x4d, 0x08, 0xb4, 0xdb, 0x37, 0x3a, 0x55, 0x2e, 0x97, 0x0d, 0xdd, 0x6a, 0xfe,
0x48, 0x81, 0x4f, 0x49, 0xfe, 0x0a, 0x3c, 0x36, 0x7c, 0x6b, 0x12, 0x50, 0x02, 0x16, 0x41, 0xe4, 0x63, 0x51, 0x9f, 0x7c, 0x7d, 0x7d, 0x99, 0x86, 0x63, 0x01, 0x9f, 0x77, 0xb4, 0xba,
0x13, 0x24, 0x78, 0x06, 0x11, 0xaa, 0x24, 0x0c, 0xca, 0x2d, 0xae, 0x04, 0xfc, 0xf7, 0xed, 0xd8, 0xe3, 0xaf, 0x88, 0xa0, 0x3f, 0x95, 0x09, 0x58, 0x14, 0xe6, 0x38, 0x9e, 0x46, 0x00,
0x92, 0x2c, 0x68, 0xbe, 0xd0, 0x18, 0x04, 0xaf, 0xb1, 0x05, 0xe0, 0xdf, 0x81, 0x4e, 0x97, 0xbf, 0xeb, 0xe3, 0x73, 0x02, 0xda, 0x26, 0xee, 0x77, 0xad, 0xc9, 0xd0, 0x24, 0x60, 0x11,
0xc6, 0x30, 0x45, 0x60, 0xb5, 0x08, 0x40, 0xc0, 0xbf, 0x12, 0xe0, 0xcd, 0x05, 0xf0, 0xf4, 0x36, 0xc7, 0x14, 0x51, 0x82, 0x36, 0x02, 0x32, 0x8e, 0xde, 0x08, 0x58, 0x98, 0xa0, 0x2d,
0xc0, 0x95, 0x84, 0x95, 0x59, 0x82, 0x97, 0x52, 0x02, 0x16, 0x01, 0xf3, 0xaf, 0x4b, 0x34, 0xaf, 0x51, 0xbf, 0x02, 0x03, 0xb0, 0xab, 0x49, 0x82, 0x06, 0x01, 0x4b, 0x21, 0x70, 0x14,
0x9e, 0x12, 0xff, 0xa7, 0x48, 0xb0, 0x77, 0x2a, 0x80, 0x92, 0x7e, 0xcc, 0xe5, 0x63, 0x20, 0x4d, 0x42, 0x01, 0x14, 0x74, 0x15, 0x22, 0x4a, 0x09, 0x40, 0xc1, 0x53, 0xf7, 0xa1, 0xd1,
0x09, 0xb9, 0xca, 0xc3, 0x52, 0xc1, 0x50, 0x18, 0x7d, 0x4b, 0x94, 0xba, 0x58, 0xbe, 0x5f, 0x41, 0x4f, 0x89, 0xdb, 0x77, 0xbd, 0x10, 0x80, 0x4a, 0xde, 0x0a, 0x14, 0xe0, 0x84, 0x6a,
0x29, 0x12, 0x90, 0x54, 0x68, 0xe2, 0x01, 0xa9, 0x31, 0x67, 0x22, 0x9b, 0x03, 0x9e, 0x52, 0xcb, 0x75, 0x4e, 0x24, 0x38, 0x5a, 0x11, 0xa0, 0x01, 0x7e, 0x8d, 0xbc, 0x7e, 0x63, 0x12,
0x15, 0xac, 0x36, 0x01, 0x36, 0x23, 0xbb, 0xf7, 0xe8, 0xc7, 0x0c, 0xcf, 0x10, 0x60, 0x29, 0x52, 0x26, 0xa2, 0x3c, 0xa1, 0x42, 0x82, 0x16, 0x01, 0x96, 0x41, 0xc4, 0x9a, 0x99, 0xbb,
0x16, 0xed, 0x56, 0x0d, 0xc2, 0xda, 0x9f, 0x32, 0x3e, 0x29, 0x78, 0x8e, 0xb2, 0xe6, 0x4c, 0x6f, 0xc0, 0xee, 0x0b, 0x39, 0x09, 0x5c, 0x02, 0x16, 0x66, 0xe4, 0x53, 0x51, 0x7f, 0x45,
0xb8, 0x29, 0x60, 0x41, 0xe3, 0x2b, 0x01, 0x3f, 0x31, 0x53, 0xa1, 0x48, 0x05, 0x03, 0x53, 0xfe, 0x68, 0xf4, 0x0d, 0xe6, 0xd9, 0x41, 0x22, 0x9c, 0xa6, 0x31, 0x72, 0x08, 0xa8, 0x01,
0xe0, 0x03, 0xc6, 0x18, 0x33, 0x0a, 0x48, 0xa0, 0x54, 0x50, 0x6c, 0x82, 0x4b, 0x85, 0xe8, 0xe7, 0xc0, 0x8f, 0x09, 0x7e, 0x36, 0xc6, 0x78, 0x90, 0x08, 0x0e, 0x09, 0x4d, 0x08, 0x48,
0x22, 0x26, 0x66, 0xea, 0x89, 0xda, 0xe3, 0xd2, 0x2a, 0x50, 0x12, 0x7d, 0x54, 0x0d, 0x57, 0x52, 0x67, 0xe2, 0xfd, 0x81, 0x4f, 0x49, 0xfe, 0x0a, 0x3c, 0x36, 0x7c, 0x6b, 0x12, 0x50,
0x6e, 0x2f, 0x83, 0x14, 0xe8, 0x31, 0x03, 0x76, 0x14, 0x92, 0xb7, 0x12, 0x4b, 0x72, 0x31, 0x01, 0x16, 0x94, 0xff, 0x02, 0x16, 0x41, 0xe4, 0x63, 0x51, 0x9f, 0x13, 0x24, 0x78, 0x06,
0x4c, 0xd4, 0x73, 0x24, 0xca, 0x1c, 0x52, 0xa5, 0x66, 0xb8, 0x68, 0x2a, 0xe0, 0x55, 0x49, 0x3d, 0x94, 0x0a, 0x28, 0x11, 0xaa, 0x24, 0x0c, 0xca, 0x2d, 0xae, 0x04, 0xfc, 0xf7, 0xed,
0x33, 0x64, 0x99, 0xf8, 0x50, 0x58, 0xff, 0x73, 0xdd, 0x9b, 0x66, 0xf4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0x69, 0x10, 0x04,
0xef, 0x85, 0x18, 0xe0, 0x21, 0x21, 0xe0, 0x6e, 0x2f, 0x28, 0x99,
0xdf, 0x71, 0x3d, 0xc0, 0x5d, 0x7c, 0x20, 0x55, 0x06, 0x43, 0x45,
0x12, 0x50, 0xf3, 0xfb, 0xbe, 0xed, 0x39, 0x06, 0xc8, 0x5d, 0x0c,
0x21, 0xa0, 0xce, 0x86, 0xab, 0xc8, 0x09, 0x6c, 0x82, 0xb2, 0x98,
0x90, 0x6f, 0x89, 0x6d, 0xe6, 0xdf, 0x7d, 0x75, 0x6f, 0xfe, 0xee,
0xb5, 0x05, 0x00, 0x60, 0x60, 0x10, 0x12, 0x18, 0x3e, 0x13, 0x34,
0x5a, 0x78, 0x6e, 0x23, 0xe4, 0x15, 0x65, 0x1e, 0xde, 0xfe, 0x34,
0xbc, 0x80, 0x2d, 0xff, 0x77, 0x02, 0x0e, 0xd0, 0x07, 0xa4, 0x69,
0x10, 0x03, 0x4e, 0xdd, 0x87, 0x44, 0xbf, 0x98, 0x3c, 0xea, 0xab,
0xb2, 0xc8, 0xba, 0x40, 0xed, 0x62, 0x14, 0x8c, 0x32, 0x55, 0xfe,
0x9c, 0xe6, 0x6a, 0x50, 0xd2, 0x13, 0xdc, 0x35, 0x1f, 0xf9, 0xeb,
0x73, 0xb9, 0x14, 0x70, 0x09, 0x73, 0xf1, 0x60, 0xee, 0x9f, 0x95,
0xc0, 0x87, 0x44, 0xe4, 0x3d, 0x37, 0xff, 0x91, 0x56, 0x98, 0x6b,
0x88, 0x3d, 0xb6, 0xc6, 0x6a, 0x1b, 0x22, 0x9b, 0x52, 0x5f, 0xa0,
0xd9, 0xf9, 0x85, 0x4c, 0xf9, 0x73, 0x89, 0x7f, 0x8b, 0x3d, 0x80,
0x4a, 0x83, 0xd0, 0x20, 0xf7, 0x43, 0x46, 0x89, 0x9b, 0x86, 0x02,
0x20, 0xf6, 0x6e, 0x96, 0x7f, 0x28, 0x58, 0xa3, 0x88, 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0x8a, 0x04, 0x6e, 0xf4,
0x91, 0xce, 0xae, 0xbb, 0x83, 0x97, 0x39, 0x44, 0xe4, 0xc8, 0x78,
0xf4, 0xd1, 0xdb, 0x52, 0x32, 0x4c, 0x6b, 0xd0, 0x2d, 0x09, 0x90,
0x12, 0x72, 0xb4, 0xba, 0xa0, 0xff, 0x07, 0x00, 0x48, 0x04, 0x71,
0x83, 0x9e, 0xcc, 0x51, 0xce, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
Neon::Neon() Neon::Neon()
{ {
Events::processScriptsEvent += [this] { Events::processScriptsEvent += [this]
{
if (!m_pNeonTexture) if (!m_pNeonTexture)
{ {
m_pNeonTexture = Util::LoadTextureFromMemory((char*)neon_mask, sizeof(neon_mask)); m_pNeonTexture = Util::LoadTextureFromMemory((char*)neon_mask, sizeof(neon_mask));
} }
}; };
Events::vehicleRenderEvent += [](CVehicle *pVeh) { Events::vehicleRenderEvent += [](CVehicle* pVeh)
{
NeonData* data = &m_VehNeon.Get(pVeh); NeonData* data = &m_VehNeon.Get(pVeh);
if (data->m_bNeonInstalled && !pVeh->IsUpsideDown()) if (data->m_bNeonInstalled && !pVeh->IsUpsideDown())
{ {
@ -111,9 +180,8 @@ Neon::Neon()
CVector center = pVeh->TransformFromObjectSpace(CVector(0.0f, 0.0f, 0.0f)); CVector center = pVeh->TransformFromObjectSpace(CVector(0.0f, 0.0f, 0.0f));
CVector up = pVeh->TransformFromObjectSpace(CVector(0.0f, -Pos.y - data->m_fVal, 0.0f)) - center; CVector up = pVeh->TransformFromObjectSpace(CVector(0.0f, -Pos.y - data->m_fVal, 0.0f)) - center;
CVector right = pVeh->TransformFromObjectSpace(CVector(Pos.x + data->m_fVal, 0.0f, 0.0f)) - center; CVector right = pVeh->TransformFromObjectSpace(CVector(Pos.x + data->m_fVal, 0.0f, 0.0f)) - center;
CShadows::StoreShadowToBeRendered(5, m_pNeonTexture, &center, up.x, up.y, right.x, right.y, 180, CShadows::StoreShadowToBeRendered(5, m_pNeonTexture, &center, up.x, up.y, right.x, right.y, 180, data->m_Color.r,
data->m_Color.r, data->m_Color.g, data->m_Color.b, 2.0f, false, 1.0f, 0, data->m_Color.g, data->m_Color.b, 2.0f, false, 1.0f, 0, true);
true);
if (data->m_bPulsing) if (data->m_bPulsing)
{ {
@ -182,3 +250,5 @@ void Neon::RemoveNeon(CVehicle *pVeh)
{ {
m_VehNeon.Get(pVeh).m_bNeonInstalled = false; m_VehNeon.Get(pVeh).m_bNeonInstalled = false;
} }

View File

@ -22,18 +22,20 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
#include "pch.h"
#include "paint.h" #include "paint.h"
#include "NodeName.h" #include "NodeName.h"
#include "pch.h"
#include "util.h" #include "util.h"
Paint::Paint() Paint::Paint()
{ {
Events::vehicleRenderEvent.before += [](CVehicle *pVeh) { Events::vehicleRenderEvent.before += [](CVehicle* pVeh)
{
VehData& data = m_VehData.Get(pVeh); VehData& data = m_VehData.Get(pVeh);
// reset custom color if color id changed // reset custom color if color id changed
if (pVeh->m_nPrimaryColor != data.primary_color || pVeh->m_nSecondaryColor != data.secondary_color) if (pVeh->m_nPrimaryColor != data.primary_color
|| pVeh->m_nSecondaryColor != data.secondary_color)
{ {
for (auto& it : data.materialProperties) for (auto& it : data.materialProperties)
data.resetMaterialColor(it.first); data.resetMaterialColor(it.first);
@ -67,9 +69,9 @@ Paint::Paint()
} }
}; };
ThiscallEvent<AddressList<0x55332A, H_CALL>, PRIORITY_BEFORE, ArgPickN<CVehicle *, 0>, void(CVehicle *)> ThiscallEvent<AddressList<0x55332A, H_CALL>, PRIORITY_BEFORE, ArgPickN<CVehicle*, 0>, void(CVehicle*)> vehicleResetAfterRender;
vehicleResetAfterRender; vehicleResetAfterRender += [](CVehicle* pVeh)
vehicleResetAfterRender += [](CVehicle *pVeh) { {
for (auto& it : m_VehData.Get(pVeh).materialProperties) for (auto& it : m_VehData.Get(pVeh).materialProperties)
{ {
if (it.second._recolor) if (it.second._recolor)
@ -89,8 +91,9 @@ void Paint::VehData::setMaterialColor(RpMaterial *material, RpGeometry *geometry
{ {
auto& matProps = materialProperties[material]; auto& matProps = materialProperties[material];
if (!filter_mat || (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00) || if (!filter_mat
(material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF)) || (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00)
|| (material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF))
{ {
matProps._recolor = true; matProps._recolor = true;
matProps._color = color; matProps._color = color;
@ -102,8 +105,9 @@ void Paint::VehData::setMaterialTexture(RpMaterial *material, RwTexture *texture
{ {
auto& matProps = materialProperties[material]; auto& matProps = materialProperties[material];
if (!filter_mat || (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00) || if (!filter_mat
(material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF)) || (material->color.red == 0x3C && material->color.green == 0xFF && material->color.blue == 0x00)
|| (material->color.red == 0xFF && material->color.green == 0x00 && material->color.blue == 0xAF))
{ {
matProps._retexture = true; matProps._retexture = true;
matProps._texture = texture; matProps._texture = texture;
@ -142,7 +146,8 @@ void Paint::UpdateNodeListRecursive(CVehicle *pVeh)
{ {
RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent; RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent;
NodeWrapperRecursive(frame, pVeh, [](RwFrame *frame) { NodeWrapperRecursive(frame, pVeh, [](RwFrame* frame)
{
const std::string name = GetFrameNodeName(frame); const std::string name = GetFrameNodeName(frame);
if (!(std::find(veh_nodes::names_vec.begin(), veh_nodes::names_vec.end(), name) != veh_nodes::names_vec.end())) if (!(std::find(veh_nodes::names_vec.begin(), veh_nodes::names_vec.end(), name) != veh_nodes::names_vec.end()))
@ -154,7 +159,8 @@ void Paint::SetNodeColor(CVehicle *pVeh, std::string node_name, CRGBA color, boo
{ {
RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent; RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent;
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) { NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
{
const std::string name = GetFrameNodeName(frame); const std::string name = GetFrameNodeName(frame);
struct ST struct ST
@ -168,9 +174,8 @@ void Paint::SetNodeColor(CVehicle *pVeh, std::string node_name, CRGBA color, boo
if (node_name == "Default" || node_name == name) if (node_name == "Default" || node_name == name)
{ {
RwFrameForAllObjects( RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
frame, {
[](RwObject *object, void *data) -> RwObject * {
if (object->type == rpATOMIC) if (object->type == rpATOMIC)
{ {
RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object); RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object);
@ -186,8 +191,7 @@ void Paint::SetNodeColor(CVehicle *pVeh, std::string node_name, CRGBA color, boo
{color->r, color->g, color->b, 255}, filter_mat); {color->r, color->g, color->b, 255}, filter_mat);
} }
return object; return object;
}, }, &st);
&st);
} }
}); });
} }
@ -206,7 +210,8 @@ void Paint::SetNodeTexture(CVehicle *pVeh, std::string node_name, std::string te
} }
} }
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) { NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
{
const std::string name = GetFrameNodeName(frame); const std::string name = GetFrameNodeName(frame);
struct ST struct ST
@ -220,9 +225,8 @@ void Paint::SetNodeTexture(CVehicle *pVeh, std::string node_name, std::string te
if (node_name == "Default" || node_name == name) if (node_name == "Default" || node_name == name)
{ {
RwFrameForAllObjects( RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
frame, {
[](RwObject *object, void *data) -> RwObject * {
if (object->type == rpATOMIC) if (object->type == rpATOMIC)
{ {
RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object); RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object);
@ -232,12 +236,12 @@ void Paint::SetNodeTexture(CVehicle *pVeh, std::string node_name, std::string te
for (int i = 0; i < atomic->geometry->matList.numMaterials; ++i) for (int i = 0; i < atomic->geometry->matList.numMaterials; ++i)
{ {
data.setMaterialTexture(atomic->geometry->matList.materials[i], st->_tex, st->_filter); data.setMaterialTexture(atomic->geometry->matList.materials[i], st->_tex,
st->_filter);
} }
} }
return object; return object;
}, }, &st);
&st);
} }
}); });
} }
@ -246,14 +250,14 @@ void Paint::ResetNodeColor(CVehicle *pVeh, std::string node_name)
{ {
RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent; RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent;
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) { NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
{
const std::string name = GetFrameNodeName(frame); const std::string name = GetFrameNodeName(frame);
if (node_name == "Default" || node_name == name) if (node_name == "Default" || node_name == name)
{ {
RwFrameForAllObjects( RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
frame, {
[](RwObject *object, void *data) -> RwObject * {
if (object->type == rpATOMIC) if (object->type == rpATOMIC)
{ {
RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object); RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object);
@ -263,8 +267,7 @@ void Paint::ResetNodeColor(CVehicle *pVeh, std::string node_name)
data.resetMaterialColor(atomic->geometry->matList.materials[i]); data.resetMaterialColor(atomic->geometry->matList.materials[i]);
} }
return object; return object;
}, }, nullptr);
nullptr);
} }
}); });
} }
@ -273,14 +276,14 @@ void Paint::ResetNodeTexture(CVehicle *pVeh, std::string node_name)
{ {
RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent; RwFrame* frame = (RwFrame*)pVeh->m_pRwClump->object.parent;
NodeWrapperRecursive(frame, pVeh, [&](RwFrame *frame) { NodeWrapperRecursive(frame, pVeh, [&](RwFrame* frame)
{
const std::string name = GetFrameNodeName(frame); const std::string name = GetFrameNodeName(frame);
if (node_name == "Default" || node_name == name) if (node_name == "Default" || node_name == name)
{ {
RwFrameForAllObjects( RwFrameForAllObjects(frame, [](RwObject* object, void* data) -> RwObject*
frame, {
[](RwObject *object, void *data) -> RwObject * {
if (object->type == rpATOMIC) if (object->type == rpATOMIC)
{ {
RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object); RpAtomic* atomic = reinterpret_cast<RpAtomic*>(object);
@ -291,8 +294,7 @@ void Paint::ResetNodeTexture(CVehicle *pVeh, std::string node_name)
data.resetMaterialTexture(atomic->geometry->matList.materials[i]); data.resetMaterialTexture(atomic->geometry->matList.materials[i]);
} }
return object; return object;
}, }, nullptr);
nullptr);
} }
}); });
} }

View File

@ -32,9 +32,14 @@ private:
{ {
struct MaterialProperties struct MaterialProperties
{ {
MaterialProperties() MaterialProperties() :
: _color{0, 0, 0, 0}, _recolor(false), _retexture(false), _color{0, 0, 0, 0},
_geometry(nullptr), _originalColor{0, 0, 0, 0}, _originalTexture(nullptr), _originalGeometryFlags(0) _recolor(false),
_retexture(false),
_geometry(nullptr),
_originalColor{0, 0, 0, 0},
_originalTexture(nullptr),
_originalGeometryFlags(0)
{ {
} }

View File

@ -14,65 +14,63 @@
#define BY_GAME(sa, vc, iii) iii #define BY_GAME(sa, vc, iii) iii
#endif #endif
#include <d3d9.h>
#include <d3d11.h> #include <d3d11.h>
#include <d3d11Shader.h> #include <d3d11Shader.h>
#include <d3d9.h>
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#include <functional> #include <functional>
#include <iostream>
#include <memory> #include <memory>
#include <iostream>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <windows.h> #include <windows.h>
#include <plugin.h>
#include <CCamera.h> #include <CCamera.h>
#include <CCivilianPed.h>
#include <CClock.h> #include <CClock.h>
#include <CCivilianPed.h>
#include <CGangs.h> #include <CGangs.h>
#include <CHud.h> #include <CHud.h>
#include <CMenuManager.h> #include <CMenuManager.h>
#include <CModelInfo.h> #include <CModelInfo.h>
#include <RenderWare.h>
#include <CStats.h> #include <CStats.h>
#include <CStreaming.h> #include <CStreaming.h>
#include <CTheScripts.h> #include <CTheScripts.h>
#include <CTimeCycle.h>
#include <CTimer.h> #include <CTimer.h>
#include <CTimeCycle.h>
#include <CTrain.h> #include <CTrain.h>
#include <CWeather.h> #include <CWeather.h>
#include <CWorld.h> #include <CWorld.h>
#include <RenderWare.h>
#include <extensions/Paths.h>
#include <extensions/Screen.h>
#include <extensions/ScriptCommands.h> #include <extensions/ScriptCommands.h>
#include <plugin.h> #include <extensions/Screen.h>
#include <extensions/Paths.h>
#ifndef GTA3 #ifndef GTA3
#include <CBike.h> #include <CBike.h>
#include <cHandlingDataMgr.h>
#include <CTheZones.h> #include <CTheZones.h>
#include <CZoneInfo.h> #include <CZoneInfo.h>
#include <cHandlingDataMgr.h>
#endif #endif
#ifdef GTASA #ifdef GTASA
#include <CCheat.h> #include <CCheat.h>
#include <CClothes.h> #include <CClothes.h>
#include <CCutsceneMgr.h> #include <CCutsceneMgr.h>
#include <CGangWars.h>
#include <CRadar.h> #include <CRadar.h>
#include <CShadows.h> #include <CShadows.h>
#include <eVehicleClass.h> #include <eVehicleClass.h>
#include <CGangWars.h>
#endif #endif
#include "../depend/fla/IDaccess.h" #include "../depend/fla/IDaccess.h"
#include "../depend/imgui/imgui.h" #include "../depend/imgui/imgui.h"
#include "hotkeys.h"
#include "json.h" #include "json.h"
#include "resourcestore.h" #include "hotkeys.h"
#include "vKeys.h" #include "vKeys.h"
#include "resourcestore.h"
using CallbackTable = std::vector<std::pair<std::string, void(*)()>>; using CallbackTable = std::vector<std::pair<std::string, void(*)()>>;
using namespace plugin; using namespace plugin;

View File

@ -1,5 +1,5 @@
#include "ped.h"
#include "pch.h" #include "pch.h"
#include "ped.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#include "weapon.h" #include "weapon.h"
@ -23,7 +23,9 @@ Ped::Ped()
TODO: Implement in VC too TODO: Implement in VC too
*/ */
Events::pedRenderEvent += [](CPed *ped) { Events::pedRenderEvent += [](CPed *ped)
{
if (m_bBigHead || m_bThinBody) if (m_bBigHead || m_bThinBody)
{ {
auto animHier = GetAnimHierarchyFromSkinClump (ped->m_pRwClump); auto animHier = GetAnimHierarchyFromSkinClump (ped->m_pRwClump);
@ -93,8 +95,7 @@ void Ped::SpawnPed(std::string &cat, std::string &name, std::string &model)
CStreaming::RequestSpecialChar(currentSlot, name.c_str(), PRIORITY_REQUEST); CStreaming::RequestSpecialChar(currentSlot, name.c_str(), PRIORITY_REQUEST);
CStreaming::LoadAllRequestedModels(true); CStreaming::LoadAllRequestedModels(true);
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 290 + currentSlot, pos.x, pos.y, Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 290 + currentSlot, pos.x, pos.y, pos.z + 1, &hplayer);
pos.z + 1, &hplayer);
CStreaming::SetSpecialCharIsDeletable(290 + currentSlot); CStreaming::SetSpecialCharIsDeletable(290 + currentSlot);
// SA has 10 slots // SA has 10 slots
@ -114,8 +115,7 @@ void Ped::SpawnPed(std::string &cat, std::string &name, std::string &model)
Command<Commands::LOAD_SPECIAL_CHARACTER>(currentSlot, model.c_str()); Command<Commands::LOAD_SPECIAL_CHARACTER>(currentSlot, model.c_str());
Command<Commands::LOAD_ALL_MODELS_NOW>(); Command<Commands::LOAD_ALL_MODELS_NOW>();
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 108 + currentSlot, pos.x, pos.y, Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, 108+currentSlot, pos.x, pos.y, pos.z + 1, &hplayer);
pos.z + 1, &hplayer);
Command<Commands::UNLOAD_SPECIAL_CHARACTER>(currentSlot); Command<Commands::UNLOAD_SPECIAL_CHARACTER>(currentSlot);
++currentSlot; ++currentSlot;
@ -132,8 +132,7 @@ void Ped::SpawnPed(std::string &cat, std::string &name, std::string &model)
CStreaming::RequestModel(iModel, eStreamingFlags::PRIORITY_REQUEST); CStreaming::RequestModel(iModel, eStreamingFlags::PRIORITY_REQUEST);
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, iModel, pos.x, pos.y, pos.z + 1, Command<Commands::CREATE_CHAR>(m_SpawnPed::m_nSelectedPedType + 4, iModel, pos.x, pos.y, pos.z + 1, &hplayer);
&hplayer);
CStreaming::SetModelIsDeletable(iModel); CStreaming::SetModelIsDeletable(iModel);
} }
@ -287,7 +286,8 @@ void Ped::Draw()
if (ImGui::CollapsingHeader("Recruit anyone")) if (ImGui::CollapsingHeader("Recruit anyone"))
{ {
static std::vector<Ui::NamedMemory> selectWeapon{ static std::vector<Ui::NamedMemory> selectWeapon{
{"9mm", 0x96917C}, {"AK47", 0x96917D}, {"Rockets", 0x96917E}}; {"9mm", 0x96917C}, {"AK47", 0x96917D}, {"Rockets", 0x96917E}
};
Ui::RadioButtonAddress("Select weapon", selectWeapon); Ui::RadioButtonAddress("Select weapon", selectWeapon);
ImGui::Spacing(); ImGui::Spacing();
ImGui::Separator(); ImGui::Separator();
@ -303,8 +303,8 @@ void Ped::Draw()
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
for (CPed* ped : CPools::ms_pPedPool) for (CPed* ped : CPools::ms_pPedPool)
{ {
if (DistanceBetweenPoints(ped->GetPosition(), player->GetPosition()) < m_nPedRemoveRadius && if (DistanceBetweenPoints(ped->GetPosition(), player->GetPosition()) < m_nPedRemoveRadius
ped->m_pVehicle == nullptr && ped != player) && ped->m_pVehicle == nullptr && ped != player)
{ {
Command<Commands::DELETE_CHAR>(CPools::GetPedRef(ped)); Command<Commands::DELETE_CHAR>(CPools::GetPedRef(ped));
} }
@ -374,20 +374,20 @@ void Ped::Draw()
ImGui::Text("Selected weapon: %s", m_SpawnPed::m_nWeaponName.c_str()); ImGui::Text("Selected weapon: %s", m_SpawnPed::m_nWeaponName.c_str());
ImGui::Spacing(); ImGui::Spacing();
#ifdef GTASA #ifdef GTASA
Ui::DrawImages( Ui::DrawImages(Weapon::m_WeaponData,
Weapon::m_WeaponData, [](std::string str) { m_SpawnPed::m_nWeaponId = std::stoi(str); }, [](std::string str) { m_SpawnPed::m_nWeaponId = std::stoi(str); },
nullptr, nullptr,
[](std::string str) { [](std::string str)
{
m_SpawnPed::m_nWeaponName = Weapon::m_WeaponData.m_pJson->m_Data[str].get<std::string>(); m_SpawnPed::m_nWeaponName = Weapon::m_WeaponData.m_pJson->m_Data[str].get<std::string>();
return m_SpawnPed::m_nWeaponName; return m_SpawnPed::m_nWeaponName;
}, },
[](std::string str) { [](std::string str) { return str != "-1"; /*Jetpack*/ }
return str != "-1"; /*Jetpack*/ );
});
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
Ui::DrawJSON( Ui::DrawJSON(Weapon::m_WeaponData,
Weapon::m_WeaponData, [](std::string& root, std::string& key, std::string& id)
[](std::string &root, std::string &key, std::string &id) { {
m_SpawnPed::m_nWeaponId = std::stoi(id); m_SpawnPed::m_nWeaponId = std::stoi(id);
m_SpawnPed::m_nWeaponName = key; m_SpawnPed::m_nWeaponName = key;
}, },

View File

@ -14,9 +14,11 @@ private:
static inline CJson m_SpecialPedJson = CJson("ped special"); static inline CJson m_SpecialPedJson = CJson("ped special");
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)}; static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)};
static inline std::vector<std::string> m_GangNames = { static inline std::vector<std::string> m_GangNames =
"Ballas", "Grove street families", "Los santos vagos", "San fierro rifa", "Da nang boys", {
"Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"}; "Ballas", "Grove street families", "Los santos vagos", "San fierro rifa",
"Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10"
};
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_TEXT}; static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_TEXT};
#endif #endif
@ -33,33 +35,19 @@ private:
static inline int m_nSelectedPedType; static inline int m_nSelectedPedType;
static inline int m_nWeaponId; static inline int m_nWeaponId;
static inline std::string m_nWeaponName = "None"; static inline std::string m_nWeaponName = "None";
static inline std::vector<std::string> m_PedTypeList = { static inline std::vector<std::string> m_PedTypeList =
{
#ifdef GTASA #ifdef GTASA
"Civ Male", "Civ Male", "Civ Female", "Cop", "Ballas", "Grove Street Families", "Los Santos Vagos",
"Civ Female", "San Fierro Rifa", "Da Nang Boys", "Mafia", "Mountain Cloud Triads", "Varrio Los Aztecas",
"Cop", "Gang 9", "Medic", "Dealer", "Criminal", "Fireman", "Prostitute"
"Ballas",
"Grove Street Families",
"Los Santos Vagos",
"San Fierro Rifa",
"Da Nang Boys",
"Mafia",
"Mountain Cloud Triads",
"Varrio Los Aztecas",
"Gang 9",
"Medic",
"Dealer",
"Criminal",
"Fireman",
"Prostitute"
#elif GTAVC #elif GTAVC
"Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang", "Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang",
"Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency", "Fireman", "Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency",
"Criminal", "Unused", "Prostitute", "Special" "Fireman", "Criminal", "Unused", "Prostitute", "Special"
#else // GTA3 #else // GTA3
"Civ Male", "Civ Female", "Cop", "Leones", "Triads", "Diablos", "Yakuza", "Civ Male", "Civ Female", "Cop", "Leones", "Triads", "Diablos", "Yakuza", "Yardies", "Colombians",
"Yardies", "Colombians", "Hoods", "unused", "unused", "Emergency", "Fireman", "Hoods", "unused", "unused", "Emergency", "Fireman", "Criminal", "unused", "Prostitute", "Special"
"Criminal", "unused", "Prostitute", "Special"
#endif #endif
}; };
}; };

View File

@ -1,14 +1,15 @@
#include "pch.h"
#include "player.h" #include "player.h"
#include "menu.h" #include "menu.h"
#include "pch.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#ifdef GTASA #ifdef GTASA
#include "ped.h" #include "ped.h"
// hardcoded cloth category names // hardcoded cloth category names
const char *cloth_category[18] = {"Shirts", const char* cloth_category[18] =
{
"Shirts",
"Heads", "Heads",
"Trousers", "Trousers",
"Shoes", "Shoes",
@ -25,7 +26,8 @@ const char *cloth_category[18] = {"Shirts",
"Watches", "Watches",
"Glasses", "Glasses",
"Hats", "Hats",
"Extras"}; "Extras"
};
static inline void PlayerModelBrokenFix() static inline void PlayerModelBrokenFix()
{ {
@ -35,6 +37,7 @@ static inline void PlayerModelBrokenFix()
Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false); Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false);
} }
/* /*
Taken from gta chaos mod by Lordmau5 Taken from gta chaos mod by Lordmau5
https://github.com/gta-chaos-mod/Trilogy-ASI-Script https://github.com/gta-chaos-mod/Trilogy-ASI-Script
@ -71,26 +74,30 @@ void Player::TopDownCameraView()
} }
CVector playerOffset = CVector (pos.x, pos.y, pos.z + 2.0f); CVector playerOffset = CVector (pos.x, pos.y, pos.z + 2.0f);
CVector cameraPos = CVector(playerOffset.x, playerOffset.y, playerOffset.z + curOffset); CVector cameraPos
= CVector (playerOffset.x, playerOffset.y, playerOffset.z + curOffset);
CColPoint outColPoint; CColPoint outColPoint;
CEntity * outEntity; CEntity * outEntity;
// TODO: Which variable? X, Y or Z for the look direction? // TODO: Which variable? X, Y or Z for the look direction?
if (CWorld::ProcessLineOfSight(playerOffset, cameraPos, outColPoint, outEntity, true, true, true, true, true, true, if (CWorld::ProcessLineOfSight (playerOffset, cameraPos, outColPoint,
true, true)) outEntity, true, true, true, true, true,
true, true, true))
{ {
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION>(outColPoint.m_vecPoint.x, outColPoint.m_vecPoint.y, Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION> (
outColPoint.m_vecPoint.x, outColPoint.m_vecPoint.y,
outColPoint.m_vecPoint.z, 0.0f, 0.0f, 0.0f); outColPoint.m_vecPoint.z, 0.0f, 0.0f, 0.0f);
} }
else else
{ {
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION>(cameraPos.x, cameraPos.y, cameraPos.z, 0.0f, 0.0f, Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION> (
0.0f); cameraPos.x, cameraPos.y, cameraPos.z, 0.0f, 0.0f, 0.0f);
} }
Command<eScriptCommands::COMMAND_POINT_CAMERA_AT_POINT>(pos.x, pos.y, pos.z, 2); Command<eScriptCommands::COMMAND_POINT_CAMERA_AT_POINT> (pos.x, pos.y,
pos.z, 2);
TheCamera.m_fGenerationDistMultiplier = 10.0f; TheCamera.m_fGenerationDistMultiplier = 10.0f;
TheCamera.m_fLODDistMultiplier = 10.0f; TheCamera.m_fLODDistMultiplier = 10.0f;
@ -133,7 +140,8 @@ Player::Player()
m_bModloaderInstalled = true; m_bModloaderInstalled = true;
} }
Events::processScriptsEvent += [] { Events::processScriptsEvent += []
{
uint timer = CTimer::m_snTimeInMilliseconds; uint timer = CTimer::m_snTimeInMilliseconds;
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
int hplayer = CPools::GetPedRef(player); int hplayer = CPools::GetPedRef(player);
@ -148,10 +156,11 @@ Player::Player()
{ {
CVector cur_pos = player->GetPosition(); CVector cur_pos = player->GetPosition();
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)
{ {
BY_GAME(player->Teleport(m_KeepPosition::m_fPos, false), player->Teleport(m_KeepPosition::m_fPos)); BY_GAME(player->Teleport(m_KeepPosition::m_fPos, false)
, player->Teleport(m_KeepPosition::m_fPos), player->Teleport(m_KeepPosition::m_fPos));
m_KeepPosition::m_fPos = CVector(0, 0, 0); m_KeepPosition::m_fPos = CVector(0, 0, 0);
} }
} }
@ -285,8 +294,8 @@ void Player::ChangePlayerCloth(std::string &name)
#ifdef GTASA #ifdef GTASA
void Player::ChangePlayerModel(std::string& model) void Player::ChangePlayerModel(std::string& model)
{ {
bool custom_skin = bool custom_skin = std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) !=
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_pJson->m_Data.contains(model) || custom_skin) if (Ped::m_PedData.m_pJson->m_Data.contains(model) || custom_skin)
{ {
@ -407,9 +416,8 @@ void Player::Draw()
} }
ImGui::EndDisabled(); ImGui::EndDisabled();
#endif #endif
Ui::CheckboxAddress("Free healthcare", Ui::CheckboxAddress("Free healthcare", BY_GAME((int)&pInfo->m_bFreeHealthCare,
BY_GAME((int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bGetOutOfHospitalFree));
(int)&pInfo->m_bGetOutOfHospitalFree));
if (Ui::CheckboxWithHint("God mode", &m_bGodMode)) if (Ui::CheckboxWithHint("God mode", &m_bGodMode))
{ {
@ -443,8 +451,7 @@ void Player::Draw()
} }
Ui::CheckboxAddress("Infinite sprint", 0xB7CEE4); Ui::CheckboxAddress("Infinite sprint", 0xB7CEE4);
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
Ui::CheckboxAddress("Infinite sprint", Ui::CheckboxAddress("Infinite sprint", BY_GAME(NULL, (int)&pInfo->m_bNeverGetsTired, (int)&pInfo->m_bInfiniteSprint));
BY_GAME(NULL, (int)&pInfo->m_bNeverGetsTired, (int)&pInfo->m_bInfiniteSprint));
#endif #endif
ImGui::NextColumn(); ImGui::NextColumn();
@ -476,8 +483,7 @@ void Player::Draw()
pPlayer->m_pWanted->CheatWantedLevel(0); pPlayer->m_pWanted->CheatWantedLevel(0);
#endif #endif
pPlayer->m_pWanted->Update(); pPlayer->m_pWanted->Update();
patch::SetRaw(BY_GAME(NULL, 0x4D2110, 0x4AD900), (char *)"\xC3\x90\x90\x90\x90\x90", patch::SetRaw(BY_GAME(NULL, 0x4D2110, 0x4AD900), (char*)"\xC3\x90\x90\x90\x90\x90", 6); // CWanted::UpdateWantedLevel()
6); // CWanted::UpdateWantedLevel()
patch::Nop(BY_GAME(NULL, 0x5373D0, 0x4EFE73), 5); // CWanted::Update(); patch::Nop(BY_GAME(NULL, 0x5373D0, 0x4EFE73), 5); // CWanted::Update();
} }
else else
@ -496,8 +502,7 @@ void Player::Draw()
} }
#endif #endif
Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree); Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree);
Ui::CheckboxWithHint("Respawn die location", &m_KeepPosition::m_bEnabled, Ui::CheckboxWithHint("Respawn die location", &m_KeepPosition::m_bEnabled, "Respawn to the location you died from");
"Respawn to the location you died from");
ImGui::Columns(1); ImGui::Columns(1);
@ -596,8 +601,7 @@ void Player::Draw()
Ui::EditStat("Energy", STAT_ENERGY); Ui::EditStat("Energy", STAT_ENERGY);
Ui::EditStat("Fat", STAT_FAT); Ui::EditStat("Fat", STAT_FAT);
#endif #endif
Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100, Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100, BY_GAME(static_cast<int>(pPlayer->m_fMaxHealth), 100, 100));
BY_GAME(static_cast<int>(pPlayer->m_fMaxHealth), 100, 100));
#ifdef GTASA #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);
@ -609,6 +613,7 @@ void Player::Draw()
pInfo->m_nDisplayMoney = money; pInfo->m_nDisplayMoney = money;
#endif #endif
#ifdef GTASA #ifdef GTASA
Ui::EditStat("Muscle", STAT_MUSCLE); Ui::EditStat("Muscle", STAT_MUSCLE);
Ui::EditStat("Respect", STAT_RESPECT); Ui::EditStat("Respect", STAT_RESPECT);
@ -708,9 +713,8 @@ void Player::Draw()
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 " (("Changes to the ped, player is targeting with a weapon.\nTo use aim a ped with a weapon and press ")
"a weapon and press ") + + aimSkinChanger.Pressed())))
aimSkinChanger.Pressed())))
gConfig.SetValue("aim_skin_changer", m_bAimSkinChanger); gConfig.SetValue("aim_skin_changer", m_bAimSkinChanger);
if (ImGui::BeginTabBar("AppearanceTabBar")) if (ImGui::BeginTabBar("AppearanceTabBar"))
{ {
@ -726,9 +730,9 @@ void Player::Draw()
{ {
if (bClothOption == 0) if (bClothOption == 0)
{ {
Ui::DrawImages( Ui::DrawImages(m_ClothData, ChangePlayerCloth, nullptr,
m_ClothData, ChangePlayerCloth, nullptr, [](std::string str)
[](std::string str) { {
std::stringstream ss(str); std::stringstream ss(str);
std::string temp; std::string temp;
@ -736,8 +740,7 @@ 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
{ {
@ -770,8 +773,7 @@ void Player::Draw()
} }
ImGui::Spacing(); ImGui::Spacing();
ImGui::TextWrapped( ImGui::TextWrapped("If CJ is wearing a full suit, click 'Extras/ Remove all' to remove it.");
"If CJ is wearing a full suit, click 'Extras/ Remove all' to remove it.");
} }
} }
else else
@ -789,9 +791,8 @@ void Player::Draw()
} }
if (ImGui::BeginTabItem("Ped skins")) if (ImGui::BeginTabItem("Ped skins"))
{ {
Ui::DrawImages(Ped::m_PedData, ChangePlayerModel, nullptr, [](std::string str) { Ui::DrawImages(Ped::m_PedData, ChangePlayerModel, nullptr,
return Ped::m_PedData.m_pJson->m_Data[str].get<std::string>(); [](std::string str) { return Ped::m_PedData.m_pJson->m_Data[str].get<std::string>(); });
});
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem("Custom skins")) if (ImGui::BeginTabItem("Custom skins"))
@ -800,13 +801,13 @@ void Player::Draw()
if (m_bModloaderInstalled) if (m_bModloaderInstalled)
{ {
Ui::FilterWithHint( Ui::FilterWithHint("Search", m_ClothData.m_Filter,
"Search", m_ClothData.m_Filter, std::string("Total skins: " + std::to_string(m_CustomSkins::m_List.size()))
std::string("Total skins: " + std::to_string(m_CustomSkins::m_List.size())).c_str()); .c_str());
Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'"); Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'");
ImGui::Spacing(); ImGui::Spacing();
ImGui::TextWrapped("Note: Your txd & dff names can't exceed 8 characters. Don't change names " ImGui::TextWrapped(
"while the game is running."); "Note: Your txd & dff names can't exceed 8 characters. Don't change names while the game is running.");
ImGui::Spacing(); ImGui::Spacing();
for (std::string name : m_CustomSkins::m_List) for (std::string name : m_CustomSkins::m_List)
{ {

View File

@ -20,8 +20,7 @@ private:
static inline ResourceStore m_ClothData { "clothes" , eResourceType::TYPE_IMAGE, ImVec2(70, 100)}; static inline ResourceStore m_ClothData { "clothes" , eResourceType::TYPE_IMAGE, ImVec2(70, 100)};
struct m_CustomSkins struct m_CustomSkins
{ {
static inline std::string m_Path = paths::GetGameDirPathA() + std::string("\\modloader\\Custom Skins\\"); static inline std::string m_Path = paths::GetGameDirPathA() + std::string("\\modloader\\Custom Skins\\");;
;
static inline ImGuiTextFilter m_Filter; static inline ImGuiTextFilter m_Filter;
static inline std::vector<std::string> m_List; static inline std::vector<std::string> m_List;
}; };

View File

@ -1,10 +1,12 @@
#include "pch.h"
#include "CFileLoader.h" #include "CFileLoader.h"
#include "extensions/Paths.h" #include "extensions/Paths.h"
#include "pch.h"
ResourceStore::ResourceStore(const char *text, eResourceType type, ImVec2 imageSize) : m_ImageSize(imageSize) ResourceStore::ResourceStore(const char* text, eResourceType type, ImVec2 imageSize)
: m_ImageSize(imageSize)
{ {
if (type == eResourceType::TYPE_TEXT || type == eResourceType::TYPE_BOTH) if (type == eResourceType::TYPE_TEXT
|| type == eResourceType::TYPE_BOTH)
{ {
m_pJson = std::make_unique<CJson>(text); m_pJson = std::make_unique<CJson>(text);
@ -18,13 +20,15 @@ ResourceStore::ResourceStore(const char *text, eResourceType type, ImVec2 imageS
} }
} }
if (type == eResourceType::TYPE_IMAGE || type == eResourceType::TYPE_BOTH) if (type == eResourceType::TYPE_IMAGE
|| type == eResourceType::TYPE_BOTH)
{ {
/* /*
Textures need to be loaded from main thread Textures need to be loaded from main thread
Loading it directly here doesn't work Loading it directly here doesn't work
*/ */
Events::processScriptsEvent += [text, this]() { Events::processScriptsEvent += [text, this]()
{
if (!m_bTexturesLoaded) if (!m_bTexturesLoaded)
{ {
LoadTextureResource(text); LoadTextureResource(text);
@ -85,6 +89,7 @@ void ResourceStore::LoadTextureResource(std::string &&name)
m_Categories.push_back(m_ImagesList.back().get()->m_CategoryName); m_Categories.push_back(m_ImagesList.back().get()->m_CategoryName);
} }
pRLL = (RwLinkList*)pEndDic; pRLL = (RwLinkList*)pEndDic;
} while (pEndDic != (RwTexDictionary *)&pRwTexDictionary->texturesInDict); }
while ( pEndDic != (RwTexDictionary*)&pRwTexDictionary->texturesInDict );
} }
} }

View File

@ -1,12 +1,13 @@
#include <string>
#include <rw/rwcore.h>
#include "json.h"
#include "../depend/imgui/imgui.h" #include "../depend/imgui/imgui.h"
#include "d3d9.h" #include "d3d9.h"
#include "json.h"
#include <rw/rwcore.h>
#include <string>
struct RwD3D9Raster struct RwD3D9Raster
{ {
union { union
{
IDirect3DTexture9* texture; IDirect3DTexture9* texture;
IDirect3DSurface9* surface; IDirect3DSurface9* surface;
}; };

View File

@ -1,6 +1,6 @@
#include "pch.h"
#include "teleport.h" #include "teleport.h"
#include "menu.h" #include "menu.h"
#include "pch.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
@ -29,8 +29,8 @@ void Teleport::FetchRadarSpriteData()
auto sprite_name = m_SpriteJson.m_Data[std::to_string(sprite)].get<std::string>(); auto sprite_name = m_SpriteJson.m_Data[std::to_string(sprite)].get<std::string>();
std::string key_name = sprite_name + ", " + Util::GetLocationName(&pos); std::string key_name = sprite_name + ", " + Util::GetLocationName(&pos);
m_tpData.m_pJson->m_Data["Radar"][key_name] = m_tpData.m_pJson->m_Data["Radar"][key_name] = "0, " + std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " +
"0, " + std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " + std::to_string(pos.z); std::to_string(pos.z);
/* /*
"Radar" : { "Radar" : {
@ -45,31 +45,29 @@ Teleport::Teleport()
{ {
m_bQuickTeleport = gConfig.GetValue("quick_teleport", false); m_bQuickTeleport = gConfig.GetValue("quick_teleport", false);
Events::processScriptsEvent += [] { Events::processScriptsEvent += []
{
if ((m_Teleport::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - m_Teleport::m_nTimer) > 500)) if ((m_Teleport::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - m_Teleport::m_nTimer) > 500))
{ {
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
#ifdef GTASA #ifdef GTASA
CEntity* player_entity = FindPlayerEntity(-1); CEntity* player_entity = FindPlayerEntity(-1);
m_Teleport::m_fPos.z = m_Teleport::m_fPos.z = CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y,
CWorld::FindGroundZFor3DCoord(m_Teleport::m_fPos.x, m_Teleport::m_fPos.y, m_Teleport::m_fPos.z + 100.0f, m_Teleport::m_fPos.z + 100.0f, nullptr, &player_entity) + 1.0f;
nullptr, &player_entity) +
1.0f;
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
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) + m_Teleport::m_fPos.z + 100.0f, nullptr) + 1.0f;
1.0f;
#endif #endif
CVehicle* pVeh = player->m_pVehicle; CVehicle* pVeh = player->m_pVehicle;
if (pVeh && BY_GAME(player->m_nPedFlags.bInVehicle, player->m_pVehicle, player->m_pVehicle)) if (pVeh && BY_GAME(player->m_nPedFlags.bInVehicle, player->m_pVehicle, player->m_pVehicle))
{ {
BY_GAME(pVeh->Teleport(m_Teleport::m_fPos, false), pVeh->Teleport(m_Teleport::m_fPos)); BY_GAME(pVeh->Teleport(m_Teleport::m_fPos, false, false), pVeh->Teleport(m_Teleport::m_fPos));
} }
else else
{ {
BY_GAME(player->Teleport(m_Teleport::m_fPos, false), player->Teleport(m_Teleport::m_fPos)); BY_GAME(player->Teleport(m_Teleport::m_fPos, false, false), player->Teleport(m_Teleport::m_fPos));
} }
m_Teleport::m_bEnabled = false; m_Teleport::m_bEnabled = false;
@ -80,7 +78,8 @@ Teleport::Teleport()
if (m_bQuickTeleport) if (m_bQuickTeleport)
{ {
if (quickTeleport.Pressed() && ((CTimer::m_snTimeInMilliseconds - m_nQuickTeleportTimer) > 500)) if (quickTeleport.Pressed()
&& ((CTimer::m_snTimeInMilliseconds - m_nQuickTeleportTimer) > 500))
{ {
m_nQuickTeleportTimer = CTimer::m_snTimeInMilliseconds; m_nQuickTeleportTimer = CTimer::m_snTimeInMilliseconds;
TeleportPlayer(true); TeleportPlayer(true);
@ -203,11 +202,9 @@ void Teleport::Draw()
ImGui::Checkbox("Insert coordinates", &m_bInsertCoord); ImGui::Checkbox("Insert coordinates", &m_bInsertCoord);
ImGui::NextColumn(); ImGui::NextColumn();
#ifdef GTASA #ifdef GTASA
if (Ui::CheckboxWithHint( if (Ui::CheckboxWithHint("Quick teleport", &m_bQuickTeleport,
"Quick teleport", &m_bQuickTeleport, std::string(std::string("Teleport to the location of your radar\ntarget blip using ")
std::string(std::string("Teleport to the location of your radar\ntarget blip using ") + + quickTeleport.GetNameString()).c_str()))
quickTeleport.GetNameString())
.c_str()))
{ {
gConfig.SetValue("quick_teleport", m_bQuickTeleport); gConfig.SetValue("quick_teleport", m_bQuickTeleport);
} }
@ -221,8 +218,7 @@ void Teleport::Draw()
strcpy(m_nInputBuffer, strcpy(m_nInputBuffer,
(std::to_string(static_cast<int>(pos.x)) + ", " + std::to_string(static_cast<int>(pos.y)) + (std::to_string(static_cast<int>(pos.x)) + ", " + std::to_string(static_cast<int>(pos.y)) +
", " + std::to_string(static_cast<int>(pos.z))) ", " + std::to_string(static_cast<int>(pos.z))).c_str());
.c_str());
} }
ImGui::InputTextWithHint("Coordinates", "x, y, z", m_nInputBuffer, IM_ARRAYSIZE(m_nInputBuffer)); ImGui::InputTextWithHint("Coordinates", "x, y, z", m_nInputBuffer, IM_ARRAYSIZE(m_nInputBuffer));

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "pch.h"
#include <vector> #include <vector>
#include "pch.h"
class Teleport class Teleport
{ {
@ -23,6 +23,7 @@ private:
static inline uint m_nTimer; static inline uint m_nTimer;
}; };
#ifdef GTASA #ifdef GTASA
/* /*
Generates radar sprite coordinates on the fly. Generates radar sprite coordinates on the fly.
@ -33,7 +34,6 @@ private:
protected: protected:
Teleport(); Teleport();
public: public:
static void Draw(); static void Draw();
static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0); static void TeleportPlayer(bool get_marker = false, CVector pos = CVector(0, 0, 0), int interior_id = 0);

View File

@ -1,49 +1,49 @@
#pragma once #pragma once
uchar *m_nAmbientRed = (uchar *)BY_GAME(0x560C61, 0x9388C8);
uchar *m_nAmbientGreen = (uchar *)BY_GAME(0x55F4D6, 0x78D508);
uchar *m_nAmbientBlue = (uchar *)BY_GAME(0x55F4E8, 0x813D48);
uchar *m_nAmbientRed_Obj = (uchar *)BY_GAME(0x55F4FA, 0x7D53B0);
uchar *m_nAmbientGreen_Obj = (uchar *)BY_GAME(0x55F50C, 0x7D9370);
uchar *m_nAmbientBlue_Obj = (uchar *)BY_GAME(0x55F51E, 0x94C038);
uchar *m_nSkyTopRed = (uchar *)BY_GAME(0x55F531, 0x94BE98);
uchar *m_nSkyTopGreen = (uchar *)BY_GAME(0x55F53D, 0x933A58);
uchar *m_nSkyTopBlue = (uchar *)BY_GAME(0x55F549, 0x94A170);
uchar *m_nSkyBottomRed = (uchar *)BY_GAME(0x55F555, 0x7E44A0);
uchar *m_nSkyBottomGreen = (uchar *)BY_GAME(0x55F561, 0x7E9CD0);
uchar *m_nSkyBottomBlue = (uchar *)BY_GAME(0x55F56D, 0x92D420);
uchar *m_nSunCoreRed = (uchar *)BY_GAME(0x55F59D, 0x944098);
uchar *m_nSunCoreGreen = (uchar *)BY_GAME(0x55F5A9, 0x7D94C0);
uchar *m_nSunCoreBlue = (uchar *)BY_GAME(0x55F5B5, 0x8614F8);
uchar *m_nSunCoronaRed = (uchar *)BY_GAME(0x55F579, 0x78CCD8);
uchar *m_nSunCoronaGreen = (uchar *)BY_GAME(0x55F585, 0x7DBC08);
uchar *m_nSunCoronaBlue = (uchar *)BY_GAME(0x55F591, 0x7D1818);
uchar *m_nLowCloudsRed = (uchar *)BY_GAME(0x55F653, 0x8100C0);
uchar *m_nLowCloudsGreen = (uchar *)BY_GAME(0x55F65F, 0x94AEA0);
uchar *m_nLowCloudsBlue = (uchar *)BY_GAME(0x55F66B, 0x94BDF0);
uchar *m_fLightsOnGroundBrightness = (uchar *)BY_GAME(0x55F640, 0x92D378);
uchar *m_nPoleShadowStrength = (uchar *)BY_GAME(0x55F60F, 0x812090);
uchar *m_nLightShadowStrength = (uchar *)BY_GAME(0x55F603, 0x811828);
uchar *m_nShadowStrength = (uchar *)BY_GAME(0x55F5F7, 0x92D260);
uchar *m_fSpriteBrightness = (uchar *)BY_GAME(0x55F5E4, 0x7D5308);
uchar *m_fSpriteSize = (uchar *)BY_GAME(0x55F5D2, 0x94B848);
uchar *m_fSunSize = (uchar *)BY_GAME(0x55F5C0, 0x818720);
short *m_fFogStart = (short *)BY_GAME(0x55F62E, 0x94D638);
short *m_fFarClip = (short *)BY_GAME(0x55F61B, 0x94D4E8);
uchar *m_fWaterRed = (uchar *)BY_GAME(0x55F69C, 0x7E5560);
uchar *m_fWaterGreen = (uchar *)BY_GAME(0x55F6B0, 0x7DE148);
uchar *m_fWaterBlue = (uchar *)BY_GAME(0x55F6C3, 0x862248);
uchar *m_fWaterAlpha = (uchar *)BY_GAME(0x55F6D6, 0x7DDAE0);
#ifdef GTASA #ifdef GTASA
uchar *m_nAmbientRed = (uchar *)0x560C61;
uchar *m_nAmbientGreen = (uchar *)0x55F4D6;
uchar *m_nAmbientBlue = (uchar *)0x55F4E8;
uchar *m_nAmbientRed_Obj = (uchar *)0x55F4FA;
uchar *m_nAmbientGreen_Obj = (uchar *)0x55F50C;
uchar *m_nAmbientBlue_Obj = (uchar *)0x55F51E;
uchar *m_nSkyTopRed = (uchar *)0x55F531;
uchar *m_nSkyTopGreen = (uchar *)0x55F53D;
uchar *m_nSkyTopBlue = (uchar *)0x55F549;
uchar *m_nSkyBottomRed = (uchar *)0x55F555;
uchar *m_nSkyBottomGreen = (uchar *)0x55F561;
uchar *m_nSkyBottomBlue = (uchar *)0x55F56D;
uchar *m_nSunCoreRed = (uchar *)0x55F59D;
uchar *m_nSunCoreGreen = (uchar *)0x55F5A9;
uchar *m_nSunCoreBlue = (uchar *)0x55F5B5;
uchar *m_nSunCoronaRed = (uchar *)0x55F579;
uchar *m_nSunCoronaGreen = (uchar *)0x55F585;
uchar *m_nSunCoronaBlue = (uchar *)0x55F591;
uchar *m_nLowCloudsRed = (uchar *)0x55F653;
uchar *m_nLowCloudsGreen = (uchar *)0x55F65F;
uchar *m_nLowCloudsBlue = (uchar *)0x55F66B;
uchar *m_fLightsOnGroundBrightness = (uchar *)0x55F640;
uchar *m_nPoleShadowStrength = (uchar *)0x55F60F;
uchar *m_nLightShadowStrength = (uchar *)0x55F603;
uchar *m_nShadowStrength = (uchar *)0x55F5F7;
uchar *m_fSpriteBrightness = (uchar *)0x55F5E4;
uchar *m_fSpriteSize = (uchar *)0x55F5D2;
uchar *m_fSunSize = (uchar *)0x55F5C0;
short *m_fFogStart = (short *)0x55F62E;
short *m_fFarClip = (short *)0x55F61B;
uchar *m_fWaterRed = (uchar *)0x55F69C;
uchar *m_fWaterGreen = (uchar *)0x55F6B0;
uchar *m_fWaterBlue = (uchar *)0x55F6C3;
uchar *m_fWaterAlpha = (uchar *)0x55F6D6;
uchar *m_fPostFx2Alpha = (uchar *)0x55F77D; uchar *m_fPostFx2Alpha = (uchar *)0x55F77D;
uchar *m_fPostFx2Blue = (uchar *)0x55F767; uchar *m_fPostFx2Blue = (uchar *)0x55F767;
uchar *m_fPostFx2Green = (uchar *)0x55F751; uchar *m_fPostFx2Green = (uchar *)0x55F751;
@ -63,6 +63,49 @@ uchar *m_nHighLightMinIntensity = (uchar *)0x55F7A9;
uchar *m_fCloudAlpha = (uchar *)0x55F793; uchar *m_fCloudAlpha = (uchar *)0x55F793;
#elif GTAVC #elif GTAVC
uchar *m_nAmbientRed = (uchar *)0x9388C8;
uchar *m_nAmbientGreen = (uchar *)0x78D508;
uchar *m_nAmbientBlue = (uchar *)0x813D48;
uchar *m_nAmbientRed_Obj = (uchar *)0x7D53B0;
uchar *m_nAmbientGreen_Obj = (uchar *)0x7D9370;
uchar *m_nAmbientBlue_Obj = (uchar *)0x94C038;
uchar *m_nSkyTopRed = (uchar *)0x94BE98;
uchar *m_nSkyTopGreen = (uchar *)0x933A58;
uchar *m_nSkyTopBlue = (uchar *)0x94A170;
uchar *m_nSkyBottomRed = (uchar *)0x7E44A0;
uchar *m_nSkyBottomGreen = (uchar *)0x7E9CD0;
uchar *m_nSkyBottomBlue = (uchar *)0x92D420;
uchar *m_nSunCoreRed = (uchar *)0x944098;
uchar *m_nSunCoreGreen = (uchar *)0x7D94C0;
uchar *m_nSunCoreBlue = (uchar *)0x8614F8;
uchar *m_nSunCoronaRed = (uchar *)0x78CCD8;
uchar *m_nSunCoronaGreen = (uchar *)0x7DBC08;
uchar *m_nSunCoronaBlue = (uchar *)0x7D1818;
uchar *m_nLowCloudsRed = (uchar *)0x8100C0;
uchar *m_nLowCloudsGreen = (uchar *)0x94AEA0;
uchar *m_nLowCloudsBlue = (uchar *)0x94BDF0;
uchar *m_fLightsOnGroundBrightness = (uchar *)0x92D378;
uchar *m_nPoleShadowStrength = (uchar *)0x812090;
uchar *m_nLightShadowStrength = (uchar *)0x811828;
uchar *m_nShadowStrength = (uchar *)0x92D260;
uchar *m_fSpriteBrightness = (uchar *)0x7D5308;
uchar *m_fSpriteSize = (uchar *)0x94B848;
uchar *m_fSunSize = (uchar *)0x818720;
short *m_fFogStart = (short *)0x94D638;
short *m_fFarClip = (short *)0x94D4E8;
uchar *m_fWaterRed = (uchar *)0x7E5560;
uchar *m_fWaterGreen = (uchar *)0x7DE148;
uchar *m_fWaterBlue = (uchar *)0x862248;
uchar *m_fWaterAlpha = (uchar *)0x7DDAE0;
uchar *m_nAmbientBlRed = (uchar *)0x78D5B0; uchar *m_nAmbientBlRed = (uchar *)0x78D5B0;
uchar *m_nAmbientBlGreen = (uchar *)0x861430; uchar *m_nAmbientBlGreen = (uchar *)0x861430;
uchar *m_nAmbientBlBlue = (uchar *)0x811740; uchar *m_nAmbientBlBlue = (uchar *)0x811740;
@ -86,4 +129,57 @@ uchar *m_nBottomCloudsBlue = (uchar *)0x7D9630;
uchar *m_nBlurRed = (uchar *)0x94B790; uchar *m_nBlurRed = (uchar *)0x94B790;
uchar *m_nBlurGreen = (uchar *)0x8621A0; uchar *m_nBlurGreen = (uchar *)0x8621A0;
uchar *m_nBlurBlue = (uchar *)0x945728; uchar *m_nBlurBlue = (uchar *)0x945728;
#else // GTA3
uchar *m_nAmbientRed = (uchar *)0x86AF78;
uchar *m_nAmbientGreen = (uchar *)0x665308;
uchar *m_nAmbientBlue = (uchar *)0x72CF88;
uchar *m_nDirRed = (uchar *)0x6FAB78;
uchar *m_nDirGreen = (uchar *)0x6F4528;
uchar *m_nDirBlue = (uchar *)0x83CE58;
uchar *m_nSkyTopRed = (uchar *)0x87FB90;
uchar *m_nSkyTopGreen = (uchar *)0x8460A8;
uchar *m_nSkyTopBlue = (uchar *)0x87B158;
uchar *m_nSkyBottomRed = (uchar *)0x6FA960;
uchar *m_nSkyBottomGreen = (uchar *)0x70D6A8;
uchar *m_nSkyBottomBlue = (uchar *)0x83D288;
uchar *m_nSunCoreRed = (uchar *)0x878360;
uchar *m_nSunCoreGreen = (uchar *)0x6EE088;
uchar *m_nSunCoreBlue = (uchar *)0x773A68;
uchar *m_nSunCoronaRed = (uchar *)0x664B60;
uchar *m_nSunCoronaGreen = (uchar *)0x6F01E0;
uchar *m_nSunCoronaBlue = (uchar *)0x6E6340;
uchar *m_nShadowStrength = (uchar *)0x83CFD8;
uchar *m_nLightShadowStrength = (uchar *)0x72B0F8;
uchar *m_nTreeShadowStrength = (uchar *)0x733450;
uchar *m_fSunSize = (uchar *)0x733510;
uchar *m_fSpriteSize = (uchar *)0x87F820;
uchar *m_fSpriteBrightness = (uchar *)0x6E96F0;
short *m_fFarClip = (short *)0x8804E0;
short *m_fFogStart = (short *)0x8806C8;
uchar *m_fLightsOnGroundBrightness = (uchar *)0x83D108;
uchar *m_nLowCloudsRed = (uchar *)0x726770;
uchar *m_nLowCloudsGreen = (uchar *)0x87BF08;
uchar *m_nLowCloudsBlue = (uchar *)0x87FA10;
uchar *m_nTopCloudsRed = (uchar *)0x70F2B0;
uchar *m_nTopCloudsGreen = (uchar *)0x72D288;
uchar *m_nTopCloudsBlue = (uchar *)0x86B108;
uchar *m_nBottomCloudsRed = (uchar *)0x6E8DA8;
uchar *m_nBottomCloudsGreen = (uchar *)0x715AA8;
uchar *m_nBottomCloudsBlue = (uchar *)0x6EE2D0;
uchar *m_fWaterRed = (uchar *)0x87C7E0;
uchar *m_fWaterGreen = (uchar *)0x774C10;
uchar *m_fWaterBlue = (uchar *)0x8784E0;
uchar *m_fWaterAlpha = (uchar *)0x733690;
#endif #endif

View File

@ -1,6 +1,6 @@
#include "ui.h"
#include "pch.h" #include "pch.h"
#include "util.h" #include "util.h"
#include "ui.h"
bool Ui::ListBox(const char* label, std::vector<std::string>& all_items, int& selected) bool Ui::ListBox(const char* label, std::vector<std::string>& all_items, int& selected)
{ {
@ -42,8 +42,7 @@ bool Ui::ListBoxStr(const char *label, std::vector<std::string> &all_items, std:
return rtn; return rtn;
} }
bool Ui::ListBoxCustomNames(const char *label, std::vector<std::string> &all_items, std::string &selected, bool Ui::ListBoxCustomNames(const char* label, std::vector<std::string>& all_items, std::string& selected, const char* customNames[], size_t length)
const char *customNames[], size_t length)
{ {
bool rtn = false; bool rtn = false;
std::string display_selected = (selected == "All") ? selected : customNames[std::stoi(selected)]; std::string display_selected = (selected == "All") ? selected : customNames[std::stoi(selected)];
@ -115,6 +114,7 @@ void Ui::DrawHeaders(CallbackTable &data)
func = it->second; func = it->second;
} }
if (ImGui::Button(btn_text, GetSize(3, false))) if (ImGui::Button(btn_text, GetSize(3, false)))
{ {
m_HeaderId = btn_text; m_HeaderId = btn_text;
@ -345,7 +345,8 @@ bool Ui::CheckboxBitFlag(const char *label, uint flag, const char *hint)
return rtn; return rtn;
} }
void Ui::DrawJSON(ResourceStore &data, std::function<void(std::string &, std::string &, std::string &)> func_left_click, void Ui::DrawJSON(ResourceStore& data,
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)
{ {
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5); ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5);
@ -373,6 +374,7 @@ void Ui::DrawJSON(ResourceStore &data, std::function<void(std::string &, std::st
jsonPopup.function = nullptr; jsonPopup.function = nullptr;
} }
ImGui::BeginChild(1); ImGui::BeginChild(1);
for (auto root : data.m_pJson->m_Data.items()) for (auto root : data.m_pJson->m_Data.items())
{ {
@ -413,6 +415,7 @@ void Ui::DrawJSON(ResourceStore &data, std::function<void(std::string &, std::st
if (ImGui::MenuItem("Remove")) if (ImGui::MenuItem("Remove"))
jsonPopup.function(jsonPopup.rootKey, jsonPopup.key, jsonPopup.value); jsonPopup.function(jsonPopup.rootKey, jsonPopup.key, jsonPopup.value);
if (ImGui::MenuItem("Close")) if (ImGui::MenuItem("Close"))
jsonPopup.function = nullptr; jsonPopup.function = nullptr;
@ -479,9 +482,9 @@ void Ui::FilterWithHint(const char *label, ImGuiTextFilter &filter, const char *
} }
} }
void Ui::DrawImages(ResourceStore &store, std::function<void(std::string &)> onLeftClick, void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLeftClick, std::function<void(std::string&)> onRightClick,
std::function<void(std::string &)> onRightClick, std::function<std::string(std::string &)> getName, std::function<std::string(std::string&)> getName, std::function<bool(std::string&)> verifyFunc,
std::function<bool(std::string &)> verifyFunc, const char **customNames, size_t length) const char** customNames, size_t length)
{ {
/* /*
Trying to scale images based on resolutions Trying to scale images based on resolutions
@ -493,8 +496,7 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string &)> onL
int imageCount = 1; int imageCount = 1;
int imagesInRow = static_cast<int>(ImGui::GetWindowContentRegionWidth() / m_ImageSize.x); int imagesInRow = static_cast<int>(ImGui::GetWindowContentRegionWidth() / m_ImageSize.x);
m_ImageSize.x = m_ImageSize.x = ImGui::GetWindowContentRegionWidth() / imagesInRow - static_cast<int>(ImGuiStyleVar_ItemSpacing) * 0.65f;
ImGui::GetWindowContentRegionWidth() / imagesInRow - static_cast<int>(ImGuiStyleVar_ItemSpacing) * 0.65f;
ImGui::Spacing(); ImGui::Spacing();
@ -525,9 +527,10 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string &)> onL
std::string text = store.m_ImagesList[i]->m_FileName; std::string text = store.m_ImagesList[i]->m_FileName;
std::string modelName = getName(text); std::string modelName = getName(text);
if (store.m_Filter.PassFilter(modelName.c_str()) && if (store.m_Filter.PassFilter(modelName.c_str())
(store.m_ImagesList[i]->m_CategoryName == store.m_Selected || store.m_Selected == "All") && && (store.m_ImagesList[i]->m_CategoryName == store.m_Selected || store.m_Selected == "All")
(verifyFunc == nullptr || verifyFunc(text))) && (verifyFunc == nullptr || verifyFunc(text))
)
{ {
/* /*
Couldn't figure out how to laod images for Dx11 Couldn't figure out how to laod images for Dx11
@ -542,8 +545,7 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string &)> onL
} }
else else
{ {
if (ImGui::ImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, ImVec2(0, 0), ImVec2(1, 1), 1, if (ImGui::ImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, ImVec2(0, 0), ImVec2(1, 1), 1, ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1)))
{ {
onLeftClick(text); onLeftClick(text);
} }
@ -822,6 +824,7 @@ void Ui::EditFloat(const char *label, const int address, const float min, const
ImGui::SameLine(0.0, 4.0); ImGui::SameLine(0.0, 4.0);
ImGui::Text("Set"); ImGui::Text("Set");
ImGui::Spacing(); ImGui::Spacing();
if (ImGui::Button(("Minimum##" + std::string(label)).c_str(), GetSize(items))) if (ImGui::Button(("Minimum##" + std::string(label)).c_str(), GetSize(items)))

View File

@ -33,6 +33,7 @@ public:
static inline JsonPopUpData jsonPopup; static inline JsonPopUpData jsonPopup;
static inline ImgPopUpData imgPopup; static inline ImgPopUpData imgPopup;
Ui() = delete; Ui() = delete;
Ui(Ui&) = delete; Ui(Ui&) = delete;
@ -60,8 +61,7 @@ public:
template <typename T> template <typename T>
static void EditAddress(const char* label, int address, int min = 0, int def = 0, int max = 100); static void EditAddress(const char* label, int address, int min = 0, int def = 0, int max = 100);
static void EditBits(const char* label, int address, const std::vector<std::string>& names); static void EditBits(const char* label, int address, const std::vector<std::string>& names);
static void EditFloat(const char *label, int address, float min, float def, float max, float mul = 1, static void EditFloat(const char* label, int address, float min, float def, float max, float mul = 1, float change = 1.0f);
float change = 1.0f);
template <typename T> template <typename T>
static void EditReference(const char* label, T& address, int min = 0, int def = 0, int max = 100); static void EditReference(const char* label, T& address, int min = 0, int def = 0, int max = 100);
static void EditRadioButtonAddress(const char* label, std::vector<NamedMemory>& named_mem); static void EditRadioButtonAddress(const char* label, std::vector<NamedMemory>& named_mem);
@ -77,8 +77,7 @@ public:
static bool ListBox(const char* label, std::vector<std::string>& all_items, int& selected); static bool ListBox(const char* label, std::vector<std::string>& all_items, int& selected);
static bool ListBoxStr(const char* label, std::vector<std::string>& all_items, std::string& selected); static bool ListBoxStr(const char* label, std::vector<std::string>& all_items, std::string& selected);
static bool ListBoxCustomNames(const char *label, std::vector<std::string> &all_items, std::string &selected, static bool ListBoxCustomNames(const char* label, std::vector<std::string>& all_items, std::string& selected, const char* custom_names[] = nullptr, size_t length = 0);
const char *custom_names[] = nullptr, size_t length = 0);
static void RadioButtonAddress(const char* label, std::vector<NamedMemory>& named_mem); static void RadioButtonAddress(const char* label, std::vector<NamedMemory>& named_mem);
static void RadioButtonAddressEx(const char* label, int addr, std::vector<NamedValue>& named_val); static void RadioButtonAddressEx(const char* label, int addr, std::vector<NamedValue>& named_val);
@ -146,7 +145,8 @@ void Ui::EditAddress(const char *label, const int address, const int min, const
} }
} }
template <typename T> void Ui::EditReference(const char *label, T &address, const int min, const int def, const int max) template <typename T>
void Ui::EditReference(const char* label, T& address, const int min, const int def, const int max)
{ {
if (ImGui::CollapsingHeader(label)) if (ImGui::CollapsingHeader(label))
{ {

View File

@ -1,7 +1,7 @@
#include "updater.h"
#include "menuinfo.h"
#include "pch.h" #include "pch.h"
#include "updater.h"
#include "ui.h" #include "ui.h"
#include "menuinfo.h"
#include "util.h" #include "util.h"
void Updater::CheckForUpdate() void Updater::CheckForUpdate()
@ -63,10 +63,8 @@ void Updater::ShowUpdateScreen()
if (ImGui::Button("Download page", Ui::GetSize(3))) if (ImGui::Button("Download page", Ui::GetSize(3)))
{ {
ShellExecute( ShellExecute(NULL, "open", std::string("https://github.com/user-grinch/Cheat-Menu/releases/tag/" +
NULL, "open", Updater::m_LatestVersion).c_str(), NULL, NULL, SW_SHOWNORMAL);
std::string("https://github.com/user-grinch/Cheat-Menu/releases/tag/" + Updater::m_LatestVersion).c_str(),
NULL, NULL, SW_SHOWNORMAL);
} }
ImGui::SameLine(); ImGui::SameLine();

View File

@ -1,5 +1,5 @@
#include "util.h"
#include "pch.h" #include "pch.h"
#include "util.h"
#include "psapi.h" #include "psapi.h"
std::string Util::GetLocationName(CVector* pos) std::string Util::GetLocationName(CVector* pos)
@ -95,8 +95,8 @@ void Util::ClearCharTasksVehCheck(CPed *ped)
bool Util::IsOnMission() bool Util::IsOnMission()
{ {
return FindPlayerPed()->CanPlayerStartMission() && return FindPlayerPed()->CanPlayerStartMission() && !*(patch::Get<char*>(0x5D5380, false) +
!*(patch::Get<char *>(0x5D5380, false) + CTheScripts::OnAMissionFlag); CTheScripts::OnAMissionFlag);
} }
int Util::GetLargestGangInZone() int Util::GetLargestGangInZone()

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "pdh.h"
#include "tchar.h" #include "tchar.h"
#include "pdh.h"
static PDH_HQUERY cpuQuery; static PDH_HQUERY cpuQuery;
static PDH_HCOUNTER cpuTotal; static PDH_HCOUNTER cpuTotal;
@ -11,6 +11,7 @@ static HANDLE self;
class Util class Util
{ {
public: public:
#ifdef GTASA #ifdef GTASA
static void ClearCharTasksVehCheck(CPed* ped); static void ClearCharTasksVehCheck(CPed* ped);
static int GetLargestGangInZone(); static int GetLargestGangInZone();

View File

@ -1,11 +1,11 @@
#include "vehicle.h"
#include "filehandler.h"
#include "menu.h"
#include "pch.h" #include "pch.h"
#include "vehicle.h"
#include "menu.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#include <CDamageManager.h> #include "filehandler.h"
#include <CPopulation.h> #include <CPopulation.h>
#include <CDamageManager.h>
void Vehicle::FixVehicle(CVehicle *pVeh) void Vehicle::FixVehicle(CVehicle *pVeh)
{ {
@ -14,12 +14,14 @@ void Vehicle::FixVehicle(CVehicle *pVeh)
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
switch (pVeh->m_nVehicleClass) switch (pVeh->m_nVehicleClass)
{ {
case VEHICLE_AUTOMOBILE: { case VEHICLE_AUTOMOBILE:
{
reinterpret_cast<CAutomobile *>(pVeh)->Fix(); reinterpret_cast<CAutomobile *>(pVeh)->Fix();
break; break;
} }
#ifdef GTAVC #ifdef GTAVC
case VEHICLE_BIKE: { case VEHICLE_BIKE:
{
reinterpret_cast<CBike *>(pVeh)->Fix(); reinterpret_cast<CBike *>(pVeh)->Fix();
break; break;
} }
@ -36,7 +38,8 @@ Vehicle::Vehicle()
#endif #endif
FileHandler::FetchColorData(m_CarcolsColorData); FileHandler::FetchColorData(m_CarcolsColorData);
Events::processScriptsEvent += [this] { Events::processScriptsEvent += [this]
{
uint timer = CTimer::m_snTimeInMilliseconds; uint timer = CTimer::m_snTimeInMilliseconds;
CPlayerPed* pPlayer = FindPlayerPed(); CPlayerPed* pPlayer = FindPlayerPed();
CVehicle* pVeh = BY_GAME(FindPlayerVehicle(-1, false), FindPlayerVehicle(), FindPlayerVehicle()); CVehicle* pVeh = BY_GAME(FindPlayerVehicle(-1, false), FindPlayerVehicle(), FindPlayerVehicle());
@ -64,8 +67,7 @@ Vehicle::Vehicle()
if (vehEngine.Pressed()) if (vehEngine.Pressed())
{ {
bool state = bool state = BY_GAME(!pVeh->m_nVehicleFlags.bEngineBroken, true, true) || pVeh->m_nVehicleFlags.bEngineOn;
BY_GAME(!pVeh->m_nVehicleFlags.bEngineBroken, true, true) || pVeh->m_nVehicleFlags.bEngineOn;
if (state) if (state)
{ {
@ -122,8 +124,8 @@ Vehicle::Vehicle()
#ifdef GTASA #ifdef GTASA
pPlayer->m_nPedFlags.CantBeKnockedOffBike = m_bDontFallBike ? 1 : 2; pPlayer->m_nPedFlags.CantBeKnockedOffBike = m_bDontFallBike ? 1 : 2;
if (m_UnlimitedNitro::m_bEnabled && if (m_UnlimitedNitro::m_bEnabled
BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass) == VEHICLE_AUTOMOBILE) && BY_GAME(pVeh->m_nVehicleSubClass, pVeh->m_nVehicleClass) == VEHICLE_AUTOMOBILE)
{ {
patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro patch::Set<BYTE>(0x969165, 0, true); // All cars have nitro
patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro patch::Set<BYTE>(0x96918B, 0, true); // All taxis have nitro
@ -192,10 +194,11 @@ Vehicle::Vehicle()
{ {
if (pVeh->m_nVehicleSubClass == VEHICLE_BIKE || pVeh->m_nVehicleSubClass == VEHICLE_BMX) if (pVeh->m_nVehicleSubClass == VEHICLE_BIKE || pVeh->m_nVehicleSubClass == VEHICLE_BMX)
{ {
if (sqrt(pVeh->m_vecMoveSpeed.x * pVeh->m_vecMoveSpeed.x + if (sqrt(pVeh->m_vecMoveSpeed.x * pVeh->m_vecMoveSpeed.x
pVeh->m_vecMoveSpeed.y * pVeh->m_vecMoveSpeed.y + + pVeh->m_vecMoveSpeed.y * pVeh->m_vecMoveSpeed.y
pVeh->m_vecMoveSpeed.z * pVeh->m_vecMoveSpeed.z) > 0.0 && + pVeh->m_vecMoveSpeed.z * pVeh->m_vecMoveSpeed.z
CTimer::ms_fTimeStep > 0.0) ) > 0.0
&& CTimer::ms_fTimeStep > 0.0)
{ {
pVeh->FlyingControl(3, -9999.9902f, -9999.9902f, -9999.9902f, -9999.9902f); pVeh->FlyingControl(3, -9999.9902f, -9999.9902f, -9999.9902f, -9999.9902f);
} }
@ -228,6 +231,7 @@ void Vehicle::AddComponent(const std::string &component, const bool display_mess
} }
} }
void Vehicle::RemoveComponent(const std::string& component, const bool display_message) void Vehicle::RemoveComponent(const std::string& component, const bool display_message)
{ {
try try
@ -395,8 +399,8 @@ void Vehicle::SpawnVehicle(std::string &rootkey, std::string &vehName, std::stri
CTrain* carraige = nullptr; CTrain* carraige = nullptr;
int track = Random(0, 1); int track = Random(0, 1);
int node = CTrain::FindClosestTrackNode(pos, &track); int node = CTrain::FindClosestTrackNode(pos, &track);
CTrain::CreateMissionTrain(pos, (Random(0, 1)) == 1 ? true : false, train_id, &train, &carraige, node, track, CTrain::CreateMissionTrain(pos, (Random(0, 1)) == 1 ? true : false, train_id, &train, &carraige, node,
false); track, false);
veh = (CVehicle*)train; veh = (CVehicle*)train;
hveh = CPools::GetVehicleRef(veh); hveh = CPools::GetVehicleRef(veh);
@ -578,8 +582,7 @@ void Vehicle::Draw()
Ui::CheckboxAddress("Cars fly", BY_GAME(0x969160, 0xA10B28, NULL)); Ui::CheckboxAddress("Cars fly", BY_GAME(0x969160, 0xA10B28, NULL));
Ui::CheckboxWithHint("Cars heavy", &m_bVehHeavy); Ui::CheckboxWithHint("Cars heavy", &m_bVehHeavy);
#endif #endif
if (Ui::CheckboxWithHint( if (Ui::CheckboxWithHint("Damage proof", &m_bNoDamage,
"Damage proof", &m_bNoDamage,
"Every vehicle entered will be damage proof\nBullet, Collision, Explosion, Fire, Meele etc")) "Every vehicle entered will be damage proof\nBullet, Collision, Explosion, Fire, Meele etc"))
{ {
if (pVeh && !m_bNoDamage) if (pVeh && !m_bNoDamage)
@ -650,8 +653,7 @@ void Vehicle::Draw()
Ui::CheckboxAddress("Perfect handling", 0x96914C); Ui::CheckboxAddress("Perfect handling", 0x96914C);
Ui::CheckboxAddress("Tank mode", 0x969164); Ui::CheckboxAddress("Tank mode", 0x969164);
Ui::CheckboxWithHint("Unlimited nitro", &m_UnlimitedNitro::m_bEnabled, Ui::CheckboxWithHint("Unlimited nitro", &m_UnlimitedNitro::m_bEnabled, "Nitro will activate when left clicked\n\
"Nitro will activate when left clicked\n\
\nEnabling this would disable\nAll cars have nitro\nAll taxis have nitro"); \nEnabling this would disable\nAll cars have nitro\nAll taxis have nitro");
#elif GTA3 #elif GTA3
Ui::CheckboxAddress("Perfect handling", 0x95CD66); Ui::CheckboxAddress("Perfect handling", 0x95CD66);
@ -679,20 +681,16 @@ void Vehicle::Draw()
pVeh->m_nVehicleFlags.bAlwaysSkidMarks = state; pVeh->m_nVehicleFlags.bAlwaysSkidMarks = state;
#endif #endif
state = BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof, state = BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof, pVeh->m_nEntityFlags.bBulletProof);
pVeh->m_nEntityFlags.bBulletProof);
if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bNoDamage)) if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bNoDamage))
{ {
BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof, BY_GAME(pVeh->m_nPhysicalFlags.bBulletProof, pVeh->m_nFlags.bBulletProof, pVeh->m_nEntityFlags.bBulletProof) = state;
pVeh->m_nEntityFlags.bBulletProof) = state;
} }
state = BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof, state = BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof, pVeh->m_nEntityFlags.bCollisionProof);
pVeh->m_nEntityFlags.bCollisionProof);
if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bNoDamage)) if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bNoDamage))
{ {
BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof, BY_GAME(pVeh->m_nPhysicalFlags.bCollisionProof, pVeh->m_nFlags.bCollisionProof, pVeh->m_nEntityFlags.bCollisionProof) = state;
pVeh->m_nEntityFlags.bCollisionProof) = state;
} }
#ifdef GTASA #ifdef GTASA
@ -718,20 +716,16 @@ void Vehicle::Draw()
pVeh->m_nVehicleFlags.bEngineOn = state; pVeh->m_nVehicleFlags.bEngineOn = state;
} }
state = BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof, state = BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof, pVeh->m_nEntityFlags.bExplosionProof);
pVeh->m_nEntityFlags.bExplosionProof);
if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bNoDamage)) if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bNoDamage))
{ {
BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof, BY_GAME(pVeh->m_nPhysicalFlags.bExplosionProof, pVeh->m_nFlags.bExplosionProof, pVeh->m_nEntityFlags.bExplosionProof) = state;
pVeh->m_nEntityFlags.bExplosionProof) = state;
} }
state = BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof, state = BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof, pVeh->m_nEntityFlags.bFireProof);
pVeh->m_nEntityFlags.bFireProof);
if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bNoDamage)) if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bNoDamage))
{ {
BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof, BY_GAME(pVeh->m_nPhysicalFlags.bFireProof, pVeh->m_nFlags.bFireProof, pVeh->m_nEntityFlags.bFireProof) = state;
pVeh->m_nEntityFlags.bFireProof) = state;
} }
ImGui::NextColumn(); ImGui::NextColumn();
@ -750,22 +744,18 @@ void Vehicle::Draw()
BY_GAME(pVeh->m_bIsVisible, pVeh->m_nFlags.bIsVisible, pVeh->m_nEntityFlags.bIsVisible) = !state; BY_GAME(pVeh->m_bIsVisible, pVeh->m_nFlags.bIsVisible, pVeh->m_nEntityFlags.bIsVisible) = !state;
} }
state = BY_GAME(!pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn, state = BY_GAME(!pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn, pVeh->m_nVehicleFlags.bLightsOn);
pVeh->m_nVehicleFlags.bLightsOn);
if (Ui::CheckboxWithHint("Lights on", &state, nullptr, !is_driver)) if (Ui::CheckboxWithHint("Lights on", &state, nullptr, !is_driver))
{ {
BY_GAME(pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn, BY_GAME(pVeh->ms_forceVehicleLightsOff, pVeh->m_nVehicleFlags.bLightsOn, pVeh->m_nVehicleFlags.bLightsOn) = state;
pVeh->m_nVehicleFlags.bLightsOn) = state;
} }
state = state = BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) == CARLOCK_LOCKED_PLAYER_INSIDE;
BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) == CARLOCK_LOCKED_PLAYER_INSIDE;
if (Ui::CheckboxWithHint("Lock doors", &state, nullptr, !is_driver)) if (Ui::CheckboxWithHint("Lock doors", &state, nullptr, !is_driver))
{ {
if (state) if (state)
{ {
BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) = BY_GAME(pVeh->m_nDoorLock, pVeh->m_nLockStatus, pVeh->m_nDoorLock) = CARLOCK_LOCKED_PLAYER_INSIDE;
CARLOCK_LOCKED_PLAYER_INSIDE;
} }
else else
{ {
@ -773,12 +763,10 @@ void Vehicle::Draw()
} }
} }
state = BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof, state = BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof, pVeh->m_nEntityFlags.bMeleeProof);
pVeh->m_nEntityFlags.bMeleeProof);
if (Ui::CheckboxWithHint("Melee proof", &state, nullptr, m_bNoDamage)) if (Ui::CheckboxWithHint("Melee proof", &state, nullptr, m_bNoDamage))
{ {
BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof, BY_GAME(pVeh->m_nPhysicalFlags.bMeeleProof, pVeh->m_nFlags.bMeleeProof, pVeh->m_nEntityFlags.bMeleeProof) = state;
pVeh->m_nEntityFlags.bMeleeProof) = state;
} }
#ifdef GTASA #ifdef GTASA
@ -876,8 +864,8 @@ void Vehicle::Draw()
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_pVehicle != pVeh) && player->m_pVehicle != pVeh)
{ {
Command<Commands::DELETE_CAR>(CPools::GetVehicleRef(pVeh)); Command<Commands::DELETE_CAR>(CPools::GetVehicleRef(pVeh));
} }
@ -891,13 +879,17 @@ void Vehicle::Draw()
if (ImGui::CollapsingHeader("Traffic options")) if (ImGui::CollapsingHeader("Traffic options"))
{ {
static std::vector<Ui::NamedMemory> color{{"Black", BY_GAME(0x969151, 0xA10B82)}, static std::vector<Ui::NamedMemory> color
{"Pink", BY_GAME(0x969150, 0xA10B26)}}; {
{"Black", BY_GAME(0x969151, 0xA10B82)},
{"Pink", BY_GAME(0x969150, 0xA10B26)}
};
Ui::RadioButtonAddress("Color", color); Ui::RadioButtonAddress("Color", color);
ImGui::Spacing(); ImGui::Spacing();
#ifdef GTASA #ifdef GTASA
static std::vector<Ui::NamedMemory> type{ static std::vector<Ui::NamedMemory> type{
{"Cheap", 0x96915E}, {"Country", 0x96917B}, {"Fast", 0x96915F}}; {"Cheap", 0x96915E}, {"Country", 0x96917B}, {"Fast", 0x96915F}
};
Ui::RadioButtonAddress("Type", type); Ui::RadioButtonAddress("Type", type);
#endif #endif
ImGui::Spacing(); ImGui::Spacing();
@ -1018,13 +1010,17 @@ void Vehicle::Draw()
Ui::CheckboxWithHint("Spawn aircraft in air", &m_Spawner::m_bSpawnInAir); Ui::CheckboxWithHint("Spawn aircraft in air", &m_Spawner::m_bSpawnInAir);
ImGui::Columns(1); ImGui::Columns(1);
ImGui::Spacing(); ImGui::Spacing();
#ifdef GTASA #ifdef GTASA
ImGui::SetNextItemWidth(ImGui::GetWindowContentRegionWidth() - 2.5); ImGui::SetNextItemWidth(ImGui::GetWindowContentRegionWidth() - 2.5);
ImGui::InputTextWithHint("##LicenseText", "License plate text", m_Spawner::m_nLicenseText, 9); ImGui::InputTextWithHint("##LicenseText", "License plate text", m_Spawner::m_nLicenseText, 9);
Ui::DrawImages(m_Spawner::m_VehData, SpawnVehicle, nullptr, Ui::DrawImages(m_Spawner::m_VehData, SpawnVehicle, nullptr,
[](std::string str) { return GetNameFromModel(std::stoi(str)); }); [](std::string str)
{
return GetNameFromModel(std::stoi(str));
});
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
Ui::DrawJSON(m_Spawner::m_VehData, SpawnVehicle, nullptr); Ui::DrawJSON(m_Spawner::m_VehData, SpawnVehicle, nullptr);
#endif #endif
@ -1084,9 +1080,8 @@ void Vehicle::Draw()
ImVec2 size = Ui::GetSize(); ImVec2 size = Ui::GetSize();
int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2); int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2);
int btnSize = (ImGui::GetWindowContentRegionWidth() - int btnSize = (ImGui::GetWindowContentRegionWidth() - int(ImGuiStyleVar_ItemSpacing) * (btnsInRow -
int(ImGuiStyleVar_ItemSpacing) * (btnsInRow - 0.6 * btnsInRow)) / 0.6 * btnsInRow)) / btnsInRow;
btnsInRow;
ImGui::BeginChild("Colorss"); ImGui::BeginChild("Colorss");
@ -1094,8 +1089,7 @@ void Vehicle::Draw()
{ {
if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId], ImVec2(btnSize, btnSize))) if (Ui::ColorButton(colorId, m_CarcolsColorData[colorId], ImVec2(btnSize, btnSize)))
{ {
*(uint8_replacement *)(int(veh) + BY_GAME(0x433, 0x19F, 0x19B) + m_Color::m_nRadioButton) = *(uint8_replacement*)(int(veh) + BY_GAME(0x433, 0x19F, 0x19B) + m_Color::m_nRadioButton) = colorId;
colorId;
} }
if ((colorId + 1) % btnsInRow != 0) if ((colorId + 1) % btnsInRow != 0)
@ -1128,8 +1122,7 @@ void Vehicle::Draw()
Ui::CheckboxWithHint("Rainbow neons", &m_Neon::m_bRainbowEffect, "Rainbow effect to neon lights"); Ui::CheckboxWithHint("Rainbow neons", &m_Neon::m_bRainbowEffect, "Rainbow effect to neon lights");
ImGui::NextColumn(); ImGui::NextColumn();
Ui::CheckboxWithHint("Traffic neons", &m_Neon::m_bApplyOnTraffic, Ui::CheckboxWithHint("Traffic neons", &m_Neon::m_bApplyOnTraffic, "Adds neon lights to traffic vehicles.\n\
"Adds neon lights to traffic vehicles.\n\
Only some vehicles will have them."); Only some vehicles will have them.");
ImGui::Columns(1); ImGui::Columns(1);
@ -1145,9 +1138,8 @@ void Vehicle::Draw()
int count = (int)m_CarcolsColorData.size(); int count = (int)m_CarcolsColorData.size();
ImVec2 size = Ui::GetSize(); ImVec2 size = Ui::GetSize();
int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2); int btnsInRow = ImGui::GetWindowContentRegionWidth() / (size.y * 2);
int btnSize = (ImGui::GetWindowContentRegionWidth() - int btnSize = (ImGui::GetWindowContentRegionWidth() - int(ImGuiStyleVar_ItemSpacing) * (btnsInRow -
int(ImGuiStyleVar_ItemSpacing) * (btnsInRow - 0.6 * btnsInRow)) / 0.6 * btnsInRow)) / btnsInRow;
btnsInRow;
ImGui::BeginChild("Neonss"); ImGui::BeginChild("Neonss");
@ -1205,13 +1197,17 @@ void Vehicle::Draw()
ImGui::SameLine(); ImGui::SameLine();
ImGui::Checkbox("Material filter", &m_Color::m_bMatFilter); ImGui::Checkbox("Material filter", &m_Color::m_bMatFilter);
ImGui::Spacing(); ImGui::Spacing();
Ui::DrawImages( Ui::DrawImages(m_TextureData,
m_TextureData, [](std::string& str)
[](std::string &str) { {
Paint::SetNodeTexture(FindPlayerPed()->m_pVehicle, Paint::veh_nodes::selected, str, Paint::SetNodeTexture(FindPlayerPed()->m_pVehicle, Paint::veh_nodes::selected, str,
m_Color::m_bMatFilter); m_Color::m_bMatFilter);
}, },
nullptr, [](std::string &str) { return str; }); nullptr,
[](std::string& str)
{
return str;
});
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -1219,12 +1215,15 @@ void Vehicle::Draw()
if (ImGui::BeginTabItem("Tune")) if (ImGui::BeginTabItem("Tune"))
{ {
ImGui::Spacing(); ImGui::Spacing();
Ui::DrawImages( Ui::DrawImages(m_TuneData,
m_TuneData, [](std::string &str) { AddComponent(str); }, [](std::string& str) { AddComponent(str); },
[](std::string &str) { RemoveComponent(str); }, [](std::string &str) { return str; }, [](std::string& str) { RemoveComponent(str); },
[pPlayer](std::string &str) { [](std::string& str) { return str; },
[pPlayer](std::string& str)
{
return ((bool(*)(int, CVehicle*))0x49B010)(std::stoi(str), pPlayer->m_pVehicle); return ((bool(*)(int, CVehicle*))0x49B010)(std::stoi(str), pPlayer->m_pVehicle);
}); }
);
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -1275,7 +1274,8 @@ void Vehicle::Draw()
Ui::EditFloat("Drag mult", pHandling + 0x10, 0.0f, 0.0f, 30.0f); Ui::EditFloat("Drag mult", pHandling + 0x10, 0.0f, 0.0f, 30.0f);
static std::vector<Ui::NamedValue> drive_type{ static std::vector<Ui::NamedValue> drive_type{
{"Front wheel drive", 70}, {"Rear wheel drive", 82}, {"Four wheel drive", 52}}; {"Front wheel drive", 70}, {"Rear wheel drive", 82}, {"Four wheel drive", 52}
};
Ui::EditRadioButtonAddressEx("Drive type", pHandling + 0x74, drive_type); Ui::EditRadioButtonAddressEx("Drive type", pHandling + 0x74, drive_type);
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);
@ -1295,8 +1295,7 @@ void Vehicle::Draw()
Ui::EditFloat("Lower limit", pHandling + 0xBC, -10.0f, -10.0f, 10.0f); // test later Ui::EditFloat("Lower limit", pHandling + 0xBC, -10.0f, -10.0f, 10.0f); // test later
Ui::EditFloat("Mass", pHandling + 0x4, 1.0f, 1.0f, 50000.0f); Ui::EditFloat("Mass", pHandling + 0x4, 1.0f, 1.0f, 50000.0f);
/// fcommon.UpdateAddress({ name = 'Max velocity',address = phandling + 0x84 ,size = 4,min = 0,max = ///fcommon.UpdateAddress({ name = 'Max velocity',address = phandling + 0x84 ,size = 4,min = 0,max = 2,is_float = true,cvalue = 0.01 , save = false })
/// 2,is_float = true,cvalue = 0.01 , save = false })
Ui::EditBits("Model flags", pHandling + 0xCC, m_ModelFlagNames); Ui::EditBits("Model flags", pHandling + 0xCC, m_ModelFlagNames);

View File

@ -18,8 +18,8 @@ private:
static inline bool m_bVehWatertight; static inline bool m_bVehWatertight;
static inline bool m_bNoDamage; static inline bool m_bNoDamage;
static inline int m_nDoorMenuButton; static inline int m_nDoorMenuButton;
static inline std::string m_DoorNames[6] = { static inline 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" };
static inline int m_nVehRemoveRadius; static inline int m_nVehRemoveRadius;
static inline bool m_bLockSpeed; static inline bool m_bLockSpeed;
static inline float m_fLockSpeed; static inline float m_fLockSpeed;
@ -64,48 +64,27 @@ private:
#ifdef GTASA #ifdef GTASA
static inline std::vector<std::string>(m_HandlingFlagNames) = // 32 flags static inline std::vector<std::string>(m_HandlingFlagNames) = // 32 flags
{"1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", {
"NO_HANDBRAKE", "STEER_REARWHEELS", "HB_REARWHEEL_STEER", "ALT_STEER_OPT", "1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", "NO_HANDBRAKE", "STEER_REARWHEELS",
"WHEEL_F_NARROW2", "WHEEL_F_NARROW", "WHEEL_F_WIDE", "WHEEL_F_WIDE2", "HB_REARWHEEL_STEER", "ALT_STEER_OPT",
"WHEEL_R_NARROW2", "WHEEL_R_NARROW", "WHEEL_R_WIDE", "WHEEL_R_WIDE2", "WHEEL_F_NARROW2", "WHEEL_F_NARROW", "WHEEL_F_WIDE", "WHEEL_F_WIDE2", "WHEEL_R_NARROW2", "WHEEL_R_NARROW",
"HYDRAULIC_GEOM", "HYDRAULIC_INST", "HYDRAULIC_NONE", "NOS_INST", "WHEEL_R_WIDE", "WHEEL_R_WIDE2",
"OFFROAD_ABILITY", "OFFROAD_ABILITY2", "HALOGEN_LIGHTS", "PROC_REARWHEEL_1ST", "HYDRAULIC_GEOM", "HYDRAULIC_INST", "HYDRAULIC_NONE", "NOS_INST", "OFFROAD_ABILITY", "OFFROAD_ABILITY2",
"USE_MAXSP_LIMIT", "LOW_RIDER", "STREET_RACER", "SWINGING_CHASSIS", "HALOGEN_LIGHTS", "PROC_REARWHEEL_1ST",
"Unused 1", "Unused 2", "Unused 3", "Unused 4"}; "USE_MAXSP_LIMIT", "LOW_RIDER", "STREET_RACER", "SWINGING_CHASSIS", "Unused 1", "Unused 2", "Unused 3",
"Unused 4"
};
static inline std::vector<std::string>(m_ModelFlagNames) = // 32 flags static inline std::vector<std::string>(m_ModelFlagNames) = // 32 flags
{"IS_VAN", {
"IS_BUS", "IS_VAN", "IS_BUS", "IS_LOW", "IS_BIG", "REVERSE_BONNET", "HANGING_BOOT", "TAILGATE_BOOT", "NOSWING_BOOT",
"IS_LOW", "NO_DOORS", "TANDEM_SEATS",
"IS_BIG", "SIT_IN_BOAT", "CONVERTIBLE", "NO_EXHAUST", "DOUBLE_EXHAUST", "NO1FPS_LOOK_BEHIND", "FORCE_DOOR_CHECK",
"REVERSE_BONNET", "AXLE_F_NOTILT", "AXLE_F_SOLID", "AXLE_F_MCPHERSON",
"HANGING_BOOT", "AXLE_F_REVERSE", "AXLE_R_NOTILT", "AXLE_R_SOLID", "AXLE_R_MCPHERSON", "AXLE_R_REVERSE", "IS_BIKE", "IS_HELI",
"TAILGATE_BOOT", "IS_PLANE", "IS_BOAT", "BOUNCE_PANELS",
"NOSWING_BOOT", "DOUBLE_RWHEELS", "FORCE_GROUND_CLEARANCE", "IS_HATCHBAC1K"
"NO_DOORS", };
"TANDEM_SEATS",
"SIT_IN_BOAT",
"CONVERTIBLE",
"NO_EXHAUST",
"DOUBLE_EXHAUST",
"NO1FPS_LOOK_BEHIND",
"FORCE_DOOR_CHECK",
"AXLE_F_NOTILT",
"AXLE_F_SOLID",
"AXLE_F_MCPHERSON",
"AXLE_F_REVERSE",
"AXLE_R_NOTILT",
"AXLE_R_SOLID",
"AXLE_R_MCPHERSON",
"AXLE_R_REVERSE",
"IS_BIKE",
"IS_HELI",
"IS_PLANE",
"IS_BOAT",
"BOUNCE_PANELS",
"DOUBLE_RWHEELS",
"FORCE_GROUND_CLEARANCE",
"IS_HATCHBAC1K"};
#endif #endif
private: private:

View File

@ -1,14 +1,22 @@
#include "visual.h"
#include "game.h"
#include "pch.h" #include "pch.h"
#include "timecycle.h" #include "visual.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#include "game.h"
#include "timecycle.h"
#ifdef GTASA #ifdef GTASA
#include "CHudColours.h" #include "CHudColours.h"
#endif #endif
#ifdef GTASA
#define TOTAL_WEATHERS 23
#elif GTAVC
#define TOTAL_WEATHERS 7
#else // GTA3
#define TOTAL_WEATHERS 4
#endif
Visual::Visual() Visual::Visual()
{ {
#ifdef GTASA #ifdef GTASA
@ -18,7 +26,8 @@ Visual::Visual()
} }
#endif #endif
Events::processScriptsEvent += [] { Events::processScriptsEvent += []
{
// TODO: Needs improvement // TODO: Needs improvement
static short m_nBacWeatherType; static short m_nBacWeatherType;
if (m_bLockWeather) if (m_bLockWeather)
@ -33,11 +42,12 @@ Visual::Visual()
}; };
} }
template <typename T> int GetTCVal(T *addr, int index) template <typename T>
int GetTCVal(T* addr, int index)
{ {
#ifdef GTASA #ifdef GTASA
T* arr = static_cast<T*>(patch::GetPointer(int(addr))); T* arr = static_cast<T*>(patch::GetPointer(int(addr)));
#elif GTAVC #else // GTA3 & GTAVC
T* arr = static_cast<T*>(addr); T* arr = static_cast<T*>(addr);
#endif #endif
return static_cast<int>(arr[index]); return static_cast<int>(arr[index]);
@ -60,11 +70,7 @@ void Visual::GenerateTimecycFile()
for (uint i = 0; i < m_WeatherNames.size(); ++i) for (uint i = 0; i < m_WeatherNames.size(); ++i)
{ {
buffer += "\n// " + m_WeatherNames[i] + "\n"; buffer += "\n// " + m_WeatherNames[i] + "\n";
buffer += "// Amb Amb Obj Dir Sky top Sky " buffer += "// Amb Amb Obj Dir Sky top Sky bot SunCore SunCorona SunSz SprSz SprBght Shdw LightShd PoleShd FarClp FogSt LightOnGround LowCloudsRGB BottomCloudRGB WaterRGBA ARGB1 ARGB2 CloudAlpha IntensityLimit WaterFogAlpha DirMult";
"bot SunCore SunCorona SunSz SprSz SprBght Shdw "
"LightShd PoleShd FarClp FogSt LightOnGround LowCloudsRGB BottomCloudRGB "
"WaterRGBA ARGB1 ARGB2 CloudAlpha IntensityLimit "
" WaterFogAlpha DirMult";
file << buffer << std::endl; file << buffer << std::endl;
for (int j = 0; j < m_nTimecycHour; ++j) for (int j = 0; j < m_nTimecycHour; ++j)
@ -82,47 +88,35 @@ void Visual::GenerateTimecycFile()
} }
else else
{ {
if (j == 0) if (j == 0) buffer = "// Midnight\n";
buffer = "// Midnight\n"; if (j == 1) buffer = "// 5 AM\n";
if (j == 1) if (j == 2) buffer = "// 6 AM\n";
buffer = "// 5 AM\n"; if (j == 3) buffer = "// 7 AM\n";
if (j == 2) if (j == 4) buffer = "// Midday\n";
buffer = "// 6 AM\n"; if (j == 5) buffer = "// 7 PM\n";
if (j == 3) if (j == 6) buffer = "// 8 PM\n";
buffer = "// 7 AM\n"; if (j == 7) buffer = "// 10 PM\n";
if (j == 4)
buffer = "// Midday\n";
if (j == 5)
buffer = "// 7 PM\n";
if (j == 6)
buffer = "// 8 PM\n";
if (j == 7)
buffer = "// 10 PM\n";
} }
int val = 23 * j + i; int val = 23 * j + i;
buffer += std::format( buffer += std::format("{} {} {}\t{} {} {}\t255 255 255\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}",
"{} {} {}\t{} {} {}\t255 255 255\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} "
"{}\t{} {} {}\t{} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}\t{} {} {} {}",
GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val), GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),
GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val), GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val),
GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopBlue, val), GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopBlue, val),
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val), GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreBlue, val), GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreBlue, val),
GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaBlue, val), GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaBlue, val),
GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSpriteBrightness, val) / 10.0f,
GetTCVal(m_fSpriteBrightness, val) / 10.0f, GetTCVal(m_nShadowStrength, val), GetTCVal(m_nShadowStrength, val), GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_nPoleShadowStrength, val),
GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_nPoleShadowStrength, val), GetTCVal(m_fFarClip, val), GetTCVal(m_fFarClip, val), GetTCVal(m_fFogStart, val), GetTCVal(m_fLightsOnGroundBrightness, val)/ 10.0f,
GetTCVal(m_fFogStart, val), GetTCVal(m_fLightsOnGroundBrightness, val) / 10.0f,
GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val), GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val),
GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val), GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
GetTCVal(m_fWaterRed, val), GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterRed, val), GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterAlpha, val),
GetTCVal(m_fWaterAlpha, val), GetTCVal(m_fPostFx1Red, val), GetTCVal(m_fPostFx1Green, val), GetTCVal(m_fPostFx1Red, val), GetTCVal(m_fPostFx1Green, val), GetTCVal(m_fPostFx1Blue, val), GetTCVal(m_fPostFx1Alpha, val),
GetTCVal(m_fPostFx1Blue, val), GetTCVal(m_fPostFx1Alpha, val), GetTCVal(m_fPostFx2Red, val), GetTCVal(m_fPostFx2Red, val), GetTCVal(m_fPostFx2Green, val), GetTCVal(m_fPostFx2Blue, val), GetTCVal(m_fPostFx2Alpha, val),
GetTCVal(m_fPostFx2Green, val), GetTCVal(m_fPostFx2Blue, val), GetTCVal(m_fPostFx2Alpha, val), GetTCVal(m_fCloudAlpha, val), GetTCVal(m_nHighLightMinIntensity, val), GetTCVal(m_nWaterFogAlpha, val), GetTCVal(m_nDirectionalMult, val) / 100.0
GetTCVal(m_fCloudAlpha, val), GetTCVal(m_nHighLightMinIntensity, val), GetTCVal(m_nWaterFogAlpha, val), );
GetTCVal(m_nDirectionalMult, val) / 100.0);
file << buffer << std::endl; file << buffer << std::endl;
} }
} }
@ -147,9 +141,7 @@ void Visual::GenerateTimecycFile()
buffer = "\n// FOGGY\n"; buffer = "\n// FOGGY\n";
} }
buffer += "// Amb Amb_Obj Amb_bl Amb_Obj_bl Dir Sky top Sky bot SunCore " buffer += "// Amb Amb_Obj Amb_bl Amb_Obj_bl Dir Sky top Sky bot SunCore SunCorona SunSz SprSz SprBght Shdw LightShd PoleShd FarClp FogSt LightOnGround LowCloudsRGB TopCloudRGB BottomCloudRGB BlurRGB WaterRGBA";
" SunCorona SunSz SprSz SprBght Shdw LightShd PoleShd FarClp FogSt LightOnGround "
"LowCloudsRGB TopCloudRGB BottomCloudRGB BlurRGB WaterRGBA";
file << buffer << std::endl; file << buffer << std::endl;
@ -167,28 +159,25 @@ void Visual::GenerateTimecycFile()
size_t val = 7 * i + j; size_t val = 7 * i + j;
buffer += std::format( buffer += std::format("{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}",
"{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} "
"{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {}\t{} {} {} {}",
GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val), GetTCVal(m_nAmbientRed, val), GetTCVal(m_nAmbientGreen, val), GetTCVal(m_nAmbientBlue, val),
GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val), GetTCVal(m_nAmbientRed_Obj, val), GetTCVal(m_nAmbientGreen_Obj, val), GetTCVal(m_nAmbientBlue_Obj, val),
GetTCVal(m_nAmbientBlRed, val), GetTCVal(m_nAmbientBlGreen, val), GetTCVal(m_nAmbientBlBlue, val), GetTCVal(m_nAmbientBlRed, val), GetTCVal(m_nAmbientBlGreen, val), GetTCVal(m_nAmbientBlBlue, val),
GetTCVal(m_nAmbientBlRed_Obj, val), GetTCVal(m_nAmbientBlGreen_Obj, val), GetTCVal(m_nAmbientBlRed_Obj, val), GetTCVal(m_nAmbientBlGreen_Obj, val), GetTCVal(m_nAmbientBlBlue_Obj, val),
GetTCVal(m_nAmbientBlBlue_Obj, val), GetTCVal(m_nDirRed, val), GetTCVal(m_nDirGreen, val), GetTCVal(m_nDirRed, val), GetTCVal(m_nDirGreen, val), GetTCVal(m_nDirBlue, val),
GetTCVal(m_nDirBlue, val), GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopRed, val), GetTCVal(m_nSkyTopGreen, val), GetTCVal(m_nSkyTopBlue, val),
GetTCVal(m_nSkyTopBlue, val), GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomRed, val), GetTCVal(m_nSkyBottomGreen, val), GetTCVal(m_nSkyBottomBlue, val),
GetTCVal(m_nSkyBottomBlue, val), GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreRed, val), GetTCVal(m_nSunCoreGreen, val), GetTCVal(m_nSunCoreBlue, val),
GetTCVal(m_nSunCoreBlue, val), GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaRed, val), GetTCVal(m_nSunCoronaGreen, val), GetTCVal(m_nSunCoronaBlue, val),
GetTCVal(m_nSunCoronaBlue, val), GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSunSize, val) / 10.0f, GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSpriteBrightness, val) / 10.0f,
GetTCVal(m_fSpriteSize, val) / 10.0f, GetTCVal(m_fSpriteBrightness, val) / 10.0f, GetTCVal(m_nShadowStrength, val), GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_nPoleShadowStrength, val),
GetTCVal(m_nShadowStrength, val), GetTCVal(m_nLightShadowStrength, val), GetTCVal(m_fFarClip, val), GetTCVal(m_fFogStart, val), GetTCVal(m_fLightsOnGroundBrightness, val)/ 10.0f,
GetTCVal(m_nPoleShadowStrength, val), GetTCVal(m_fFarClip, val), GetTCVal(m_fFogStart, val), GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val),
GetTCVal(m_fLightsOnGroundBrightness, val) / 10.0f, GetTCVal(m_nLowCloudsRed, val), GetTCVal(m_nTopCloudsRed, val), GetTCVal(m_nTopCloudsGreen, val), GetTCVal(m_nTopCloudsBlue, val),
GetTCVal(m_nLowCloudsGreen, val), GetTCVal(m_nLowCloudsBlue, val), GetTCVal(m_nTopCloudsRed, val), GetTCVal(m_nBottomCloudsRed, val), GetTCVal(m_nBottomCloudsGreen, val), GetTCVal(m_nBottomCloudsBlue, val),
GetTCVal(m_nTopCloudsGreen, val), GetTCVal(m_nTopCloudsBlue, val), GetTCVal(m_nBottomCloudsRed, val), GetTCVal(m_nBlurRed, val), GetTCVal(m_nBlurGreen, val), GetTCVal(m_nBlurBlue, val),
GetTCVal(m_nBottomCloudsGreen, val), GetTCVal(m_nBottomCloudsBlue, val), GetTCVal(m_nBlurRed, val), GetTCVal(m_fWaterRed, val), GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterAlpha, val)
GetTCVal(m_nBlurGreen, val), GetTCVal(m_nBlurBlue, val), GetTCVal(m_fWaterRed, val), );
GetTCVal(m_fWaterGreen, val), GetTCVal(m_fWaterBlue, val), GetTCVal(m_fWaterAlpha, val));
file << buffer << std::endl; file << buffer << std::endl;
} }
} }
@ -200,36 +189,32 @@ int Visual::CalcArrayIndex()
int hour = CClock::ms_nGameClockHours; int hour = CClock::ms_nGameClockHours;
#ifdef GTASA #ifdef GTASA
int result = 0;
if (m_nTimecycHour == 24) if (m_nTimecycHour == 24)
{ {
result = hour; hour = hour;
} }
else else
{ {
if (hour < 5) if (hour < 5)
result = 0; hour = 0;
if (hour == 5) if (hour == 5)
result = 1; hour = 1;
if (hour == 6) if (hour == 6)
result = 2; hour = 2;
if (7 <= hour && hour < 12) if (7 <= hour && hour < 12)
result = 3; hour = 3;
if (12 <= hour && hour < 19) if (12 <= hour && hour < 19)
result = 4; hour = 4;
if (hour == 19) if (hour == 19)
result = 5; hour = 5;
if (hour == 20 || hour == 21) if (hour == 20 || hour == 21)
result = 6; hour = 6;
if (hour == 22 || hour == 23) if (hour == 22 || hour == 23)
result = 7; hour = 7;
} }
return 23 * result + CWeather::OldWeatherType;
#elif GTAVC
return 7 * hour + CWeather::OldWeatherType;
#endif #endif
return TOTAL_WEATHERS * hour + CWeather::OldWeatherType;
} }
bool Visual::TimeCycColorEdit3(const char* label, uchar* r, uchar* g, uchar* b, ImGuiColorEditFlags flags) bool Visual::TimeCycColorEdit3(const char* label, uchar* r, uchar* g, uchar* b, ImGuiColorEditFlags flags)
@ -241,7 +226,7 @@ bool Visual::TimeCycColorEdit3(const char *label, uchar *r, uchar *g, uchar *b,
auto red = static_cast<uchar*>(patch::GetPointer(int(r))); auto red = static_cast<uchar*>(patch::GetPointer(int(r)));
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)));
#elif GTAVC #else // GTA3 & GTAVC
auto red = static_cast<uchar*>(r); auto red = static_cast<uchar*>(r);
auto green = static_cast<uchar*>(g); auto green = static_cast<uchar*>(g);
auto blue = static_cast<uchar*>(b); auto blue = static_cast<uchar*>(b);
@ -270,7 +255,7 @@ bool Visual::TimeCycColorEdit4(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)));
auto alpha = static_cast<uchar*>(patch::GetPointer(int(a))); auto alpha = static_cast<uchar*>(patch::GetPointer(int(a)));
#elif GTAVC #else // GTA3 & GTAVC
auto red = static_cast<uchar*>(r); auto red = static_cast<uchar*>(r);
auto green = static_cast<uchar*>(g); auto green = static_cast<uchar*>(g);
auto blue = static_cast<uchar*>(b); auto blue = static_cast<uchar*>(b);
@ -392,6 +377,31 @@ void Visual::Draw()
Ui::CheckboxAddress("Green scanlines", 0xA10B69); Ui::CheckboxAddress("Green scanlines", 0xA10B69);
Ui::CheckboxAddress("White scanlines", 0xA10B68); Ui::CheckboxAddress("White scanlines", 0xA10B68);
#else // GTA3
Ui::CheckboxWithHint("Lock weather", &m_bLockWeather);
static bool showHud, showRadar;
if (Ui::CheckboxWithHint("Show hud", &showHud))
{
if (showHud)
{
patch::Nop(0x48E420, 5); // CHud::Draw
}
else
{
patch::SetRaw(0x48E420, (char*)"\xE8\x7B\x6E\x07\x00", 5);
}
}
if (Ui::CheckboxWithHint("Show radar", &showRadar))
{
if (showHud)
{
patch::Nop(0x50838D, 5); // CRadar::Draw
}
else
{
patch::SetRaw(0x50838D, (char*)"\xE8\x6E\xBE\xF9\xFF", 5);
}
}
#endif #endif
ImGui::Columns(1); ImGui::Columns(1);
ImGui::EndTabItem(); ImGui::EndTabItem();
@ -469,8 +479,8 @@ void Visual::Draw()
if (ImGui::BeginChild("VisualsChild")) if (ImGui::BeginChild("VisualsChild"))
{ {
#ifdef GTASA #ifdef GTASA
ImGui::TextWrapped("These options won't work if you got any mods that drastically changes the game " ImGui::TextWrapped(
"hud. i.e. Mobile Hud, GTA 5 Hud etc."); "These options won't work if you got any mods that drastically changes the game hud. i.e. Mobile Hud, GTA 5 Hud etc.");
ImGui::Spacing(); ImGui::Spacing();
Ui::ColorPickerAddress("Armourbar color", *(int*)0x5890FC, ImVec4(225, 225, 225, 255)); Ui::ColorPickerAddress("Armourbar color", *(int*)0x5890FC, ImVec4(225, 225, 225, 255));
Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999); Ui::EditAddress<float>("Armourbar posX", 0x866B78, -999, 94, 999);
@ -489,7 +499,8 @@ void Visual::Draw()
Ui::EditAddress<float>("Money posX", *(int*)0x58F5FC, -999, 32, 999); Ui::EditAddress<float>("Money posX", *(int*)0x58F5FC, -999, 32, 999);
Ui::EditAddress<float>("Money posY", 0x866C88, -999, 89, 999); Ui::EditAddress<float>("Money posY", 0x866C88, -999, 89, 999);
static std::vector<Ui::NamedValue> font_outline{ static std::vector<Ui::NamedValue> font_outline{
{"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);
@ -521,7 +532,7 @@ void Visual::Draw()
#ifdef GTASA #ifdef GTASA
if (m_nTimecycHour == 8 ? ImGui::BeginTabItem("Timecyc") : ImGui::BeginTabItem("Timecyc 24h")) if (m_nTimecycHour == 8 ? ImGui::BeginTabItem("Timecyc") : ImGui::BeginTabItem("Timecyc 24h"))
#elif GTAVC #else // GTA3 & GTAVC
if (ImGui::BeginTabItem("Timecyc")) if (ImGui::BeginTabItem("Timecyc"))
#endif #endif
{ {
@ -559,19 +570,15 @@ void Visual::Draw()
if (ImGui::InputInt("Hour", &hour) & !Game::m_bSyncTime) if (ImGui::InputInt("Hour", &hour) & !Game::m_bSyncTime)
{ {
if (hour < 0) if (hour < 0) hour = 23;
hour = 23; if (hour > 23) hour = 0;
if (hour > 23)
hour = 0;
CClock::ms_nGameClockHours = hour; CClock::ms_nGameClockHours = hour;
} }
if (ImGui::InputInt("Minute", &minute) & !Game::m_bSyncTime) if (ImGui::InputInt("Minute", &minute) & !Game::m_bSyncTime)
{ {
if (minute < 0) if (minute < 0) minute = 59;
minute = 59; if (minute > 59) minute = 0;
if (minute > 59)
minute = 0;
CClock::ms_nGameClockMinutes = minute; CClock::ms_nGameClockMinutes = minute;
} }
@ -585,11 +592,12 @@ void Visual::Draw()
{ {
if (Game::m_bFreezeTime) if (Game::m_bFreezeTime)
{ {
patch::SetRaw(BY_GAME(0x52CF10, 0x487010), (char *)"\xEB\xEF", 2); patch::SetRaw(BY_GAME(0x52CF10, 0x487010, 0x473460), (char *)"\xEB\xEF", 2);
} }
else else
{ {
patch::SetRaw(BY_GAME(0x52CF10, 0x487010), (char *)BY_GAME("\x56\x8B", "\x6A\x01"), 2); patch::SetRaw(BY_GAME(0x52CF10, 0x487010, 0x473460),
(char *)BY_GAME("\x56\x8B", "\x6A\x01", "\x6A\x01"), 2);
} }
} }
ImGui::Spacing(); ImGui::Spacing();
@ -601,7 +609,9 @@ void Visual::Draw()
ImGui::Spacing(); ImGui::Spacing();
TimeCycColorEdit3("Ambient", m_nAmbientRed, m_nAmbientGreen, m_nAmbientBlue); TimeCycColorEdit3("Ambient", m_nAmbientRed, m_nAmbientGreen, m_nAmbientBlue);
#ifndef GTA3
TimeCycColorEdit3("Ambient obj", m_nAmbientRed_Obj, m_nAmbientGreen_Obj, m_nAmbientBlue_Obj); TimeCycColorEdit3("Ambient obj", m_nAmbientRed_Obj, m_nAmbientGreen_Obj, m_nAmbientBlue_Obj);
#endif
#ifdef GTASA #ifdef GTASA
TimeCycColorEdit3("Fluffy clouds", m_nFluffyCloudsBottomRed, m_nFluffyCloudsBottomGreen, TimeCycColorEdit3("Fluffy clouds", m_nFluffyCloudsBottomRed, m_nFluffyCloudsBottomGreen,
@ -611,11 +621,14 @@ void Visual::Draw()
TimeCycColorEdit3("Ambient obj bl", m_nAmbientBlRed_Obj, m_nAmbientBlGreen_Obj, TimeCycColorEdit3("Ambient obj bl", m_nAmbientBlRed_Obj, m_nAmbientBlGreen_Obj,
m_nAmbientBlBlue_Obj); m_nAmbientBlBlue_Obj);
TimeCycColorEdit3("Blur", m_nBlurRed, m_nBlurGreen, m_nBlurBlue); TimeCycColorEdit3("Blur", m_nBlurRed, m_nBlurGreen, m_nBlurBlue);
#endif
#ifndef GTASA
TimeCycColorEdit3("Clouds bottom", m_nBottomCloudsRed, m_nBottomCloudsGreen, m_nBottomCloudsBlue); TimeCycColorEdit3("Clouds bottom", m_nBottomCloudsRed, m_nBottomCloudsGreen, m_nBottomCloudsBlue);
TimeCycColorEdit3("Clouds low", m_nLowCloudsRed, m_nLowCloudsGreen, m_nLowCloudsBlue);
TimeCycColorEdit3("Clouds top", m_nTopCloudsRed, m_nTopCloudsGreen, m_nTopCloudsBlue); TimeCycColorEdit3("Clouds top", m_nTopCloudsRed, m_nTopCloudsGreen, m_nTopCloudsBlue);
TimeCycColorEdit3("Directional light", m_nDirRed, m_nDirGreen, m_nDirBlue); TimeCycColorEdit3("Directional light", m_nDirRed, m_nDirGreen, m_nDirBlue);
#endif #endif
TimeCycColorEdit3("Low clouds", m_nLowCloudsRed, m_nLowCloudsGreen, m_nLowCloudsBlue);
#ifdef GTASA #ifdef GTASA
TimeCycColorEdit4("Postfx 1", m_fPostFx1Red, m_fPostFx1Green, m_fPostFx1Blue, m_fPostFx1Alpha); TimeCycColorEdit4("Postfx 1", m_fPostFx1Red, m_fPostFx1Green, m_fPostFx1Blue, m_fPostFx1Alpha);
@ -648,11 +661,19 @@ void Visual::Draw()
#endif #endif
TimecycSlider("Light on ground brightness", m_fLightsOnGroundBrightness, 0, 255); TimecycSlider("Light on ground brightness", m_fLightsOnGroundBrightness, 0, 255);
TimecycSlider("Light shadow strength", m_nLightShadowStrength, 0, 255); TimecycSlider("Light shadow strength", m_nLightShadowStrength, 0, 255);
#ifndef GTA3
TimecycSlider("Pole shadow strength", m_nPoleShadowStrength, 0, 255); TimecycSlider("Pole shadow strength", m_nPoleShadowStrength, 0, 255);
#endif
TimecycSlider("Shadow strength", m_nShadowStrength, 0, 255); TimecycSlider("Shadow strength", m_nShadowStrength, 0, 255);
TimecycSlider("Sprite brightness", m_fSpriteBrightness, 0, 127); TimecycSlider("Sprite brightness", m_fSpriteBrightness, 0, 127);
TimecycSlider("Sprite size", m_fSpriteSize, 0, 127); TimecycSlider("Sprite size", m_fSpriteSize, 0, 127);
TimecycSlider("Sun size", m_fSunSize, 0, 127); TimecycSlider("Sun size", m_fSunSize, 0, 127);
#ifdef GTA3
TimecycSlider("Tree shadow strength", m_nTreeShadowStrength, 0, 255);
#endif
#ifdef GTASA #ifdef GTASA
TimecycSlider("Water fog alpha", m_nWaterFogAlpha, 0, 255); TimecycSlider("Water fog alpha", m_nWaterFogAlpha, 0, 255);
#endif #endif

View File

@ -14,32 +14,28 @@ private:
// Timecyc stuff // Timecyc stuff
static inline int m_nTimecycHour = 8; static inline int m_nTimecycHour = 8;
static inline std::vector<std::string> m_WeatherNames{"EXTRASUNNY LA", "SUNNY LA", static inline std::vector<std::string> m_WeatherNames
"EXTRASUNNY SMOG LA", "SUNNY SMOG LA", {
"CLOUDY LA", "SUNNY SF", "EXTRASUNNY LA", "SUNNY LA", "EXTRASUNNY SMOG LA", "SUNNY SMOG LA", "CLOUDY LA", "SUNNY SF", "EXTRASUNNY SF",
"EXTRASUNNY SF", "CLOUDY SF", "CLOUDY SF", "RAINY SF", "FOGGY SF",
"RAINY SF", "FOGGY SF", "SUNNY VEGAS", "EXTRASUNNY VEGAS", "CLOUDY VEGAS", "EXTRASUNNY COUNTRYSIDE", "SUNNY COUNTRYSIDE",
"SUNNY VEGAS", "EXTRASUNNY VEGAS", "CLOUDY COUNTRYSIDE", "RAINY COUNTRYSIDE",
"CLOUDY VEGAS", "EXTRASUNNY COUNTRYSIDE", "EXTRASUNNY DESERT", "SUNNY DESERT", "SANDSTORM DESERT", "UNDERWATER", "EXTRACOLOURS 1", "EXTRACOLOURS 2"
"SUNNY COUNTRYSIDE", "CLOUDY COUNTRYSIDE", };
"RAINY COUNTRYSIDE", "EXTRASUNNY DESERT",
"SUNNY DESERT", "SANDSTORM DESERT",
"UNDERWATER", "EXTRACOLOURS 1",
"EXTRACOLOURS 2"};
static void GenerateTimecycFile(); static void GenerateTimecycFile();
static int CalcArrayIndex(); static int CalcArrayIndex();
static bool TimeCycColorEdit3(const char* label, uchar* r, uchar* g, uchar* b, ImGuiColorEditFlags flags = 0); static bool TimeCycColorEdit3(const char* label, uchar* r, uchar* g, uchar* b, ImGuiColorEditFlags flags = 0);
static bool TimeCycColorEdit4(const char *label, uchar *r, uchar *g, uchar *b, uchar *a, static bool TimeCycColorEdit4(const char* label, uchar* r, uchar* g, uchar* b, uchar* a, ImGuiColorEditFlags flags = 0);
ImGuiColorEditFlags flags = 0); template <typename T>
template <typename T> static void TimecycSlider(const char *label, T *data, int min, int max); static void TimecycSlider(const char* label, T* data, int min, int max);
public: public:
Visual(); Visual();
static void Draw(); static void Draw();
}; };
template <typename T> void Visual::TimecycSlider(const char *label, T *ptr, int min, int max) template <typename T>
void Visual::TimecycSlider(const char* label, T* ptr, int min, int max)
{ {
int val = CalcArrayIndex(); int val = CalcArrayIndex();
#ifdef GTASA #ifdef GTASA

View File

@ -38,7 +38,10 @@
#define VK_KEY_Y 0x59 #define VK_KEY_Y 0x59
#define VK_KEY_Z 0x5A #define VK_KEY_Z 0x5A
static std::string key_names[]{"LMB",
static std::string key_names[]
{
"LMB",
"RMB", "RMB",
"Cancel", "Cancel",
"MMB", "MMB",
@ -203,4 +206,5 @@ static std::string key_names[]{"LMB",
"LCtrl", "LCtrl",
"RCtrl", "RCtrl",
"LMenu", "LMenu",
"RMenu"}; "RMenu"
};

View File

@ -1,13 +1,14 @@
#include "weapon.h"
#include "CWeaponInfo.h"
#include "pch.h" #include "pch.h"
#include "ped.h" #include "weapon.h"
#include "ui.h" #include "ui.h"
#include "util.h" #include "util.h"
#include "ped.h"
#include "CWeaponInfo.h"
Weapon::Weapon() Weapon::Weapon()
{ {
Events::processScriptsEvent += [] { Events::processScriptsEvent += []
{
CPlayerPed* player = FindPlayerPed(); CPlayerPed* player = FindPlayerPed();
#ifdef GTASA #ifdef GTASA
@ -27,6 +28,7 @@ Weapon::Weapon()
} }
#endif #endif
uchar slot = BY_GAME(player->m_nActiveWeaponSlot, player->m_nActiveWeaponSlot, player->m_nCurrentWeapon); uchar slot = BY_GAME(player->m_nActiveWeaponSlot, player->m_nActiveWeaponSlot, player->m_nCurrentWeapon);
if (m_nCurrentWeaponSlot != slot) if (m_nCurrentWeaponSlot != slot)
{ {
@ -66,14 +68,14 @@ Weapon::Weapon()
} }
#ifdef GTASA #ifdef GTASA
if (m_bRapidFire && if (m_bRapidFire && weaponType != BY_GAME(WEAPON_MINIGUN, WEAPONTYPE_MINIGUN)) // mingun doesn't work with rapidfire
weaponType != BY_GAME(WEAPON_MINIGUN, WEAPONTYPE_MINIGUN)) // mingun doesn't work with rapidfire
{ {
pWeaponInfo->m_nFlags.bContinuosFire = true; pWeaponInfo->m_nFlags.bContinuosFire = true;
} }
if (m_bDualWeild && (weaponType == WEAPON_PISTOL || weaponType == WEAPON_MICRO_UZI || if (m_bDualWeild && (weaponType == WEAPON_PISTOL || weaponType == WEAPON_MICRO_UZI || weaponType ==
weaponType == WEAPON_TEC9 || weaponType == WEAPON_SAWNOFF)) WEAPON_TEC9 || weaponType == WEAPON_SAWNOFF))
{ {
pWeaponInfo->m_nFlags.bTwinPistol = true; pWeaponInfo->m_nFlags.bTwinPistol = true;
} }
@ -97,8 +99,8 @@ Weapon::Weapon()
void Weapon::SetGangWeapon(std::string& weapon_type) void Weapon::SetGangWeapon(std::string& weapon_type)
{ {
m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon] = std::stoi(weapon_type); m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon] = std::stoi(weapon_type);
CGangs::SetGangWeapons(m_nSelectedGang, m_nGangWeaponList[m_nSelectedGang][0], CGangs::SetGangWeapons(m_nSelectedGang, m_nGangWeaponList[m_nSelectedGang][0], m_nGangWeaponList[m_nSelectedGang][1],
m_nGangWeaponList[m_nSelectedGang][1], m_nGangWeaponList[m_nSelectedGang][2]); m_nGangWeaponList[m_nSelectedGang][2]);
} }
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
// Implementation of SA opcode 0x555 // Implementation of SA opcode 0x555
@ -150,8 +152,7 @@ static eWeaponType GetWeaponTypeFromModel(int model)
for (size_t i = 0; i < 37; i++) for (size_t i = 0; i < 37; i++)
{ {
int temp = int temp = CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(i); // int __cdecl CPickups::ModelForWeapon(int a1)
CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(i); // int __cdecl CPickups::ModelForWeapon(int a1)
if (temp == model) if (temp == model)
{ {
@ -249,8 +250,7 @@ void Weapon::Draw()
#ifdef GTASA #ifdef GTASA
Command<Commands::GET_WEAPONTYPE_MODEL>(weaponType, &model); Command<Commands::GET_WEAPONTYPE_MODEL>(weaponType, &model);
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
model = CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>( model = CallAndReturn<int, BY_GAME(NULL, 0x4418B0, 0x430690)>(weaponType); // int __cdecl CPickups::ModelForWeapon(int a1)
weaponType); // int __cdecl CPickups::ModelForWeapon(int a1)
#endif #endif
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);
@ -292,9 +292,7 @@ void Weapon::Draw()
Ui::ShowTooltip("Weapon tweaks apply globally\nto every ped weapon type"); Ui::ShowTooltip("Weapon tweaks apply globally\nto every ped weapon type");
ImGui::Columns(2, 0, false); ImGui::Columns(2, 0, false);
#ifdef GTASA #ifdef GTASA
Ui::CheckboxWithHint("Fast aim", &m_bAutoAim, Ui::CheckboxWithHint("Fast aim", &m_bAutoAim, "Enables aim assist on keyboard\n\nQ = left E = right\n\nPress Q and E to switch targets.\nMoving mouse removes the target!");
"Enables aim assist on keyboard\n\nQ = left E = right\n\nPress Q and E to switch "
"targets.\nMoving mouse removes the target!");
if (Ui::CheckboxWithHint("Dual wield", &m_bDualWeild, if (Ui::CheckboxWithHint("Dual wield", &m_bDualWeild,
"Dual wield pistol, shawoff, uzi, tec9\n(Other weapons don't work)")) "Dual wield pistol, shawoff, uzi, tec9\n(Other weapons don't work)"))
{ {
@ -304,8 +302,7 @@ void Weapon::Draw()
} }
} }
#endif #endif
if (Ui::CheckboxWithHint("Huge damage", &m_bHugeDamage, if (Ui::CheckboxWithHint("Huge damage", &m_bHugeDamage, "Also enable 'Long range' if weapon range is short"))
"Also enable 'Long range' if weapon range is short"))
{ {
if (!m_bHugeDamage) if (!m_bHugeDamage)
{ {
@ -367,12 +364,10 @@ void Weapon::Draw()
m_nAmmoCount = (m_nAmmoCount > 99999) ? 99999 : m_nAmmoCount; m_nAmmoCount = (m_nAmmoCount > 99999) ? 99999 : m_nAmmoCount;
} }
#ifdef GTASA #ifdef GTASA
Ui::DrawImages( Ui::DrawImages(m_WeaponData, GiveWeaponToPlayer, nullptr,
m_WeaponData, GiveWeaponToPlayer, nullptr,
[](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); }, [](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); },
[](std::string str) { [](std::string str) { return str != "0"; /*Unarmed*/ }
return str != "0"; /*Unarmed*/ );
});
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
Ui::DrawJSON(m_WeaponData, GiveWeaponToPlayer, nullptr); Ui::DrawJSON(m_WeaponData, GiveWeaponToPlayer, nullptr);
#endif #endif
@ -393,18 +388,14 @@ void Weapon::Draw()
ImGui::Columns(1); ImGui::Columns(1);
ImGui::Spacing(); ImGui::Spacing();
ImGui::Text( ImGui::Text("Current weapon: %s",
"Current weapon: %s", m_WeaponData.m_pJson->m_Data[std::to_string(m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon])].get<
m_WeaponData.m_pJson->m_Data[std::to_string(m_nGangWeaponList[m_nSelectedGang][m_nSelectedWeapon])] std::string>().c_str());
.get<std::string>()
.c_str());
ImGui::Spacing(); ImGui::Spacing();
Ui::DrawImages( Ui::DrawImages(m_WeaponData, SetGangWeapon, nullptr,
m_WeaponData, SetGangWeapon, nullptr,
[](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); }, [](std::string str) { return m_WeaponData.m_pJson->m_Data[str].get<std::string>(); },
[](std::string str) { [](std::string str) { return str != "-1"; /*Jetpack*/ }
return str != "-1"; /*Jetpack*/ );
});
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
#endif #endif

View File

@ -25,7 +25,8 @@ public:
static inline int m_nSelectedWeapon; static inline int m_nSelectedWeapon;
#ifdef GTASA #ifdef GTASA
static inline int m_nGangWeaponList[10][3] = { static inline int m_nGangWeaponList[10][3] =
{
{WEAPON_PISTOL, WEAPON_MICRO_UZI, WEAPON_UNARMED}, // Ballas {WEAPON_PISTOL, WEAPON_MICRO_UZI, WEAPON_UNARMED}, // Ballas
{WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Grove {WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Grove
{WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Vagos {WEAPON_PISTOL, WEAPON_UNARMED, WEAPON_UNARMED}, // Vagos

View File

@ -88,6 +88,9 @@ project "CheatMenuIII"
"../src/weapon.cpp", "../src/weapon.cpp",
"../src/game.h", "../src/game.h",
"../src/game.cpp", "../src/game.cpp",
"../src/timecyc.h",
"../src/visual.h",
"../src/visual.cpp",
"../src/filehandler.h", "../src/filehandler.h",
"../src/filehandler.cpp", "../src/filehandler.cpp",
"../src/dllmain.cpp" "../src/dllmain.cpp"