From 9c91ab3dfed1305ac1ab21fe781ca391f485723e Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Fri, 16 Sep 2022 08:42:40 -0600 Subject: [PATCH] Added debugging for animation changer --- cheat-library/src/appdata/il2cpp-functions.h | 1 + cheat-library/src/user/cheat/visuals/AnimationChanger.cpp | 7 ++++++- cheat-library/src/user/cheat/visuals/AnimationChanger.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index 9b527ab..7ac03da 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -350,6 +350,7 @@ DO_APP_FUNC(0x05BD9F90, void, Animator_Play, (Animator* __this, String* stateNam DO_APP_FUNC(0x05BDA110, void, Animator_Rebind, (Animator* __this, MethodInfo* method)); DO_APP_FUNC(0x05BDA640, float, Animator_get_speed, (Animator* __this, MethodInfo* method)); DO_APP_FUNC(0x05BDA770, void, Animator_set_speed, (Animator* __this, float value, MethodInfo* method)); +DO_APP_FUNC(0x04E510A0, String*, Extension_GetCurrentStateName, (Animator* animator, int32_t layer, AnimatorController* animCont, MethodInfo* method)); DO_APP_FUNC(0x05C5B3D0, bool, Behaviour_get_isActiveAndEnabled, (Behaviour* __this, MethodInfo* method)); diff --git a/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp b/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp index d6c292d..067d432 100644 --- a/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp +++ b/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp @@ -17,7 +17,8 @@ namespace cheat::feature NF(f_Animation, "Animation", "Visuals::AnimationChanger", "Attack01"), NF(f_ApplyKey, "Apply Animation", "Visuals::AnimationChanger", Hotkey('Y')), NF(f_ResetKey, "Reset Animation", "Visuals::AnimationChanger", Hotkey('R')), - NF(f_Delay, "Repeat Delay", "Visuals::AnimationChanger", 400) + NF(f_Delay, "Repeat Delay", "Visuals::AnimationChanger", 400), + NF(f_Debug, "Debug Animations", "Visuals::AnimationChanger", false) { HookManager::install(app::MoleMole_PlayerModule_EntityAppear, MoleMole_PlayerModule_EntityAppear_Hook); events::GameUpdateEvent += MY_METHOD_HANDLER(AnimationChanger::OnGameUpdate); @@ -53,6 +54,7 @@ namespace cheat::feature ConfigWidget("Apply Key", f_ApplyKey, true); ConfigWidget("Reset Key", f_ResetKey, true); ConfigWidget("Delay", f_Delay, 1, 1, 1000000000, "Delay to repeat animation"); + ConfigWidget(f_Debug, "Logs current active character's animation state."); } } ImGui::EndGroupPanel(); @@ -107,6 +109,9 @@ namespace cheat::feature auto stateNamesArray = reinterpret_cast(acComponent)->fields._stateNames; + if (f_Debug) + LOG_DEBUG(il2cppi_to_string(app::Extension_GetCurrentStateName(avatar->animator(), 0, reinterpret_cast(acComponent), nullptr)).c_str()); + static bool isFull = false; for (int i = 0; i < stateNamesArray->max_length && !isFull; i++) { diff --git a/cheat-library/src/user/cheat/visuals/AnimationChanger.h b/cheat-library/src/user/cheat/visuals/AnimationChanger.h index 4a7ecaa..49d7477 100644 --- a/cheat-library/src/user/cheat/visuals/AnimationChanger.h +++ b/cheat-library/src/user/cheat/visuals/AnimationChanger.h @@ -13,6 +13,7 @@ namespace cheat::feature config::Field f_ApplyKey; config::Field f_ResetKey; config::Field f_Delay; + config::Field f_Debug; const FeatureGUIInfo& GetGUIInfo() const override; void DrawMain() override;