Updated to Include a Toggle for using CustomKeys

Added Toggle for Using Custom Keys to make sure everyone is happy so they dont have to use them if they dont want to.
This commit is contained in:
EchoesFromBeyond 2022-07-20 13:09:51 -07:00
parent df50653591
commit 2edc6aa81b
2 changed files with 64 additions and 45 deletions

View File

@ -13,32 +13,23 @@ namespace cheat::feature
app::Vector3 zero; app::Vector3 zero;
NoClip::NoClip() : Feature(), NoClip::NoClip() : Feature(),
<<<<<<< Updated upstream NF(f_Enabled, "No clip", "NoClip", false),
NF(f_Enabled, "No clip", "NoClip", false), NF(f_NoAnimation, "No Animation", "NoClip", true),
NF(f_NoAnimation, "No Animation", "NoClip", true), NF(f_UseCustomKeys, "Use Custom Hotkeys", "NoClip", false),
NF(f_Speed, "Speed", "NoClip", 5.5f),
NF(f_CameraRelative, "Relative to camera", "NoClip", true),
NF(f_VelocityMode, "Velocity mode", "NoClip", false),
NF(f_FreeflightMode, "Freeflight mode", "NoClip", false),
NF(f_AltSpeedEnabled, "Alt speed enabled", "NoClip", false),
NF(f_AltSpeed, "Alt speed", "NoClip", 1.0f)
=======
NF(f_Enabled, "No clip", "NoClip", false),
NF(f_NoAnimation, "No Animation", "NoClip", true),
NF(f_ForwardKey, "Forward HotKey", "NoClip", Hotkey(ImGuiKey_W)), NF(f_ForwardKey, "Forward HotKey", "NoClip", Hotkey(ImGuiKey_W)),
NF(f_LeftKey, "Left HotKey", "NoClip", Hotkey(ImGuiKey_A)), NF(f_LeftKey, "Left HotKey", "NoClip", Hotkey(ImGuiKey_A)),
NF(f_BackKey, "Back HotKey", "NoClip", Hotkey(ImGuiKey_S)), NF(f_BackKey, "Back HotKey", "NoClip", Hotkey(ImGuiKey_S)),
NF(f_RightKey, "Right HotKey", "NoClip", Hotkey(ImGuiKey_D)), NF(f_RightKey, "Right HotKey", "NoClip", Hotkey(ImGuiKey_D)),
NF(f_AscendKey, "Ascend HotKey", "NoClip", Hotkey(ImGuiKey_Space)), NF(f_AscendKey, "Ascend HotKey", "NoClip", Hotkey(ImGuiKey_Space)),
NF(f_DescendKey, "Descend HotKey", "NoClip", Hotkey(ImGuiKey_ModShift)), NF(f_DescendKey, "Descend HotKey", "NoClip", Hotkey(ImGuiKey_ModShift)),
NF(f_AltSpeedKey, "Alt Speed Hotkey", "NoClip", Hotkey(ImGuiKey_ModCtrl)),
NF(f_Speed, "Speed", "NoClip", 5.5f), NF(f_Speed, "Speed", "NoClip", 5.5f),
NF(f_CameraRelative, "Relative to camera", "NoClip", true), NF(f_CameraRelative, "Relative to camera", "NoClip", true),
NF(f_VelocityMode, "Velocity mode", "NoClip", false), NF(f_VelocityMode, "Velocity mode", "NoClip", false),
NF(f_FreeflightMode, "Freeflight mode", "NoClip", false), NF(f_FreeflightMode, "Freeflight mode", "NoClip", false),
NF(f_AltSpeedEnabled, "Alt speed enabled", "NoClip", false), NF(f_AltSpeedEnabled, "Alt speed enabled", "NoClip", false),
NF(f_AltSpeed, "Alt speed", "NoClip", 1.0f), NF(f_AltSpeed, "Alt speed", "NoClip", 1.0f)
NF(f_AltSpeedKey, "Alt Speed Hotkey", "NoClip", Hotkey(ImGuiKey_ModCtrl))
>>>>>>> Stashed changes
{ {
HookManager::install(app::MoleMole_HumanoidMoveFSM_LateTick, HumanoidMoveFSM_LateTick_Hook); HookManager::install(app::MoleMole_HumanoidMoveFSM_LateTick, HumanoidMoveFSM_LateTick_Hook);
@ -59,16 +50,18 @@ namespace cheat::feature
ConfigWidget("No Animation", f_NoAnimation, "Disables player animations."); ConfigWidget("No Animation", f_NoAnimation, "Disables player animations.");
<<<<<<< Updated upstream ConfigWidget("Use Custom Keys", f_UseCustomKeys, "Enable the Use of Custom HotKeys");
=======
ConfigWidget("Forward HotKey", f_ForwardKey, "Set Forward Key"); if (f_UseCustomKeys) {
ConfigWidget("Left HotKey", f_LeftKey, "Set Left Key"); ConfigWidget("Forward HotKey", f_ForwardKey, "Set Forward Key");
ConfigWidget("Back HotKey", f_BackKey, "Set Back Key"); ConfigWidget("Left HotKey", f_LeftKey, "Set Left Key");
ConfigWidget("Right HotKey", f_RightKey, "Set Right Key"); ConfigWidget("Back HotKey", f_BackKey, "Set Back Key");
ConfigWidget("Ascend HotKey", f_AscendKey, "Set Ascend Key"); ConfigWidget("Right HotKey", f_RightKey, "Set Right Key");
ConfigWidget("Descend HotKey", f_DescendKey, "Set Descend Key"); ConfigWidget("Ascend HotKey", f_AscendKey, "Set Ascend Key");
ConfigWidget("Descend HotKey", f_DescendKey, "Set Descend Key");
ConfigWidget("Alt Speed Key", f_AltSpeedKey, "Set AltSpeed HotKey");
}
>>>>>>> Stashed changes
ConfigWidget("Speed", f_Speed, 0.1f, 2.0f, 100.0f, ConfigWidget("Speed", f_Speed, 0.1f, 2.0f, 100.0f,
"No-clip move speed.\n" \ "No-clip move speed.\n" \
"Not recommended setting above 5.0."); "Not recommended setting above 5.0.");
@ -84,8 +77,7 @@ namespace cheat::feature
ConfigWidget("Alt Speed", f_AltSpeed, 0.1f, 2.0f, 100.0f, ConfigWidget("Alt Speed", f_AltSpeed, 0.1f, 2.0f, 100.0f,
"Alternate no-clip move speed.\n" \ "Alternate no-clip move speed.\n" \
"Not recommended setting above 5.0."); "Not recommended setting above 5.0.");
ConfigWidget("Alt Speed Key", f_AltSpeedKey, "Set AltSpeed HotKey");
ConfigWidget("Velocity mode", f_VelocityMode,"Use velocity instead of position to move."); ConfigWidget("Velocity mode", f_VelocityMode,"Use velocity instead of position to move.");
ConfigWidget("Freeflight mode", f_FreeflightMode,"Don't remove collisions"); ConfigWidget("Freeflight mode", f_FreeflightMode,"Don't remove collisions");
} }
@ -157,28 +149,57 @@ namespace cheat::feature
auto relativeEntity = f_CameraRelative ? &cameraEntity : avatarEntity; auto relativeEntity = f_CameraRelative ? &cameraEntity : avatarEntity;
float speed = f_Speed.value(); float speed = f_Speed.value();
if (f_AltSpeedEnabled && f_AltSpeedKey.value().IsPressed()) if (f_AltSpeedEnabled) {
speed = f_AltSpeed.value(); if (!f_UseCustomKeys && Hotkey(ImGuiKey_ModCtrl).IsPressed()) {
speed = f_AltSpeed.value();
}
if (f_UseCustomKeys && f_AltSpeedKey.value().IsPressed()) {
speed = f_AltSpeed.value();
}
}
app::Vector3 dir = {}; app::Vector3 dir = {};
if (f_ForwardKey.value().IsPressed())
dir = dir + relativeEntity->forward();
if (f_BackKey.value().IsPressed()) if (f_UseCustomKeys) {
dir = dir + relativeEntity->back(); if (f_ForwardKey.value().IsPressed())
dir = dir + relativeEntity->forward();
if (f_RightKey.value().IsPressed()) if (f_BackKey.value().IsPressed())
dir = dir + relativeEntity->right(); dir = dir + relativeEntity->back();
if (f_LeftKey.value().IsPressed()) if (f_RightKey.value().IsPressed())
dir = dir + relativeEntity->left(); dir = dir + relativeEntity->right();
if (f_AscendKey.value().IsPressed()) if (f_LeftKey.value().IsPressed())
dir = dir + avatarEntity->up(); dir = dir + relativeEntity->left();
if (f_AscendKey.value().IsPressed())
dir = dir + avatarEntity->up();
if (f_DescendKey.value().IsPressed())
dir = dir + avatarEntity->down();
}
if (!f_UseCustomKeys) {
if (Hotkey(ImGuiKey_W).IsPressed())
dir = dir + relativeEntity->forward();
if (Hotkey(ImGuiKey_S).IsPressed())
dir = dir + relativeEntity->back();
if (Hotkey(ImGuiKey_D).IsPressed())
dir = dir + relativeEntity->right();
if (Hotkey(ImGuiKey_A).IsPressed())
dir = dir + relativeEntity->left();
if (Hotkey(ImGuiKey_Space).IsPressed())
dir = dir + avatarEntity->up();
if (Hotkey(ImGuiKey_ModShift).IsPressed())
dir = dir + avatarEntity->down();
}
if (Hotkey(ImGuiKey_ModShift).IsPressed())
dir = dir + avatarEntity->down();
app::Vector3 prevPos = avatarEntity->relativePosition(); app::Vector3 prevPos = avatarEntity->relativePosition();
if (IsVectorZero(prevPos)) if (IsVectorZero(prevPos))
return; return;

