From 8db76a2ce7e883578a7d07c41c0cb4a2ac235027 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Fri, 5 Aug 2022 09:30:33 +0600 Subject: [PATCH] Refactor animation, cutscene & particle class --- resource/CheatMenuSA/misc.txd | Bin 526632 -> 543144 bytes src/animation.cpp | 148 +++++++++++++++++----------------- src/animation.h | 79 +++++++++++++----- src/defines.h | 2 +- src/overlay.cpp | 2 - 5 files changed, 135 insertions(+), 96 deletions(-) diff --git a/resource/CheatMenuSA/misc.txd b/resource/CheatMenuSA/misc.txd index 5e508f51da42f36e35daceae6ace508ff3acd351..e056ebdfada2bbc7c1cc1134bbc20db3fd575f0c 100644 GIT binary patch delta 16642 zcmbW8Uub04eaEjxNh6PAt*zFrw=YQ_N}Vy*wrkRd5^&y17rH8vuSBIJLzxbL7j(n@aEcj{^S#lapp^yA|~&!eYS_Uh?y ze0X+sr|O*>&8^<9YyNM5nLa%6@LSLCMLfHj-L5Y*la_W^ZfHfI zYZ|5<=cZP7>Z4Y(C0rP}{@x3i)IaI1?Oj`#?)RZ+yS{)WZi}*J0!6ioEMru$(}1m( zuuZ&*s>2e}K=1mUo^k$FKisNrSJ@#GF|k*Br~X~nGVYgIs3t7% zplfjLT$)M)yG@3YXkmzmGaF&^hYWOJ(*ohxY^mgc&+Pd9|J zjBw-FLd_!0u(8bH9_)CtSQM5@a+ilzpdJhCz0hnn8dGRue>58Hy>PqU@4NSe@)qHs zTsBi*xtDsGet`!G%is>UvFVJebyqT~pdN(E;q&i_>Mv!9zh|5e2HyOC&`X7b!JxNQ z#qU|jHt69rXrPPO)~a|R{o?#$W2gRFwN!HU05)9EgGH4VGCn?L8fdyE?L#djNyD^| zwOUPf%tXvEg&Vbp`M`=jPZjlOOg=6Vi?- zeL{$4qydea%lP1$PcQ&13g`Logfzf|)s_jv^%mpQ-)aR64=xl6$1`fNH=HY1B*{Z7 z+Q4u~{F_=Ka+(+#ptOKHx!+Cv`+#Y}A%AJZDI!W6HV&$mLmSG7pnG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mNZZ&V37NYn<9HBh0WWK~uqf*-fCf(sc1z|cL z0to9}mPU99o@=5PkO_AQI1-@(Pec~pjT;h*8bkg5KK~GqUo2QQPW_V4u6vY&nzxCbpsrmNQC3bcMc}v8ykhICTj7TX=aWCPB_kL#jjW28(QZI5s^`fwys#4<+3PGuHli%zoK`!|Uhsg+)Aka9BX>kEo4d^0wOS zG;XXpZS#~vn>Rf1!blh5z=%gpW~R+N6Nnn`b{F3^OWgz+k6V$?nJ=_ce-cIMzVA1{ abHtyb@Ux?rM(^r_&wTqk58gNN$o~Om;M!;a delta 65 zcmZ26S#iZA1xYam1_l{U4u=2#nI#y3Y!)B}v6&hrTO}D=C7D_!nOh}US|wRqCD~df Q*|$n^Fmq0y #include "eAnimations.h" #include - #elif GTAVC - #include "../depend/kiero/minhook/MinHook.h" #include #include @@ -22,9 +20,18 @@ #ifdef GTASA #include "overlay.h" +void Cutscene::Init() +{ + static CdeclEvent , PRIORITY_AFTER, ArgPickNone, void()> skipCutsceneEvent; + skipCutsceneEvent += []() + { + Stop(); + }; +} + void Cutscene::Play(std::string& rootKey, std::string& cutsceneId, std::string& interior) { - if (Util::IsOnCutscene()) + if (CCutsceneMgr::ms_running) { Util::SetMessage(TEXT("Animation.CutsceneRunning")); return; @@ -33,11 +40,10 @@ void Cutscene::Play(std::string& rootKey, std::string& cutsceneId, std::string& CPlayerPed* pPlayer = FindPlayerPed(); if (pPlayer) { - m_SceneName = cutsceneId; m_pLastVeh = pPlayer->m_nPedFlags.bInVehicle ? pPlayer->m_pVehicle : nullptr; m_nVehSeat = -1; - if (m_pLastVeh->m_pDriver != pPlayer) + if (m_pLastVeh && m_pLastVeh->m_pDriver != pPlayer) { for (size_t i = 0; i != 8; ++i) { @@ -48,10 +54,44 @@ void Cutscene::Play(std::string& rootKey, std::string& cutsceneId, std::string& } } } - Command(cutsceneId.c_str()); + CCutsceneMgr::LoadCutsceneData(cutsceneId.c_str()); + CCutsceneMgr::Update(); + m_nInterior = pPlayer->m_nAreaCode; pPlayer->m_nAreaCode = std::stoi(interior); Command(pPlayer->m_nAreaCode); + Cutscene::m_bRunning = true; + CCutsceneMgr::StartCutscene(); + } +} + +void Cutscene::Stop() +{ + if (Cutscene::m_bRunning) + { + CPlayerPed *pPlayer = FindPlayerPed(); + int hPlayer = CPools::GetPedRef(pPlayer); + + CCutsceneMgr::DeleteCutsceneData(); + Cutscene::m_bRunning = false; + pPlayer->m_nAreaCode = Cutscene::m_nInterior; + Cutscene::m_nInterior = 0; + Command(pPlayer->m_nAreaCode); + + // handle vehicle + if (Cutscene::m_pLastVeh) + { + int hVeh = CPools::GetVehicleRef(Cutscene::m_pLastVeh); + if (Cutscene::m_nVehSeat == -1) + { + Command(hPlayer, hVeh); + } + else + { + Command(hPlayer, hVeh, Cutscene::m_nVehSeat); + } + } + TheCamera.Fade(0, 1); } } @@ -64,10 +104,25 @@ void Particle::Play(std::string& cat, std::string& name, std::string& particle) int handle; Command(particle.c_str(), pos.x, pos.y, pos.z, 1, &handle); Command(handle); - m_nParticleList.push_back(handle); + m_nList.push_back(handle); } } +void Particle::RemoveAll() +{ + for (int& p : Particle::m_nList) + { + Command(p); + } + Particle::m_nList.clear(); +} + +void Particle::RemoveLatest() +{ + Command(Particle::m_nList.back()); // stop if anything is running + Particle::m_nList.pop_back(); +} + #elif GTAVC // Thanks to codenulls(https://github.com/codenulls/) @@ -178,14 +233,14 @@ void _PlayAnim(RpClump* pClump, int animGroup, int animID, float blend, bool loo void Animation::Play(std::string& cat, std::string& anim, std::string& ifp) { - CPed *pPed = m_PedAnim ? m_pTarget : FindPlayerPed(); + CPed *pPed = m_bPedAnim ? m_pTarget : FindPlayerPed(); if (!pPed) { return; } #ifdef GTASA - int hped = CPools::GetPedRef(pPed); + int hPed = CPools::GetPedRef(pPed); if (ifp != "PED") { @@ -193,14 +248,14 @@ void Animation::Play(std::string& cat, std::string& anim, std::string& ifp) Command(); } - Command(hped); + Command(hPed); if (m_bSecondary) { - Command(hped, anim.c_str(), ifp.c_str(), 4.0, m_Loop, 0, 0, 0, -1); + Command(hPed, anim.c_str(), ifp.c_str(), 4.0, m_Loop, 0, 0, 0, -1); } else { - Command(hped, anim.c_str(), ifp.c_str(), 4.0, m_Loop, 0, 0, 0, -1); + Command(hPed, anim.c_str(), ifp.c_str(), 4.0, m_Loop, 0, 0, 0, -1); } if (ifp != "PED") @@ -218,32 +273,10 @@ void Animation::Play(std::string& cat, std::string& anim, std::string& ifp) void Animation::Init() { #ifdef GTASA + Cutscene::Init(); Events::processScriptsEvent += [] { CPlayerPed* pPlayer = FindPlayerPed(); - if (Cutscene::m_bRunning) - { - if (Command()) - { - if (!pPlayer) - { - return; - } - - pPlayer->m_nAreaCode = Cutscene::m_nInterior; - Command(pPlayer->m_nAreaCode); - Cutscene::m_nInterior = 0; - TheCamera.Fade(0, 1); - } - } - else - { - if (Cutscene::m_SceneName != "" && Command()) - { - Command(); - Cutscene::m_bRunning = true; - } - } if (pPlayer && pPlayer->m_pPlayerTargettedPed) { @@ -277,8 +310,6 @@ void Animation::ShowPage() CPlayerPed* pPlayer = FindPlayerPed(); int hPlayer = CPools::GetPedRef(pPlayer); - ImGui::Spacing(); - if (ImGui::BeginTabItem(TEXT("Animation.AnimationTab"))) { ImGui::Spacing(); @@ -300,12 +331,12 @@ void Animation::ShowPage() Widget::Checkbox(TEXT("Animation.SecondaryCheckbox"), &m_bSecondary, TEXT("Animation.SecondaryCheckboxText")); ImGui::NextColumn(); #ifdef GTASA - Widget::Checkbox(TEXT("Animation.PedAnim"), &m_PedAnim, TEXT("Animation.PedAnimText")); + Widget::Checkbox(TEXT("Animation.PedAnim"), &m_bPedAnim, TEXT("Animation.PedAnimText")); #endif ImGui::Columns(1); ImGui::Spacing(); - if (m_PedAnim && !m_pTarget) + if (m_bPedAnim && !m_pTarget) { ImGui::TextWrapped(TEXT("Animation.NoTarget")); } @@ -343,15 +374,14 @@ void Animation::ShowPage() ImGui::Spacing(); Widget::Checkbox(TEXT("Menu.ShowPedTasks"), &Overlay::m_bPedTasks); ImGui::Spacing(); - CPlayerPed* player = FindPlayerPed(); - if (player) + if (pPlayer) { ImGui::BeginChild("TasksList"); ImGui::Text(TEXT("Animation.PrimaryTasks")); ImGui::Separator(); for (size_t i = 0; i != TASK_PRIMARY_MAX; ++i) { - CTask *pTask = player->m_pIntelligence->m_TaskMgr.m_aPrimaryTasks[i]; + CTask *pTask = pPlayer->m_pIntelligence->m_TaskMgr.m_aPrimaryTasks[i]; if (pTask) { const char *name = taskNames[pTask->GetId()]; @@ -369,7 +399,7 @@ void Animation::ShowPage() ImGui::Separator(); for (size_t i = 0; i != TASK_SECONDARY_MAX; ++i) { - CTask *pTask = player->m_pIntelligence->m_TaskMgr.m_aSecondaryTasks[i]; + CTask *pTask = pPlayer->m_pIntelligence->m_TaskMgr.m_aSecondaryTasks[i]; if (pTask) { const char *name = taskNames[pTask->GetId()]; @@ -389,28 +419,7 @@ void Animation::ShowPage() ImGui::Spacing(); if (ImGui::Button(TEXT("Animation.StopCutscene"), Widget::CalcSize())) { - if (Cutscene::m_bRunning) - { - CPlayerPed* player = FindPlayerPed(); - int hPlayer = CPools::GetPedRef(player); - int hVeh = CPools::GetVehicleRef(Cutscene::m_pLastVeh); - Command(); - Cutscene::m_bRunning = false; - Cutscene::m_SceneName = ""; - player->m_nAreaCode = Cutscene::m_nInterior; - Command(player->m_nAreaCode); - - if (Cutscene::m_nVehSeat == -1) - { - Command(hPlayer, hVeh); - } - else - { - Command(hPlayer, hVeh, Cutscene::m_nVehSeat); - } - Cutscene::m_nInterior = 0; - TheCamera.Fade(0, 1); - } + Cutscene::Stop(); } ImGui::Spacing(); @@ -427,17 +436,12 @@ void Animation::ShowPage() ImGui::Spacing(); if (ImGui::Button(TEXT("Animation.RemoveAll"), Widget::CalcSize(2))) { - for (int& p : Particle::m_nParticleList) - { - Command(p); - } - Particle::m_nParticleList.clear(); + Particle::RemoveAll(); } ImGui::SameLine(); if (ImGui::Button(TEXT("Animation.RemoveLatest"), Widget::CalcSize(2))) { - Command(Particle::m_nParticleList.back()); // stop if anything is running - Particle::m_nParticleList.pop_back(); + Particle::RemoveLatest(); } ImGui::Spacing(); if (Widget::CheckboxBits(TEXT("Animation.InvisiblePlayer"), pPlayer->m_nPedFlags.bDontRender)) diff --git a/src/animation.h b/src/animation.h index e10ee6d..fe3961a 100644 --- a/src/animation.h +++ b/src/animation.h @@ -2,48 +2,85 @@ #include "pch.h" #ifdef GTASA +/* + Cutscene Player Class for SA + Plays mission cutscenes +*/ class Cutscene { -public: - static inline ResourceStore m_Data{ "cutscenes", eResourceType::TYPE_TEXT }; - static inline std::string m_SceneName; - static inline int m_nInterior; // player interior backup - static inline bool m_bRunning; - static inline CVehicle *m_pLastVeh; - static inline int m_nVehSeat; +private: + static inline bool m_bRunning; // is cutscene currently running - static void Play(std::string& rootKey, std::string& cutsceneId, std::string& interior); + // backup data + static inline int m_nInterior; // interior player was in + static inline CVehicle *m_pLastVeh; // vehicle player was in + static inline int m_nVehSeat; // seat id of player vehicle + +public: + static inline ResourceStore m_Data{ "cutscenes", eResourceType::TYPE_TEXT }; // names + + Cutscene() = delete; + Cutscene(const Cutscene&) = delete; + + // Initializes hooks, vars etc. + static void Init(); + + // Plays a cutscene + static void Play(std::string& cat, std::string& key, std::string& val); + + // Stops a running cutscene + static void Stop(); }; +/* + Particle Player Class for SA + Spawns particles in the world +*/ class Particle { -public: - static inline ResourceStore m_Data{ "particles", eResourceType::TYPE_TEXT }; - static inline std::vector m_nParticleList; +private: + static inline std::vector m_nList; - static void Play(std::string& rootKey, std::string& particle, std::string& dummy); +public: + static inline ResourceStore m_Data{ "particles", eResourceType::TYPE_TEXT }; // names + + Particle() = delete; + Particle(const Particle&) = delete; + + // Plays a particle + static void Play(std::string& cat, std::string& key, std::string& val); + + // Removes all spawned particles + static void RemoveAll(); + + // Removes the most recent spawned particle + static void RemoveLatest(); }; #endif +/* + Animation Player Class + Plays animatins on player & peds +*/ class Animation { private: static inline ResourceStore m_AnimData{ "animations", eResourceType::TYPE_TEXT }; - static inline bool m_Loop; // loop animation - static inline bool m_bSecondary; // play animation as secondary - static inline bool m_PedAnim; - static inline CPed *m_pTarget = nullptr; + static inline bool m_Loop; // keep playing animation in a loop + static inline bool m_bSecondary; // play animation alongside another + static inline bool m_bPedAnim; // play the animation on a target ped + static inline CPed *m_pTarget = nullptr; // target ped pointer - static void Play(std::string& rootKey, std::string& anim, std::string& ifp); - -#ifdef GTASA - static void DrawPedTasks(); -#endif + // Plays a particular animation + static void Play(std::string& cat, std::string& key, std::string& val); public: Animation() = delete; Animation(const Animation&) = delete; + // Initializes hooks & stuff static void Init(); + + // Displays animation menu page static void ShowPage(); }; \ No newline at end of file diff --git a/src/defines.h b/src/defines.h index 7c4f259..2b41d94 100644 --- a/src/defines.h +++ b/src/defines.h @@ -9,7 +9,7 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "3.3" #define MENU_VERSION MENU_VERSION_NUMBER"-beta" -#define BUILD_NUMBER "20220721" +#define BUILD_NUMBER "20220805" #define MENU_TITLE MENU_NAME " v" MENU_VERSION #ifdef GTASA diff --git a/src/overlay.cpp b/src/overlay.cpp index 53545f8..bfe4029 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -11,8 +11,6 @@ void Overlay::Init() { - // TODO: use structs - // Load config data m_bCoord = gConfig.Get("Overlay.ShowCoordinates", false); m_bCpuUsage = gConfig.Get("Overlay.ShowCPUUsage", false); m_bFPS = gConfig.Get("Overlay.ShowFPS", false);