From d71a09ac82494c1d50f0a976d266895286a20c23 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:01:17 -0600 Subject: [PATCH] Changes from review --- .../src/user/cheat/visuals/AnimationChanger.cpp | 11 ++++------- .../src/user/cheat/visuals/AnimationChanger.h | 4 ---- cheat-library/src/user/cheat/world/FreezeEnemies.cpp | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp b/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp index 2b77708..37f36e0 100644 --- a/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp +++ b/cheat-library/src/user/cheat/visuals/AnimationChanger.cpp @@ -224,8 +224,7 @@ namespace cheat::feature NF(f_Enabled, "Animation Changer", "Visuals::AnimationChanger", false), NF(f_Animation, "Animation", "Visuals::AnimationChanger", "ExtraAttack"), NF(f_ApplyKey, "Apply Animation", "Visuals::AnimationChanger", Hotkey('Y')), - NF(f_ResetKey, "Reset Animation", "Visuals::AnimationChanger", Hotkey('R')), - toBeUpdate(), nextUpdate(0) + NF(f_ResetKey, "Reset Animation", "Visuals::AnimationChanger", Hotkey('R')) { events::GameUpdateEvent += MY_METHOD_HANDLER(AnimationChanger::OnGameUpdate); } @@ -250,6 +249,7 @@ namespace cheat::feature bool is_selected = (f_Animation.value().c_str() == animation); if (ImGui::Selectable(animation.c_str(), is_selected)) f_Animation.value() = animation; + if (is_selected) ImGui::SetItemDefaultFocus(); } @@ -284,9 +284,8 @@ namespace cheat::feature if (!f_Enabled) return; - auto currentTime = util::GetCurrentTimeMillisec(); - if (currentTime < nextUpdate) - return; + // Taiga#5555: Maybe need to add separate option to change delay value if user feels like it's too fast or slow. + UPDATE_DELAY(400); auto& manager = game::EntityManager::instance(); auto avatar = manager.avatar(); @@ -298,7 +297,5 @@ namespace cheat::feature if (f_ResetKey.value().IsPressed()) app::Animator_Rebind(avatar->animator(), nullptr); - - nextUpdate = currentTime + (int)f_DelayUpdate; } } diff --git a/cheat-library/src/user/cheat/visuals/AnimationChanger.h b/cheat-library/src/user/cheat/visuals/AnimationChanger.h index c0e9d29..b8f9d0c 100644 --- a/cheat-library/src/user/cheat/visuals/AnimationChanger.h +++ b/cheat-library/src/user/cheat/visuals/AnimationChanger.h @@ -1,7 +1,6 @@ #pragma once #include #include -#include namespace cheat::feature { @@ -22,9 +21,6 @@ namespace cheat::feature void OnGameUpdate(); private: - SafeQueue toBeUpdate; - SafeValue nextUpdate; - int f_DelayUpdate = 500; AnimationChanger(); }; } diff --git a/cheat-library/src/user/cheat/world/FreezeEnemies.cpp b/cheat-library/src/user/cheat/world/FreezeEnemies.cpp index 5b6ca72..183b4d1 100644 --- a/cheat-library/src/user/cheat/world/FreezeEnemies.cpp +++ b/cheat-library/src/user/cheat/world/FreezeEnemies.cpp @@ -9,7 +9,6 @@ namespace cheat::feature { - static bool change = false; FreezeEnemies::FreezeEnemies() : Feature(), NF(f_Enabled, "Freeze Enemies", "FreezeEnemies", false) @@ -48,6 +47,7 @@ namespace cheat::feature void FreezeEnemies::OnGameUpdate() { auto& manager = game::EntityManager::instance(); + static bool change = false; for (const auto& monster : manager.entities(game::filters::combined::Monsters)) {