View File

@ -12,16 +12,15 @@ namespace cheat::feature
public: public:
config::Field<config::Toggle<Hotkey>> f_Enabled; config::Field<config::Toggle<Hotkey>> f_Enabled;
config::Field<config::Toggle<Hotkey>> f_NoAnimation; config::Field<config::Toggle<Hotkey>> f_NoAnimation;
<<<<<<< Updated upstream
=======
config::Field<bool> f_UseCustomKeys;
config::Field<Hotkey> f_ForwardKey; config::Field<Hotkey> f_ForwardKey;
config::Field<Hotkey> f_LeftKey; config::Field<Hotkey> f_LeftKey;
config::Field<Hotkey> f_RightKey; config::Field<Hotkey> f_RightKey;
config::Field<Hotkey> f_BackKey; config::Field<Hotkey> f_BackKey;
config::Field<Hotkey> f_AscendKey; config::Field<Hotkey> f_AscendKey;
config::Field<Hotkey> f_DescendKey; config::Field<Hotkey> f_DescendKey;
>>>>>>> Stashed changes config::Field<Hotkey> f_AltSpeedKey;
config::Field<float> f_Speed; config::Field<float> f_Speed;
config::Field<bool> f_CameraRelative; config::Field<bool> f_CameraRelative;
@ -30,7 +29,6 @@ namespace cheat::feature
config::Field<bool> f_AltSpeedEnabled; config::Field<bool> f_AltSpeedEnabled;
config::Field<float> f_AltSpeed; config::Field<float> f_AltSpeed;
config::Field<Hotkey> f_AltSpeedKey;
static NoClip& GetInstance(); static NoClip& GetInstance();