From 1ffde57be6bf953f6b1d5c794c8b06498047fdab Mon Sep 17 00:00:00 2001 From: Erque Date: Mon, 3 Nov 2025 18:38:47 +0300 Subject: [PATCH] ESP + GLOW + MENU --- Andromeda-CS2-Base/Andromeda-CS2-Base.vcxproj | 2 +- .../Features/CVisual/CVisual.cpp | 209 ++++++++++++++++++ .../Features/CVisual/CVisual.hpp | 3 + .../AndromedaClient/GUI/CAndromedaMenu.cpp | 30 ++- .../AndromedaClient/Settings/Settings.hpp | 14 ++ 5 files changed, 256 insertions(+), 2 deletions(-) diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base.vcxproj b/Andromeda-CS2-Base/Andromeda-CS2-Base.vcxproj index d849fa4..6c1494f 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base.vcxproj +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base.vcxproj @@ -127,7 +127,7 @@ Speed MultiThreaded stdcpplatest - stdclatest + stdc17 Windows diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.cpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.cpp index f33a899..56cfb63 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.cpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.cpp @@ -10,6 +10,10 @@ #include #include #include +#include +#include +#include +#include static CVisual g_CVisual{}; @@ -114,9 +118,127 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con else if ( Settings::Visual::PlayerBoxType == EVisualBoxType_t::OUTLINE_COAL_BOX ) GetRenderStackSystem()->DrawOutlineCoalBox( min , max , PlayerColor ); } + + if ( Settings::Visual::BoneESP ) + { + auto ShouldDrawBone = false; + + if ( Settings::Visual::BoneESPTeam && !IsEnemy ) + ShouldDrawBone = true; + + if ( Settings::Visual::BoneESPEnemy && IsEnemy ) + ShouldDrawBone = true; + + if ( Settings::Visual::OnlyVisible && !bVisible ) + ShouldDrawBone = false; + + if ( ShouldDrawBone ) + { + DrawBoneESP( pC_CSPlayerPawn , bVisible , pCCSPlayerController->m_iTeamNum() ); + } + } } } +auto CVisual::ApplyGlow( C_CSPlayerPawn* pC_CSPlayerPawn , const bool bVisible , const int iTeamNum ) -> void +{ + if ( !pC_CSPlayerPawn || !pC_CSPlayerPawn->IsPlayerPawn() ) + return; + + auto IsEnemy = false; + C_CSPlayerPawn* pLocalPawn = nullptr; + + if ( auto* pLocalPlayerController = GetCL_Players()->GetLocalPlayerController(); pLocalPlayerController ) + { + pLocalPawn = pLocalPlayerController->m_hPawn().Get(); + if ( pLocalPawn ) + { + IsEnemy = iTeamNum != pLocalPawn->m_iTeamNum(); + + // Local player'dan glow'u kaldır + if ( pC_CSPlayerPawn == pLocalPawn ) + { + auto& Glow = pC_CSPlayerPawn->m_Glow(); + Glow.m_bGlowing() = false; + return; + } + } + } + + auto DrawGlow = false; + + if ( Settings::Visual::GlowTeam && !IsEnemy ) + DrawGlow = true; + + if ( Settings::Visual::GlowEnemy && IsEnemy ) + DrawGlow = true; + + if ( Settings::Visual::OnlyVisible && !bVisible ) + DrawGlow = false; + + if ( !DrawGlow ) + { + // Glow'u kapat + auto& Glow = pC_CSPlayerPawn->m_Glow(); + Glow.m_bGlowing() = false; + return; + } + + auto GlowColor = Color( 255 , 255 , 255 , 255 ); + + if ( iTeamNum == TEAM_TT ) + { + const auto& ColorVec = Settings::Colors::Visual::GlowTT; + if ( bVisible ) + { + const auto& VisibleColorVec = Settings::Colors::Visual::GlowTT_Visible; + GlowColor = Color( + static_cast( VisibleColorVec.x * 255.f ) , + static_cast( VisibleColorVec.y * 255.f ) , + static_cast( VisibleColorVec.z * 255.f ) , + static_cast( VisibleColorVec.w * 255.f ) + ); + } + else + { + GlowColor = Color( + static_cast( ColorVec.x * 255.f ) , + static_cast( ColorVec.y * 255.f ) , + static_cast( ColorVec.z * 255.f ) , + static_cast( ColorVec.w * 255.f ) + ); + } + } + else if ( iTeamNum == TEAM_CT ) + { + const auto& ColorVec = Settings::Colors::Visual::GlowCT; + if ( bVisible ) + { + const auto& VisibleColorVec = Settings::Colors::Visual::GlowCT_Visible; + GlowColor = Color( + static_cast( VisibleColorVec.x * 255.f ) , + static_cast( VisibleColorVec.y * 255.f ) , + static_cast( VisibleColorVec.z * 255.f ) , + static_cast( VisibleColorVec.w * 255.f ) + ); + } + else + { + GlowColor = Color( + static_cast( ColorVec.x * 255.f ) , + static_cast( ColorVec.y * 255.f ) , + static_cast( ColorVec.z * 255.f ) , + static_cast( ColorVec.w * 255.f ) + ); + } + } + + // Glow'u uygula + auto& Glow = pC_CSPlayerPawn->m_Glow(); + Glow.m_bGlowing() = true; + Glow.m_glowColorOverride() = GlowColor; +} + auto CVisual::OnClientOutput() -> void { OnRender(); @@ -148,6 +270,15 @@ auto CVisual::OnCreateMove() -> void auto* pCCSPlayerController = reinterpret_cast( pEntity ); CachedEntity.m_bVisible = GetCL_VisibleCheck()->IsPlayerControllerVisible( pCCSPlayerController ); + + if ( Settings::Visual::Glow && pCCSPlayerController->m_bPawnIsAlive() ) + { + auto* pC_CSPlayerPawn = pCCSPlayerController->m_hPawn().Get(); + if ( pC_CSPlayerPawn && pC_CSPlayerPawn->IsPlayerPawn() ) + { + ApplyGlow( pC_CSPlayerPawn , CachedEntity.m_bVisible , pCCSPlayerController->m_iTeamNum() ); + } + } } break; default: @@ -192,6 +323,84 @@ auto CVisual::CalculateBoundingBoxes() -> void } } +auto CVisual::DrawBoneESP( C_CSPlayerPawn* pC_CSPlayerPawn , const bool bVisible , const int iTeamNum ) -> void +{ + if ( !pC_CSPlayerPawn || !pC_CSPlayerPawn->IsPlayerPawn() ) + return; + + auto BoneColor = ImColor( 255 , 255 , 255 ); + + if ( iTeamNum == TEAM_TT ) + { + BoneColor = Settings::Colors::Visual::BoneESPTT; + + if ( bVisible ) + BoneColor = Settings::Colors::Visual::BoneESPTT_Visible; + } + else if ( iTeamNum == TEAM_CT ) + { + BoneColor = Settings::Colors::Visual::BoneESPCT; + + if ( bVisible ) + BoneColor = Settings::Colors::Visual::BoneESPCT_Visible; + } + + // Bone connections structure for CS2 skeleton + struct BoneConnection_t + { + const char* szFrom; + const char* szTo; + }; + + static const BoneConnection_t BoneConnections[] = + { + // Head to spine chain + { "head_0" , "neck_0" }, + { "neck_0" , "spine_1" }, + { "spine_1" , "spine_2" }, + { "spine_2" , "spine_3" }, + { "spine_3" , "pelvis" }, + + // Left arm + { "neck_0" , "clavicle_l" }, + { "clavicle_l" , "arm_upper_l" }, + { "arm_upper_l" , "arm_lower_l" }, + { "arm_lower_l" , "hand_l" }, + + // Right arm + { "neck_0" , "clavicle_r" }, + { "clavicle_r" , "arm_upper_r" }, + { "arm_upper_r" , "arm_lower_r" }, + { "arm_lower_r" , "hand_r" }, + + // Left leg + { "pelvis" , "leg_upper_l" }, + { "leg_upper_l" , "leg_lower_l" }, + { "leg_lower_l" , "ankle_l" }, + + // Right leg + { "pelvis" , "leg_upper_r" }, + { "leg_upper_r" , "leg_lower_r" }, + { "leg_lower_r" , "ankle_r" }, + }; + + for ( const auto& Connection : BoneConnections ) + { + const Vector3 FromBone = GetCL_Bones()->GetBonePositionByName( pC_CSPlayerPawn , Connection.szFrom ); + const Vector3 ToBone = GetCL_Bones()->GetBonePositionByName( pC_CSPlayerPawn , Connection.szTo ); + + if ( FromBone.IsZero() || ToBone.IsZero() ) + continue; + + ImVec2 FromScreen , ToScreen; + + if ( Math::WorldToScreen( FromBone , FromScreen ) && Math::WorldToScreen( ToBone , ToScreen ) ) + { + GetRenderStackSystem()->DrawLine( FromScreen , ToScreen , BoneColor , 1.5f ); + } + } +} + auto GetVisual() -> CVisual* { return &g_CVisual; diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.hpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.hpp index 2389fce..1bf9043 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.hpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Features/CVisual/CVisual.hpp @@ -5,6 +5,7 @@ #include class CCSPlayerController; +class C_CSPlayerPawn; class IVisual { @@ -32,6 +33,8 @@ private: }; auto OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , const Rect_t& bBox , const bool bVisible ) -> void; + auto DrawBoneESP( C_CSPlayerPawn* pC_CSPlayerPawn , const bool bVisible , const int iTeamNum ) -> void; + auto ApplyGlow( C_CSPlayerPawn* pC_CSPlayerPawn , const bool bVisible , const int iTeamNum ) -> void; public: auto CalculateBoundingBoxes() -> void; diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp index c834c27..afbf97f 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp @@ -31,6 +31,24 @@ auto CAndromedaMenu::OnRenderMenu() -> void }; RenderComboBox( XorStr( "PlayerBox Type" ) , XorStr( "##Visual.PlayerBoxType" ) , Settings::Visual::PlayerBoxType , PlayerBoxTypeItems , IM_ARRAYSIZE( PlayerBoxTypeItems ) ); + + RenderCheckBox( XorStr( "Bone ESP" ) , XorStr( "##Visual.BoneESP" ) , Settings::Visual::BoneESP ); + if ( Settings::Visual::BoneESP ) + { + ImGui::Indent(); + RenderCheckBox( XorStr( " Bone ESP Team" ) , XorStr( "##Visual.BoneESPTeam" ) , Settings::Visual::BoneESPTeam ); + RenderCheckBox( XorStr( " Bone ESP Enemy" ) , XorStr( "##Visual.BoneESPEnemy" ) , Settings::Visual::BoneESPEnemy ); + ImGui::Unindent(); + } + + RenderCheckBox( XorStr( "Glow" ) , XorStr( "##Visual.Glow" ) , Settings::Visual::Glow ); + if ( Settings::Visual::Glow ) + { + ImGui::Indent(); + RenderCheckBox( XorStr( " Glow Team" ) , XorStr( "##Visual.GlowTeam" ) , Settings::Visual::GlowTeam ); + RenderCheckBox( XorStr( " Glow Enemy" ) , XorStr( "##Visual.GlowEnemy" ) , Settings::Visual::GlowEnemy ); + ImGui::Unindent(); + } } if ( ImGui::CollapsingHeader( XorStr( "Colors" ) ) ) @@ -39,11 +57,21 @@ auto CAndromedaMenu::OnRenderMenu() -> void RenderColorEdit( XorStr( "Player Box TT Visible" ) , XorStr( "##Colors.Visual.PlayerBoxTT_Visible" ) , &Settings::Colors::Visual::PlayerBoxTT_Visible.x ); RenderColorEdit( XorStr( "Player Box CT" ) , XorStr( "##Colors.Visual.PlayerBoxCT" ) , &Settings::Colors::Visual::PlayerBoxCT.x ); RenderColorEdit( XorStr( "Player Box CT Visible" ) , XorStr( "##Colors.Visual.PlayerBoxCT_Visible" ) , &Settings::Colors::Visual::PlayerBoxCT_Visible.x ); + + RenderColorEdit( XorStr( "Bone ESP TT" ) , XorStr( "##Colors.Visual.BoneESPTT" ) , &Settings::Colors::Visual::BoneESPTT.x ); + RenderColorEdit( XorStr( "Bone ESP TT Visible" ) , XorStr( "##Colors.Visual.BoneESPTT_Visible" ) , &Settings::Colors::Visual::BoneESPTT_Visible.x ); + RenderColorEdit( XorStr( "Bone ESP CT" ) , XorStr( "##Colors.Visual.BoneESPCT" ) , &Settings::Colors::Visual::BoneESPCT.x ); + RenderColorEdit( XorStr( "Bone ESP CT Visible" ) , XorStr( "##Colors.Visual.BoneESPCT_Visible" ) , &Settings::Colors::Visual::BoneESPCT_Visible.x ); + + RenderColorEdit( XorStr( "Glow TT" ) , XorStr( "##Colors.Visual.GlowTT" ) , &Settings::Colors::Visual::GlowTT.x ); + RenderColorEdit( XorStr( "Glow TT Visible" ) , XorStr( "##Colors.Visual.GlowTT_Visible" ) , &Settings::Colors::Visual::GlowTT_Visible.x ); + RenderColorEdit( XorStr( "Glow CT" ) , XorStr( "##Colors.Visual.GlowCT" ) , &Settings::Colors::Visual::GlowCT.x ); + RenderColorEdit( XorStr( "Glow CT Visible" ) , XorStr( "##Colors.Visual.GlowCT_Visible" ) , &Settings::Colors::Visual::GlowCT_Visible.x ); } if ( ImGui::CollapsingHeader( XorStr( "Menu" ) ) ) { - RenderSliderInt( XorStr( "Menu Alpha" ) , XorStr( "##Menu.MenuAlpha" ) , Settings::Menu::MenuAlpha , 0 , 255 ); + RenderSliderInt( XorStr( "Menu Alpha" ) , XorStr( "##Menu.MenuAlpha" ) , Settings::Menu::MenuAlpha , 100 , 255 ); const char* MenuStyleItems[] = { diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp index 9614476..bb19c2c 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp @@ -12,6 +12,12 @@ namespace Settings inline auto Enemy = true; inline auto OnlyVisible = false; inline auto PlayerBox = true; + inline auto BoneESP = true; + inline auto BoneESPTeam = true; + inline auto BoneESPEnemy = true; + inline auto Glow = true; + inline auto GlowTeam = true; + inline auto GlowEnemy = true; inline auto PlayerBoxType = 3; } @@ -28,6 +34,14 @@ namespace Settings inline ImVec4 PlayerBoxTT_Visible = { 0 , 1.f , 0.f , 1.f }; inline ImVec4 PlayerBoxCT = { 65.f / 255.f , 200 / 255.f , 255.f / 255.f , 1.f }; inline ImVec4 PlayerBoxCT_Visible = { 0 , 1.f , 0.f , 1.f }; + inline ImVec4 BoneESPTT = { 255.f / 255.f , 75.f / 255.f , 75.f / 255.f , 1.f }; + inline ImVec4 BoneESPTT_Visible = { 0 , 1.f , 0.f , 1.f }; + inline ImVec4 BoneESPCT = { 65.f / 255.f , 200 / 255.f , 255.f / 255.f , 1.f }; + inline ImVec4 BoneESPCT_Visible = { 0 , 1.f , 0.f , 1.f }; + inline ImVec4 GlowTT = { 255.f / 255.f , 75.f / 255.f , 75.f / 255.f , 1.f }; + inline ImVec4 GlowTT_Visible = { 0 , 1.f , 0.f , 1.f }; + inline ImVec4 GlowCT = { 65.f / 255.f , 200 / 255.f , 255.f / 255.f , 1.f }; + inline ImVec4 GlowCT_Visible = { 0 , 1.f , 0.f , 1.f }; } } }