Merge branch 'Akebi-Group:master' into master

This commit is contained in:
hellomykami 2022-07-21 22:06:41 +08:00 committed by GitHub
commit 3d5eb0b0cc
4 changed files with 144 additions and 50 deletions

View File

@ -146,6 +146,59 @@ namespace cheat::feature
return instance; return instance;
} }
void ESP::GetNpcName(std::string& name)
{
if (name.find("Avatar") != std::string::npos)
{
//cause name is like "Avatar_Catalyst_Boy_Heizo(Clone)" - We'll get name between 3rd underscore and 1st bracket
int j = 0; // j is the number of spaces before the name starts
int pos1 = 0;
int pos2 = 0;
for (int i = 0; i < name.length(); i++)
{
if (name[i] == '_')
{
j++;
if (j == 3)
{
pos1 = i;
}
}
if (name[i] == '(')
{
pos2 = i;
break;
}
}
name = name.substr(pos1 + 1, pos2 - pos1 - 1);
}
else
{
int j = 0; //number of underscores in the name
int pos1 = 0; //position of the first underscore in the name
int pos2 = 0; //position of the second underscore in the name
for (int i = 0; i < name.length(); i++)
{
if (name[i] == '_')
{
j++;
if (j == 4)
{
pos1 = i;
}
if (j == 5)
{
pos2 = i;
break;
}
}
}
name = name.substr(pos1 + 1, pos2 - pos1 - 1);
}
return;
}
void ESP::AddFilter(const std::string& section, const std::string& name, game::IEntityFilter* filter) void ESP::AddFilter(const std::string& section, const std::string& name, game::IEntityFilter* filter)
{ {
if (m_Sections.count(section) == 0) if (m_Sections.count(section) == 0)
@ -261,6 +314,14 @@ namespace cheat::feature
if (!entry.m_Enabled || !m_FilterExecutor.ApplyFilter(entity, filter)) if (!entry.m_Enabled || !m_FilterExecutor.ApplyFilter(entity, filter))
continue; continue;
if (entry.m_Name == "Npc" || "AvatarOwn" || "AvatarTeammate")
{
auto name = entity->name();
GetNpcName(name);
esp::render::DrawEntity(name, entity, entry.m_Color, entry.m_ContrastColor);
break;
}
esp::render::DrawEntity(entry.m_Name, entity, entry.m_Color, entry.m_ContrastColor); esp::render::DrawEntity(entry.m_Name, entity, entry.m_Color, entry.m_ContrastColor);
break; break;
} }

View File

@ -79,6 +79,8 @@ namespace cheat::feature
void DrawSection(const std::string& section, const Filters& filters); void DrawSection(const std::string& section, const Filters& filters);
void DrawFilterField(const config::Field<esp::ESPItem>& field); void DrawFilterField(const config::Field<esp::ESPItem>& field);
void GetNpcName(std::string& name);
void OnKeyUp(short key, bool& cancelled); void OnKeyUp(short key, bool& cancelled);
ESP(); ESP();

View File

