Changes from review

This commit is contained in:
Joaquin 2022-08-04 22:01:17 -06:00
parent 31a369227a
commit 504679196c
3 changed files with 5 additions and 12 deletions

View File

@ -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;
}
}

View File

@ -1,7 +1,6 @@
#pragma once
#include <cheat-base/cheat/Feature.h>
#include <cheat-base/config/config.h>
#include <cheat-base/thread-safe.h>
namespace cheat::feature
{
@ -22,9 +21,6 @@ namespace cheat::feature
void OnGameUpdate();
private:
SafeQueue<uint32_t> toBeUpdate;
SafeValue<int64_t> nextUpdate;
int f_DelayUpdate = 500;
AnimationChanger();
};
}

View File

@ -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))
{