diff --git a/src/gui/im/Im.cpp b/src/gui/im/Im.cpp index b6131498..f99a1f36 100644 --- a/src/gui/im/Im.cpp +++ b/src/gui/im/Im.cpp @@ -8,6 +8,7 @@ #include "Im.hpp" #include "Schema.hpp" #include "Playerlist.hpp" +#include "InfoPanel.hpp" #include "../../common.h" @@ -335,6 +336,10 @@ void Render() { style->Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f); styles_setup = true; } + + // Info panel should be rendered even with main gui disabled + //RenderInfoPanel(); + if (!gui_visible) { ImGui::GetIO().MouseDrawCursor = false; return; @@ -342,8 +347,7 @@ void Render() { ImGui::GetIO().MouseDrawCursor = true; ImGui::SetMouseCursor(ImGuiMouseCursor_Arrow); } - - + //ImGui::ShowTestWindow(); RenderPlayerlist(); /*ImGui::Begin("Colors"); diff --git a/src/gui/im/InfoPanel.cpp b/src/gui/im/InfoPanel.cpp index 50dcc3ec..1f79778e 100644 --- a/src/gui/im/InfoPanel.cpp +++ b/src/gui/im/InfoPanel.cpp @@ -5,4 +5,69 @@ * Author: nullifiedcat */ +/* +#include "../../common.h" +#include "../../cvwrapper.h" +#include "imgui.h" +#include "InfoPanel.hpp" +namespace menu { namespace im { + +// User settings +CatVar enabled(CV_SWITCH, "info_panel_enabled", "0", "Enable Info Panel"); +CatVar aimbot_enabled(CV_SWITCH, "info_panel_aimbot", "0", "Show Aimbot"); +CatVar aimkey_enabled(CV_SWITCH, "info_panel_aimkey_toggle", "0", "Show Aimkey Toggle"); + +// Main ImGui menu creator +void RenderInfoPanel() { + + // Check if info menu is enabled + if (!enabled) return; + + // Check if in-game + if (!g_IEngine->IsInGame()) return; + + // Menu creation stuff pasted from playerlist + if (ImGui::Begin("Info Panel")) { + ImGui::SetWindowSize(ImVec2(0, 0)); + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 1)); + + // The main meat of the info panel + if (aimbot_enabled) AddInfoItem(EInfo::AIMBOT, 169); + if (aimkey_enabled) AddInfoItem(EInfo::AIMKEY, 269); + + + ImGui::PopStyleVar(); + } + ImGui::End(); +} + +// Function to add individual items to menu +void AddInfoItem(EInfo info_type, int id) { + + // Dont know what this does but i just use some numbers with 69 to make it somewhat different + ImGui::PushID(id); + + // Switch based on into_type + switch (info_type) { + case EInfo::AIMBOT: + ImGui::Text(format("Aimbot: ", GetCatVar("aimbot_enabled") ? "enabled" : "disabled").c_str()); + break; + case EInfo::AIMKEY: + ImGui::Text(format("Fak off nagger").c_str()); + break; + }; + + // Dont know what this does but im expecting i would need it + ImGui::PopID(); +} + +// Helper function ripped from schema.cpp due to ussues if i tri to use it directly from there +CatVar* GetCatVar(const std::string name) { + for (auto var : CatVarList()) { + if (var->name == name) return var; + } + return nullptr; +} + +}}*/ \ No newline at end of file diff --git a/src/gui/im/InfoPanel.hpp b/src/gui/im/InfoPanel.hpp index ac574e41..fae5869a 100644 --- a/src/gui/im/InfoPanel.hpp +++ b/src/gui/im/InfoPanel.hpp @@ -4,17 +4,25 @@ * Created on: Jul 7, 2017 * Author: nullifiedcat */ - -#pragma once - +/* #include "../../common.h" +#include "../../sdk.h" namespace menu { namespace im { - -struct infopanel_data { - // std::vector variable_watchlist {}; + +// used to determine what var we need to display +enum class EInfo { + AIMBOT, + AIMKEY }; -void Render(bool ingame); +void RenderInfoPanel(); +void AddInfoItem(EInfo info_type, int id); + -}} +std::string GetBoolString(CatVar* value); +CatVar* GetCatVar(const std::string name); + + + +}}*/ diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index b611ba31..1848ea7c 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -1032,4 +1032,4 @@ void DrawText() { } -}}} \ No newline at end of file +}}} diff --git a/src/hacks/Aimbot.h b/src/hacks/Aimbot.h index 19261622..3931a554 100644 --- a/src/hacks/Aimbot.h +++ b/src/hacks/Aimbot.h @@ -15,13 +15,7 @@ class IClientEntity; namespace hacks { namespace shared { namespace aimbot { -enum class EAimKeyMode { - DISABLED, - PRESS_TO_ENABLE, - PRESS_TO_DISABLE, - PRESS_TO_TOGGLE -}; - +// Used to store aimbot data to prevent calculating it again struct AimbotCalculatedData_s { unsigned long predict_tick { 0 }; Vector aim_position { 0 }; @@ -30,24 +24,25 @@ struct AimbotCalculatedData_s { float fov { 0 }; int hitbox { 0 }; }; - -// Variable used to tell when the aimbot has found a target -extern bool foundTarget; - + +// Functions used to calculate aimbot data, and if already calculated use it const Vector& PredictEntity(CachedEntity* entity); bool VischeckPredictedEntity(CachedEntity* entity); + +// Variable used to tell when the aimbot has found a target +extern bool foundTarget; + +// Used by esp to set their color +extern int target_eid; + + // Functions called by other functions for when certian game calls are run void CreateMove(); void DrawText(); void Reset(); -// Used by esp to set their color -extern int target_eid; - -float EffectiveTargetingRange(); - - +// Stuff to make storing functions easy CachedEntity* CurrentTarget(); bool ShouldAim(); CachedEntity* RetrieveBestTarget(bool aimkey_state); @@ -59,6 +54,7 @@ int ClosestHitbox(CachedEntity* target); void slowAim(Vector &inputAngle, Vector userAngle); bool UpdateAimkey(); bool GetCanAim(int mode); +float EffectiveTargetingRange(); }}} diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 0bcb8d62..aa6807a4 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -53,6 +53,8 @@ float idle_time = 0; // An array for storing the breadcrumbs static Vector breadcrumbs [64]; +// Int for storing length of array +constexpr int MAX_CRUMBS = 64; // Array Bookkeeping vars int crumbBottom = 0; int crumbTop = 0; @@ -145,11 +147,8 @@ void DoWalking() { } else { best_target = target_priority; } - - - } - // Doesnt work for some reason, FIX!!! + // If we cant use steam id target, try someone else if (roaming && CE_BAD(best_target)) { @@ -647,7 +646,7 @@ void CrumbReset() { void CrumbTopAdd(Vector crumbToAdd) { // Once the crumbs have hit the limit of the array, loop around and over write unused spots - if (crumbTop == 64) { + if (crumbTop == MAX_CRUMBS) { crumbTop = 0; } else { // Else, bump the top number market of the array @@ -660,7 +659,7 @@ void CrumbTopAdd(Vector crumbToAdd) { logging::Info("Crumb Top add"); // The array can only hold so many crumbs, once it goes over its cap, stop the bot to prevent un-needed movement - if (crumbArrayLength > 64) { + if (crumbArrayLength > MAX_CRUMBS) { CrumbReset(); crumbStopped = true; logging::Info("Crumb Overload!\nDumping array"); @@ -671,7 +670,7 @@ void CrumbTopAdd(Vector crumbToAdd) { void CrumbBottomAdd() { // Once the crumbs have hit the limit of the array, loop around and over write unused spots - if (crumbBottom == 64) { + if (crumbBottom == MAX_CRUMBS) { crumbBottom = 0; } else { // Else, bump the top number market of the array @@ -756,10 +755,10 @@ void DrawFollowbot() { tmpCrumb2 = crumbBottom + i + 1; // Correction for array numbers when one goes over our limit - if (tmpCrumb1 >= 64) - tmpCrumb1 - 64; - if (tmpCrumb2 >= 64) - tmpCrumb1 - 64; + if (tmpCrumb1 >= MAX_CRUMBS) + tmpCrumb1 - MAX_CRUMBS; + if (tmpCrumb2 >= MAX_CRUMBS) + tmpCrumb1 - MAX_CRUMBS; // Take our 2 crumbs and get a position on the screen draw::WorldToScreen(breadcrumbs[tmpCrumb1], scnSrt); @@ -804,10 +803,10 @@ void DrawFollowbot() { tmpCrumb2 = crumbBottom + i + 1; // Correction for array numbers when one goes over our limit - if (tmpCrumb1 >= 64) - tmpCrumb1 - 64; - if (tmpCrumb2 >= 64) - tmpCrumb2 - 64; + if (tmpCrumb1 >= MAX_CRUMBS) + tmpCrumb1 - MAX_CRUMBS; + if (tmpCrumb2 >= MAX_CRUMBS) + tmpCrumb2 - MAX_CRUMBS; // Take our 2 crumbs and get a position on the screen draw::WorldToScreen(breadcrumbs[tmpCrumb1], scnSrt);