Refactor code, [VC] Fix don't fall off bike

This commit is contained in:
Grinch_ 2022-08-07 02:46:40 +06:00
parent 86b9697203
commit 6e9c3c43cb
54 changed files with 184 additions and 330 deletions

View File

@ -1,21 +1,20 @@
#include "pch.h" #include "pch.h"
#include "widget.h"
#include "updater.h"
#include "d3dhook.h"
#include "../depend/imgui/imgui_internal.h"
#include "util.h"
#include "animation.h"
#include "cheatmenu.h" #include "cheatmenu.h"
#include "game.h" #include "imgui/imgui_internal.h"
#include "menu.h" #include "utils/widget.h"
#include "ped.h" #include "utils/updater.h"
#include "player.h" #include "utils/d3dhook.h"
#include "teleport.h" #include "utils/util.h"
#include "vehicle.h" #include "utils/overlay.h"
#include "visual.h" #include "pages/animation.h"
#include "weapon.h" #include "pages/game.h"
#include "overlay.h" #include "pages/menu.h"
#include "pages/ped.h"
#include "pages/player.h"
#include "pages/teleport.h"
#include "pages/vehicle.h"
#include "pages/visual.h"
#include "pages/weapon.h"
static bool DrawTitleBar() static bool DrawTitleBar()
{ {

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include <tHandlingData.h>
#include <map> #include <map>
#include <vector> #include <vector>

View File

@ -1,4 +1,6 @@
#include "pch.h" #include "pch.h"
#ifdef GTASA
#include "neon.h" #include "neon.h"
// Neon sprite // Neon sprite
@ -275,5 +277,4 @@ void Neon::Remove(CVehicle* pVeh)
{ {
m_VehNeon.Get(pVeh).m_bNeonInstalled = false; m_VehNeon.Get(pVeh).m_bNeonInstalled = false;
} }
#endif

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include "extender/VehicleExtender.h" #ifdef GTASA
#include <extender/VehicleExtender.h>
/* /*
Vehicle Neon implementation class for GTA: San Andreas Vehicle Neon implementation class for GTA: San Andreas
@ -56,3 +57,4 @@ public:
// Removes neon from vehicle // Removes neon from vehicle
static void Remove(CVehicle* veh); static void Remove(CVehicle* veh);
}; };
#endif

View File

@ -23,9 +23,10 @@
// SOFTWARE. // SOFTWARE.
#include "pch.h" #include "pch.h"
#ifdef GTASA
#include "paint.h" #include "paint.h"
#include "NodeName.h" #include "utils/util.h"
#include "util.h" #include <NodeName.h>
void Paint::InjectHooks() void Paint::InjectHooks()
{ {
@ -319,3 +320,4 @@ void Paint::ResetNodeTexture(CVehicle* pVeh, std::string node_name)
} }
}); });
} }
#endif

View File

@ -23,6 +23,7 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#ifdef GTASA
#include <vector> #include <vector>
class Paint class Paint
@ -83,3 +84,4 @@ public:
static void ResetNodeColor(CVehicle* veh, std::string node_name); static void ResetNodeColor(CVehicle* veh, std::string node_name);
static void ResetNodeTexture(CVehicle* pVeh, std::string node_name); static void ResetNodeTexture(CVehicle* pVeh, std::string node_name);
}; };
#endif

View File

@ -1,8 +1,8 @@
#include "pch.h" #include "pch.h"
#include "cheatmenu.h" #include "cheatmenu.h"
#include "updater.h" #include "utils/updater.h"
#include "rpc.h" #include "utils/rpc.h"
#include "menu.h" #include "pages/menu.h"
void MenuThread(void* param) void MenuThread(void* param)
{ {

View File

@ -1,7 +1,7 @@
#include "pch.h" #include "pch.h"
#include "animation.h" #include "animation.h"
#include "widget.h" #include "utils/widget.h"
#include "util.h" #include "utils/util.h"
#ifdef GTA3 #ifdef GTA3
#include <RpAnimBlend.h> #include <RpAnimBlend.h>
@ -10,7 +10,7 @@
#include "eAnimations.h" #include "eAnimations.h"
#include <CAnimBlendAssociation.h> #include <CAnimBlendAssociation.h>
#elif GTAVC #elif GTAVC
#include "../depend/kiero/minhook/MinHook.h" #include "kiero/minhook/MinHook.h"
#include <CAnimationStyleDescriptor.h> #include <CAnimationStyleDescriptor.h>
#include <CAnimManager.h> #include <CAnimManager.h>
#include "eAnimations.h" #include "eAnimations.h"
@ -18,7 +18,7 @@
#endif #endif
#ifdef GTASA #ifdef GTASA
#include "overlay.h" #include "utils/overlay.h"
void Cutscene::Init() void Cutscene::Init()
{ {

View File

@ -1,8 +1,9 @@
#include "pch.h" #include "pch.h"
#include "menu.h" #include "menu.h"
#include "game.h" #include "game.h"
#include "widget.h" #include "utils/widget.h"
#include "util.h" #include "utils/util.h"
#ifdef GTASA #ifdef GTASA
#include <CIplStore.h> #include <CIplStore.h>
#include <CMessages.h> #include <CMessages.h>

View File

@ -1,11 +1,11 @@
#include "pch.h" #include "pch.h"
#include "menu.h" #include "menu.h"
#include "widget.h"
#include "util.h"
#include "updater.h"
#include "cheatmenu.h" #include "cheatmenu.h"
#include "rpc.h" #include "utils/widget.h"
#include "overlay.h" #include "utils/util.h"
#include "utils/updater.h"
#include "utils/rpc.h"
#include "utils/overlay.h"
void Menu::Init() void Menu::Init()
{ {

View File

@ -1,9 +1,9 @@
#include "pch.h" #include "pch.h"
#include "ped.h" #include "ped.h"
#include "widget.h"
#include "util.h"
#include "weapon.h"
#include <CPopulation.h> #include <CPopulation.h>
#include "weapon.h"
#include "utils/widget.h"
#include "utils/util.h"
#ifdef GTASA #ifdef GTASA
#include <ePedBones.h> #include <ePedBones.h>

View File

@ -1,8 +1,8 @@
#include "pch.h" #include "pch.h"
#include "player.h" #include "player.h"
#include "menu.h" #include "menu.h"
#include "widget.h" #include "utils/widget.h"
#include "util.h" #include "utils/util.h"
#ifdef GTASA #ifdef GTASA
#include "ped.h" #include "ped.h"

View File

@ -1,8 +1,8 @@
#include "pch.h" #include "pch.h"
#include "teleport.h" #include "teleport.h"
#include "menu.h" #include "menu.h"
#include "widget.h" #include "utils/widget.h"
#include "util.h" #include "utils/util.h"
#ifdef GTASA #ifdef GTASA
// FlA // FlA

View File

@ -1,17 +1,17 @@
#include "pch.h" #include "pch.h"
#include "vehicle.h" #include "vehicle.h"
#include "menu.h"
#include "widget.h"
#include "util.h"
#include "teleport.h"
#include "filehandler.h"
#include <CPopulation.h> #include <CPopulation.h>
#include <CDamageManager.h> #include <CDamageManager.h>
#include "menu.h"
#include "teleport.h"
#include "utils/widget.h"
#include "utils/util.h"
#include "custom/filehandler.h"
#ifdef GTASA #ifdef GTASA
#include "tHandlingData.h" #include <tHandlingData.h>
#include "neon.h" #include "custom/neon.h"
#include "paint.h" #include "custom/paint.h"
#endif #endif
void Vehicle::Init() void Vehicle::Init()
@ -750,8 +750,7 @@ void Vehicle::ShowPage()
pPlayer->m_nPedFlags.CantBeKnockedOffBike = 1; pPlayer->m_nPedFlags.CantBeKnockedOffBike = 1;
#elif GTAVC #elif GTAVC
patch::SetRaw(0x614C4E, (void*)"\x8B\x8D\x00\x00\x00\x00", 6); patch::PutRetn(0x613920, 0x10);
patch::SetRaw(0x614CC5, (void*)"\x8B\x85\x00\x00\x00\x00", 6);
#endif #endif
} }
else else
@ -760,8 +759,7 @@ void Vehicle::ShowPage()
pPlayer->m_nPedFlags.CantBeKnockedOffBike = 2; pPlayer->m_nPedFlags.CantBeKnockedOffBike = 2;
#elif GTAVC #elif GTAVC
patch::SetRaw(0x614C4E, (void*)"\x8B\x8D\xA8\x01\x00\x00", 6); patch::SetRaw(0x613920, (void*)"\x53\x56\x57\x55", 4);
patch::SetRaw(0x614CC5, (void*)"\x8B\x85\xAC\x01\x00\x00", 6);
#endif #endif
} }
} }

View File

@ -1,14 +1,14 @@
#include "pch.h" #include "pch.h"
#include "visual.h" #include "visual.h"
#include "widget.h"
#include "util.h"
#include "game.h" #include "game.h"
#include "timecycle.h"
#include "CWorld.h"
#include "vehicle.h" #include "vehicle.h"
#include "utils/widget.h"
#include "utils/util.h"
#include "utils/timecycle.h"
#include <CWorld.h>
#ifdef GTASA #ifdef GTASA
#include "CHudColours.h" #include <CHudColours.h>
#endif #endif
#ifdef GTASA #ifdef GTASA

View File

@ -1,8 +1,8 @@
#include "pch.h" #include "pch.h"
#include "weapon.h" #include "weapon.h"
#include "widget.h" #include "utils/widget.h"
#include "util.h" #include "utils/util.h"
#include "CWeaponInfo.h" #include <CWeaponInfo.h>
void Weapon::Init() void Weapon::Init()
{ {

View File

@ -51,17 +51,17 @@
#include <CTheZones.h> #include <CTheZones.h>
#endif #endif
#include "../depend/fla/IDaccess.h" #include "fla/IDaccess.h"
#include "../depend/imgui/imgui.h" #include "imgui/imgui.h"
#include "defines.h" #include "defines.h"
#include "log.h" #include "utils/log.h"
#include "datastore.h" #include "utils/datastore.h"
#include "hotkeys.h" #include "utils/hotkeys.h"
#include "resourcestore.h" #include "utils/resourcestore.h"
#include "fontmgr.h" #include "utils/fontmgr.h"
#include "locale.h" #include "utils/locale.h"
#include "util.h" #include "utils/util.h"
#define TEXT(x) Locale::GetText(x).c_str() #define TEXT(x) Locale::GetText(x).c_str()
#define TEXT_S(x) Locale::GetText(x) #define TEXT_S(x) Locale::GetText(x)

View File

@ -1,10 +1,10 @@
#include "pch.h" #include "pch.h"
#include "d3dhook.h" #include "d3dhook.h"
#include "../depend/kiero/kiero.h" #include "kiero/kiero.h"
#include "../depend/kiero/minhook/MinHook.h" #include "kiero/minhook/MinHook.h"
#include "../depend/imgui/imgui_impl_dx9.h" #include "imgui/imgui_impl_dx9.h"
#include "../depend/imgui/imgui_impl_dx11.h" #include "imgui/imgui_impl_dx11.h"
#include "../depend/imgui/imgui_impl_win32.h" #include "imgui/imgui_impl_win32.h"
#include <dinput.h> #include <dinput.h>
#define DIMOUSE ((LPDIRECTINPUTDEVICE8)(RsGlobal.ps->diMouse)) #define DIMOUSE ((LPDIRECTINPUTDEVICE8)(RsGlobal.ps->diMouse))

View File

@ -1,5 +1,5 @@
#include "datastore.h"
#include "pch.h" #include "pch.h"
#include "datastore.h"
DataStore::DataStore(const char* fileName, bool isPathPredefined) noexcept DataStore::DataStore(const char* fileName, bool isPathPredefined) noexcept
{ {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#define TOML_EXCEPTIONS 0 #define TOML_EXCEPTIONS 0
#include "../depend/toml_addon.hpp" #include "toml_addon.hpp"
#include <memory> #include <memory>

View File

@ -1,5 +1,5 @@
#include "fontmgr.h"
#include "pch.h" #include "pch.h"
#include "fontmgr.h"
ImFont* FontMgr::Get(const char* fontID) ImFont* FontMgr::Get(const char* fontID)
{ {

View File

@ -2,7 +2,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <fstream> #include <fstream>
#include <memory> #include <memory>
#include "defines.h"
enum class eLogLevel enum class eLogLevel
{ {

View File

@ -1,12 +1,11 @@
#include "pch.h" #include "pch.h"
#include "vehicle.h"
#include <CSprite.h> #include <CSprite.h>
#include "overlay.h" #include "utils/overlay.h"
#ifdef GTASA #ifdef GTASA
#include "teleport.h" #include "pages/teleport.h"
#include "weapon.h" #include "pages/weapon.h"
#include "vehicle.h" #include "pages/vehicle.h"
#endif #endif
void Overlay::Init() void Overlay::Init()

View File

@ -1,5 +1,6 @@
#include "extensions/Paths.h"
#include "pch.h" #include "pch.h"
#include "resourcestore.h"
#include <extensions/Paths.h>
ResourceStore::ResourceStore(const char* text, eResourceType type, ImVec2 imageSize) ResourceStore::ResourceStore(const char* text, eResourceType type, ImVec2 imageSize)
: m_ImageSize(imageSize), m_Type(type), m_FileName(text) : m_ImageSize(imageSize), m_Type(type), m_FileName(text)

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include <string> #include <string>
#include <d3d9.h>
#include <rw/rwcore.h> #include <rw/rwcore.h>
#include "datastore.h" #include "imgui/imgui.h"
#include "../depend/imgui/imgui.h" #include "utils/datastore.h"
#include "d3d9.h"
struct RwD3D9Raster struct RwD3D9Raster
{ {

View File

@ -1,8 +1,8 @@
#include "pch.h" #include "pch.h"
#include "rpc.h" #include "rpc.h"
#include "util.h" #include "utils/util.h"
#include "menu.h" #include "pages/menu.h"
#include "vehicle.h" #include "pages/vehicle.h"
#include "cheatmenu.h" #include "cheatmenu.h"
// discord server ids // discord server ids

View File

@ -1,7 +1,7 @@
#include "pch.h" #include "pch.h"
#include "util.h"
#include "psapi.h"
#include <math.h> #include <math.h>
#include <psapi.h>
#include "util.h"
void Util::SetMessage(const char *message, bool b1, bool b2, bool b3) void Util::SetMessage(const char *message, bool b1, bool b2, bool b3)
{ {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "tchar.h" #include <tchar.h>
#include "pdh.h" #include <pdh.h>
/* /*
* Contains utility functions * Contains utility functions

View File

@ -1,6 +1,6 @@
#include "pch.h" #include "pch.h"
#include "widget.h" #include "widget.h"
#include "menu.h" #include "pages/menu.h"
static struct static struct
{ {

View File

@ -19,6 +19,68 @@ end
---------------------------- ----------------------------
function createProject(projectID)
upperID = string.upper(projectID)
pathExt = ""
if (projectID ~= "sa") then
pathExt = "_" .. projectID
end
project ("CheatMenu" .. upperID)
kind "SharedLib"
targetextension ".asi"
includedirs {
PSDK_DIR .. "/plugin_" .. projectID .. "/",
PSDK_DIR .. "/plugin_" .. projectID .. "/game_" .. projectID .. "/",
PSDK_DIR .. "/shared/",
PSDK_DIR .. "/shared/game/"
}
libdirs {
PSDK_DIR .. "/output/lib",
"lib"
}
files {
"../src/**.h",
"../src/**.hpp",
"../src/**.c",
"../src/**.cpp"
}
if upperID == "III" then
upperID = "3"
linkoptions {
"/FORCE:MULTIPLE"
}
end
defines {
"GTA" .. upperID,
}
pchheader "pch.h"
pchsource "../src/pch.cpp"
filter "files:..src/utils/**.cpp"
flags {"NoPCH"}
filter "configurations:Debug"
symbols "On"
links {
"depend",
"plugin" .. pathExt .. "_d.lib",
}
filter "configurations:Release"
optimize "On"
links {
"depend",
"plugin" .. pathExt.. ".lib",
}
end
workspace "CheatMenu" workspace "CheatMenu"
configurations { "Debug", "Release" } configurations { "Debug", "Release" }
architecture "x86" architecture "x86"
@ -41,6 +103,20 @@ workspace "CheatMenu"
"urlmon" "urlmon"
} }
defines {
"IS_PLATFORM_WIN" ,
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NON_CONFORMING_SWPRINTFS",
"_DX9_SDK_INSTALLED",
"PLUGIN_SGV_10US",
"_GTA_"
}
includedirs {
"../depend/",
"../src/",
}
project "depend" project "depend"
kind "StaticLib" kind "StaticLib"
@ -52,241 +128,14 @@ project "depend"
} }
filter "configurations:Debug" filter "configurations:Debug"
defines { "DEBUG", "IS_PLATFORM_WIN" } defines { "DEBUG" }
symbols "On" symbols "On"
filter "configurations:Release" filter "configurations:Release"
defines { "NDEBUG", "IS_PLATFORM_WIN" } defines { "NDEBUG" }
optimize "On" optimize "On"
project "CheatMenuIII" createProject("III")
kind "SharedLib" createProject("sa")
targetextension ".asi" createProject("vc")
files {
"../src/cheatmenu.h",
"../src/cheatmenu.cpp",
"../src/pch.h",
"../src/pch.cpp",
"../src/d3dhook.h",
"../src/d3dhook.cpp",
"../src/updater.h",
"../src/updater.cpp",
"../src/datastore.h",
"../src/datastore.cpp",
"../src/widget.h",
"../src/widget.cpp",
"../src/log.h",
"../src/log.cpp",
"../src/util.h",
"../src/util.cpp",
"../src/menu.h",
"../src/menu.cpp",
"../src/player.h",
"../src/player.cpp",
"../src/animation.h",
"../src/animation.cpp",
"../src/teleport.h",
"../src/teleport.cpp",
"../src/ped.h",
"../src/ped.cpp",
"../src/resourcestore.h",
"../src/resourcestore.cpp",
"../src/fontmgr.h",
"../src/fontmgr.cpp",
"../src/hotkeys.h",
"../src/hotkeys.cpp",
"../src/vehicle.h",
"../src/vehicle.cpp",
"../src/weapon.h",
"../src/weapon.cpp",
"../src/game.h",
"../src/game.cpp",
"../src/timecyc.h",
"../src/visual.h",
"../src/visual.cpp",
"../src/filehandler.h",
"../src/filehandler.cpp",
"../src/dllmain.cpp",
"../src/locale.h",
"../src/locale.cpp",
"../src/rpc.h",
"../src/rpc.cpp",
"../src/overlay.h",
"../src/overlay.cpp",
"../src/tasknames.cpp"
}
includedirs {
PSDK_DIR .. "/plugin_III/",
PSDK_DIR .. "/plugin_III/game_III/",
PSDK_DIR .. "/shared/",
PSDK_DIR .. "/shared/game/"
}
libdirs (PSDK_DIR .. "/output/lib")
defines {
"IS_PLATFORM_WIN" ,
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NON_CONFORMING_SWPRINTFS",
"GTA3",
"_DX9_SDK_INSTALLED",
"PLUGIN_SGV_10US"
}
linkoptions {
"/FORCE:MULTIPLE"
}
pchheader "pch.h"
pchsource "../src/pch.cpp"
filter "configurations:Debug"
symbols "On"
links {
"depend",
"plugin_III_d.lib"
}
filter "configurations:Release"
optimize "On"
links {
"depend",
"plugin_III.lib"
}
project "CheatMenuVC"
kind "SharedLib"
targetextension ".asi"
files {
"../src/cheatmenu.h",
"../src/cheatmenu.cpp",
"../src/pch.h",
"../src/pch.cpp",
"../src/d3dhook.h",
"../src/d3dhook.cpp",
"../src/updater.h",
"../src/updater.cpp",
"../src/datastore.h",
"../src/datastore.cpp",
"../src/animation.h",
"../src/animation.cpp",
"../src/teleport.h",
"../src/teleport.cpp",
"../src/player.h",
"../src/player.cpp",
"../src/ped.h",
"../src/ped.cpp",
"../src/widget.h",
"../src/widget.cpp",
"../src/log.h",
"../src/log.cpp",
"../src/vehicle.h",
"../src/vehicle.cpp",
"../src/util.h",
"../src/util.cpp",
"../src/menu.h",
"../src/menu.cpp",
"../src/weapon.h",
"../src/weapon.cpp",
"../src/game.h",
"../src/game.cpp",
"../src/visual.h",
"../src/visual.cpp",
"../src/resourcestore.h",
"../src/resourcestore.cpp",
"../src/fontmgr.h",
"../src/fontmgr.cpp",
"../src/filehandler.h",
"../src/filehandler.cpp",
"../src/hotkeys.h",
"../src/hotkeys.cpp",
"../src/dllmain.cpp",
"../src/locale.h",
"../src/locale.cpp",
"../src/rpc.h",
"../src/rpc.cpp",
"../src/overlay.h",
"../src/overlay.cpp",
"../src/tasknames.cpp"
}
includedirs {
PSDK_DIR .. "/plugin_vc/",
PSDK_DIR .. "/plugin_vc/game_vc/",
PSDK_DIR .. "/shared/",
PSDK_DIR .. "/shared/game/"
}
libdirs (PSDK_DIR .. "/output/lib")
defines {
"IS_PLATFORM_WIN" ,
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NON_CONFORMING_SWPRINTFS",
"GTAVC",
"_DX9_SDK_INSTALLED",
"PLUGIN_SGV_10US"
}
pchheader "pch.h"
pchsource "../src/pch.cpp"
filter "configurations:Debug"
symbols "On"
links {
"depend",
"plugin_vc_d.lib"
}
filter "configurations:Release"
optimize "On"
links {
"depend",
"plugin_vc.lib"
}
project "CheatMenuSA"
kind "SharedLib"
targetextension ".asi"
files {
"../src/**.h",
"../src/**.hpp",
"../src/**.cpp"
}
includedirs {
PSDK_DIR .. "/plugin_sa/",
PSDK_DIR .. "/plugin_sa/game_sa/",
PSDK_DIR .. "/shared/",
PSDK_DIR .. "/shared/game/"
}
libdirs {
PSDK_DIR .. "/output/lib",
"../depend/lib"
}
defines {
"IS_PLATFORM_WIN" ,
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NON_CONFORMING_SWPRINTFS",
"GTASA",
"_DX9_SDK_INSTALLED",
"PLUGIN_SGV_10US"
}
pchheader "pch.h"
pchsource "../src/pch.cpp"
filter "configurations:Debug"
symbols "On"
links {
"depend",
"plugin_d.lib",
}
filter "configurations:Release"
optimize "On"
links {
"depend",
"plugin.lib",
}