Changes from review
This commit is contained in:
parent
aab7968add
commit
d71a09ac82
@ -224,8 +224,7 @@ namespace cheat::feature
|
|||||||
NF(f_Enabled, "Animation Changer", "Visuals::AnimationChanger", false),
|
NF(f_Enabled, "Animation Changer", "Visuals::AnimationChanger", false),
|
||||||
NF(f_Animation, "Animation", "Visuals::AnimationChanger", "ExtraAttack"),
|
NF(f_Animation, "Animation", "Visuals::AnimationChanger", "ExtraAttack"),
|
||||||
NF(f_ApplyKey, "Apply Animation", "Visuals::AnimationChanger", Hotkey('Y')),
|
NF(f_ApplyKey, "Apply Animation", "Visuals::AnimationChanger", Hotkey('Y')),
|
||||||
NF(f_ResetKey, "Reset Animation", "Visuals::AnimationChanger", Hotkey('R')),
|
NF(f_ResetKey, "Reset Animation", "Visuals::AnimationChanger", Hotkey('R'))
|
||||||
toBeUpdate(), nextUpdate(0)
|
|
||||||
{
|
{
|
||||||
events::GameUpdateEvent += MY_METHOD_HANDLER(AnimationChanger::OnGameUpdate);
|
events::GameUpdateEvent += MY_METHOD_HANDLER(AnimationChanger::OnGameUpdate);
|
||||||
}
|
}
|
||||||
@ -250,6 +249,7 @@ namespace cheat::feature
|
|||||||
bool is_selected = (f_Animation.value().c_str() == animation);
|
bool is_selected = (f_Animation.value().c_str() == animation);
|
||||||
if (ImGui::Selectable(animation.c_str(), is_selected))
|
if (ImGui::Selectable(animation.c_str(), is_selected))
|
||||||
f_Animation.value() = animation;
|
f_Animation.value() = animation;
|
||||||
|
|
||||||
if (is_selected)
|
if (is_selected)
|
||||||
ImGui::SetItemDefaultFocus();
|
ImGui::SetItemDefaultFocus();
|
||||||
}
|
}
|
||||||
@ -284,9 +284,8 @@ namespace cheat::feature
|
|||||||
if (!f_Enabled)
|
if (!f_Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto currentTime = util::GetCurrentTimeMillisec();
|
// Taiga#5555: Maybe need to add separate option to change delay value if user feels like it's too fast or slow.
|
||||||
if (currentTime < nextUpdate)
|
UPDATE_DELAY(400);
|
||||||
return;
|
|
||||||
|
|
||||||
auto& manager = game::EntityManager::instance();
|
auto& manager = game::EntityManager::instance();
|
||||||
auto avatar = manager.avatar();
|
auto avatar = manager.avatar();
|
||||||
@ -298,7 +297,5 @@ namespace cheat::feature
|
|||||||
|
|
||||||
if (f_ResetKey.value().IsPressed())
|
if (f_ResetKey.value().IsPressed())
|
||||||
app::Animator_Rebind(avatar->animator(), nullptr);
|
app::Animator_Rebind(avatar->animator(), nullptr);
|
||||||
|
|
||||||
nextUpdate = currentTime + (int)f_DelayUpdate;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <cheat-base/cheat/Feature.h>
|
#include <cheat-base/cheat/Feature.h>
|
||||||
#include <cheat-base/config/config.h>
|
#include <cheat-base/config/config.h>
|
||||||
#include <cheat-base/thread-safe.h>
|
|
||||||
|
|
||||||
namespace cheat::feature
|
namespace cheat::feature
|
||||||
{
|
{
|
||||||
@ -22,9 +21,6 @@ namespace cheat::feature
|
|||||||
void OnGameUpdate();
|
void OnGameUpdate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SafeQueue<uint32_t> toBeUpdate;
|
|
||||||
SafeValue<int64_t> nextUpdate;
|
|
||||||
int f_DelayUpdate = 500;
|
|
||||||
AnimationChanger();
|
AnimationChanger();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
namespace cheat::feature
|
namespace cheat::feature
|
||||||
{
|
{
|
||||||
static bool change = false;
|
|
||||||
|
|
||||||
FreezeEnemies::FreezeEnemies() : Feature(),
|
FreezeEnemies::FreezeEnemies() : Feature(),
|
||||||
NF(f_Enabled, "Freeze Enemies", "FreezeEnemies", false)
|
NF(f_Enabled, "Freeze Enemies", "FreezeEnemies", false)
|
||||||
@ -48,6 +47,7 @@ namespace cheat::feature
|
|||||||
void FreezeEnemies::OnGameUpdate()
|
void FreezeEnemies::OnGameUpdate()
|
||||||
{
|
{
|
||||||
auto& manager = game::EntityManager::instance();
|
auto& manager = game::EntityManager::instance();
|
||||||
|
static bool change = false;
|
||||||
|
|
||||||
for (const auto& monster : manager.entities(game::filters::combined::Monsters))
|
for (const auto& monster : manager.entities(game::filters::combined::Monsters))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user