From fb289ae4f79cd70bb28a85e6b9dde845ffcbe0f5 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/user/cheat/visuals/AnimationChanger.cpp | 7 ++++++- cheat-library/src/user/cheat/visuals/AnimationChanger.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) 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;