@ -15,12 +15,21 @@ namespace cheat::feature
NoClip::NoClip() : Feature(), NoClip::NoClip() : Feature(),
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_ForwardKey, "Forward HotKey", "NoClip", Hotkey(ImGuiKey_W)),
NF(f_LeftKey, "Left HotKey", "NoClip", Hotkey(ImGuiKey_A)),
NF(f_BackKey, "Back HotKey", "NoClip", Hotkey(ImGuiKey_S)),
NF(f_RightKey, "Right HotKey", "NoClip", Hotkey(ImGuiKey_D)),
NF(f_AscendKey, "Ascend HotKey", "NoClip", Hotkey(ImGuiKey_Space)),
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)
{ {
HookManager::install(app::MoleMole_HumanoidMoveFSM_LateTick, HumanoidMoveFSM_LateTick_Hook); HookManager::install(app::MoleMole_HumanoidMoveFSM_LateTick, HumanoidMoveFSM_LateTick_Hook);
@ -37,7 +46,7 @@ namespace cheat::feature
void NoClip::DrawMain() void NoClip::DrawMain()
{ {
ConfigWidget("Enabled", f_Enabled, "Enables no-clip (fast speed + no collision).\n" \ ConfigWidget("Enabled", f_Enabled, "Enables no-clip (fast speed + no collision).\n" \
"To move, use WASD, Space (go up), and Shift (go down)."); "To move, use WASD, Space (go up), and Shift (go down), or customize your own keys.");
ConfigWidget("No Animation", f_NoAnimation, "Disables player animations."); ConfigWidget("No Animation", f_NoAnimation, "Disables player animations.");
@ -60,6 +69,18 @@ namespace cheat::feature
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");
} }
ConfigWidget("Use Custom Keys", f_UseCustomKeys, "Enable the Use of Custom HotKeys");
if (f_UseCustomKeys) {
ConfigWidget("Forward HotKey", f_ForwardKey, "Set Forward Key");
ConfigWidget("Left HotKey", f_LeftKey, "Set Left Key");
ConfigWidget("Back HotKey", f_BackKey, "Set Back Key");
ConfigWidget("Right HotKey", f_RightKey, "Set Right 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");
}
} }
bool NoClip::NeedStatusDraw() const bool NoClip::NeedStatusDraw() const
@ -128,26 +149,27 @@ 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 && Hotkey(VK_LCONTROL).IsPressed()) if (f_AltSpeedEnabled ? f_UseCustomKeys ? f_AltSpeedKey.value().IsPressed() : Hotkey(ImGuiKey_ModCtrl).IsPressed() : NULL)
speed = f_AltSpeed.value(); speed = f_AltSpeed.value();
app::Vector3 dir = {}; app::Vector3 dir = {};
if (Hotkey('W').IsPressed())
if (f_UseCustomKeys ? f_ForwardKey.value().IsPressed() : Hotkey(ImGuiKey_W).IsPressed())
dir = dir + relativeEntity->forward(); dir = dir + relativeEntity->forward();
if (Hotkey('S').IsPressed()) if (f_UseCustomKeys ? f_BackKey.value().IsPressed() : Hotkey(ImGuiKey_S).IsPressed())
dir = dir + relativeEntity->back(); dir = dir + relativeEntity->back();
if (Hotkey('D').IsPressed()) if (f_UseCustomKeys ? f_RightKey.value().IsPressed() : Hotkey(ImGuiKey_D).IsPressed())
dir = dir + relativeEntity->right(); dir = dir + relativeEntity->right();
if (Hotkey('A').IsPressed()) if (f_UseCustomKeys ? f_LeftKey.value().IsPressed() : Hotkey(ImGuiKey_A).IsPressed())
dir = dir + relativeEntity->left(); dir = dir + relativeEntity->left();
if (Hotkey(VK_SPACE).IsPressed()) if (f_UseCustomKeys ? f_AscendKey.value().IsPressed() : Hotkey(ImGuiKey_Space).IsPressed())
dir = dir + avatarEntity->up(); dir = dir + avatarEntity->up();
if (Hotkey(ImGuiKey_ModShift).IsPressed()) if (f_UseCustomKeys ? f_DescendKey.value().IsPressed() : Hotkey(ImGuiKey_ModShift).IsPressed())
dir = dir + avatarEntity->down(); dir = dir + avatarEntity->down();
app::Vector3 prevPos = avatarEntity->relativePosition(); app::Vector3 prevPos = avatarEntity->relativePosition();

View File

@ -13,6 +13,15 @@ namespace cheat::feature
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;
config::Field<bool> f_UseCustomKeys;
config::Field<Hotkey> f_ForwardKey;
config::Field<Hotkey> f_LeftKey;
config::Field<Hotkey> f_RightKey;
config::Field<Hotkey> f_BackKey;
config::Field<Hotkey> f_AscendKey;
config::Field<Hotkey> f_DescendKey;
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;
config::Field<config::Toggle<Hotkey>> f_VelocityMode; config::Field<config::Toggle<Hotkey>> f_VelocityMode;