Add Name/Weapon/Bomb ESP with menu toggles; add chams diagnostics

This commit is contained in:
2026-08-05 16:08:53 +02:00
parent b0603cd8a9
commit 4cea078340
5 changed files with 143 additions and 17 deletions
@@ -136,6 +136,8 @@ auto CChams::CreateMaterials() -> void
if ( !m_pMaterialInvisible )
m_pMaterialInvisible = CreateMaterial( "chams_invisible" , szVMatInvisible );
DEV_LOG( "[Chams] CreateMaterials: visible=%p invisible=%p\n" , (void*)m_pMaterialVisible , (void*)m_pMaterialInvisible );
}
auto CChams::OnDrawObject( void* pAnimatableSceneObjectDesc , void* pDx11 , void* pMeshData , int nDataCount , void* pSceneView , void* pSceneLayer , void* pUnk , void* pUnk2 ) -> bool
@@ -151,6 +153,17 @@ auto CChams::OnDrawObject( void* pAnimatableSceneObjectDesc , void* pDx11 , void
if ( !pLocalPawn )
return false;
{
static bool bLogged = false;
if ( !bLogged )
{
bLogged = true;
DEV_LOG( "[Chams] OnDrawObject fired: meshData=%p count=%d IsReady=%d\n" , pMeshData , nDataCount , IsReady() ? 1 : 0 );
}
}
const auto* pBytes = static_cast<const uint8_t*>( pMeshData );
for ( int i = 0; i < nDataCount; i++ )
@@ -176,6 +189,17 @@ auto CChams::OnDrawObject( void* pAnimatableSceneObjectDesc , void* pDx11 , void
if ( pPawn->m_iTeamNum() == pLocalPawn->m_iTeamNum() )
continue;
{
static bool bLoggedMatch = false;
if ( !bLoggedMatch )
{
bLoggedMatch = true;
DEV_LOG( "[Chams] matched enemy mesh entry %d\n" , i );
}
}
auto* pWN = const_cast<uint8_t*>( pEntry );
if ( Settings::Chams::IgnoreZ )
@@ -11,10 +11,13 @@
#include <GameClient/CL_Players.hpp>
#include <GameClient/CL_VisibleCheck.hpp>
#include <GameClient/CL_Bones.hpp>
#include <GameClient/CL_ItemDefinition.hpp>
#include <CS2/SDK/Math/Math.hpp>
#include <CS2/SDK/Types/CEntityData.hpp>
#include <CS2/SDK/Types/Color.hpp>
#include <AndromedaClient/Fonts/CFontManager.hpp>
static CVisual g_CVisual{};
auto CVisual::OnRender() -> void
@@ -96,25 +99,25 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con
if ( Draw )
{
auto PlayerColor = ImColor( 255 , 255 , 255 );
if ( pCCSPlayerController->m_iTeamNum() == TEAM_TT )
{
PlayerColor = Settings::Colors::Visual::PlayerBoxTT;
if ( bVisible )
PlayerColor = Settings::Colors::Visual::PlayerBoxTT_Visible;
}
else if ( pCCSPlayerController->m_iTeamNum() == TEAM_CT )
{
PlayerColor = Settings::Colors::Visual::PlayerBoxCT;
if ( bVisible )
PlayerColor = Settings::Colors::Visual::PlayerBoxCT_Visible;
}
if ( Settings::Visual::PlayerBox )
{
auto PlayerColor = ImColor( 255 , 255 , 255 );
if ( pCCSPlayerController->m_iTeamNum() == TEAM_TT )
{
PlayerColor = Settings::Colors::Visual::PlayerBoxTT;
if ( bVisible )
PlayerColor = Settings::Colors::Visual::PlayerBoxTT_Visible;
}
else if ( pCCSPlayerController->m_iTeamNum() == TEAM_CT )
{
PlayerColor = Settings::Colors::Visual::PlayerBoxCT;
if ( bVisible )
PlayerColor = Settings::Colors::Visual::PlayerBoxCT_Visible;
}
if ( Settings::Visual::PlayerBoxType == EVisualBoxType_t::BOX )
GetRenderStackSystem()->DrawBox( min , max , PlayerColor );
else if ( Settings::Visual::PlayerBoxType == EVisualBoxType_t::OUTLINE_BOX )
@@ -151,9 +154,92 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con
DrawBoneESP( pC_CSPlayerPawn , bVisible , pCCSPlayerController->m_iTeamNum() );
}
}
OnRenderPlayerText( pCCSPlayerController , pC_CSPlayerPawn , min , max , PlayerColor , bVisible );
}
}
auto CVisual::OnRenderPlayerText( CCSPlayerController* pCCSPlayerController , C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax , const ImColor& PlayerColor , const bool bVisible ) -> void
{
auto* pFont = &GetFontManager()->m_VerdanaFont;
if ( !pFont )
return;
const float CenterX = ( BoxMin.x + BoxMax.x ) * 0.5f;
if ( Settings::Visual::NameESP )
{
const char* szName = pCCSPlayerController->m_sSanitizedPlayerName();
if ( szName && szName[ 0 ] )
GetRenderStackSystem()->DrawString( pFont , ImVec2( CenterX , BoxMin.y - pFont->GetFontSize() - 6.f ) , FW1_CENTER | FW1_TOP , PlayerColor , "%s" , szName );
}
if ( Settings::Visual::WeaponESP )
{
const char* szWeapon = GetPlayerWeaponName( pPawn );
if ( szWeapon && szWeapon[ 0 ] )
GetRenderStackSystem()->DrawString( pFont , ImVec2( CenterX , BoxMax.y + 4.f ) , FW1_CENTER | FW1_TOP , ImColor( 255 , 255 , 255 ) , "%s" , szWeapon );
}
if ( Settings::Visual::BombESP && HasBomb( pPawn ) )
{
const float BombY = BoxMax.y + ( Settings::Visual::WeaponESP ? pFont->GetFontSize() + 9.f : 4.f );
GetRenderStackSystem()->DrawString( pFont , ImVec2( CenterX , BombY ) , FW1_CENTER | FW1_TOP , ImColor( 255 , 80 , 80 ) , "[BOMB]" );
}
}
auto CVisual::GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*
{
if ( !pPawn || !pPawn->m_pWeaponServices() )
return "";
auto* pWeaponServices = pPawn->m_pWeaponServices();
const auto& hActiveWeapon = pWeaponServices->m_hActiveWeapon();
if ( !hActiveWeapon.IsValid() )
return "";
auto* pWeapon = hActiveWeapon.Get<C_CSWeaponBase>();
if ( !pWeapon )
return "";
const int iDefIdx = pWeapon->m_AttributeManager()->m_Item()->m_iItemDefinitionIndex();
return GetWeaponDescFromDefinitionIndex( iDefIdx );
}
auto CVisual::HasBomb( C_CSPlayerPawn* pPawn ) -> bool
{
if ( !pPawn || !pPawn->m_pWeaponServices() )
return false;
auto* pWeaponServices = pPawn->m_pWeaponServices();
for ( int i = 0; i < pWeaponServices->m_hMyWeapons().Count(); i++ )
{
const auto& hWeapon = pWeaponServices->m_hMyWeapons()[ i ];
if ( !hWeapon.IsValid() )
continue;
auto* pWeapon = hWeapon.Get<C_CSWeaponBase>();
if ( !pWeapon )
continue;
if ( pWeapon->m_AttributeManager()->m_Item()->m_iItemDefinitionIndex() == WEAPON_C4_EXPLOSIVE )
return true;
}
return false;
}
auto CVisual::OnClientOutput() -> void
{
OnRender();
@@ -1,6 +1,7 @@
#pragma once
#include <Common/Common.hpp>
#include <ImGui/imgui.h>
#include <CS2/SDK/Math/Rect_t.hpp>
@@ -38,6 +39,9 @@ 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 OnRenderPlayerText( CCSPlayerController* pCCSPlayerController , C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax , const ImColor& PlayerColor , const bool bVisible ) -> void;
auto GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*;
auto HasBomb( C_CSPlayerPawn* pPawn ) -> bool;
public:
auto CalculateBoundingBoxes() -> void;
@@ -292,6 +292,14 @@ auto CAndromedaMenu::RenderVisualPanel() -> void
EndPanel();
BeginPanel( "Player Info" );
Toggle( "Name ESP" , "##Visual.NameESP" , Settings::Visual::NameESP );
Toggle( "Weapon ESP" , "##Visual.WeaponESP" , Settings::Visual::WeaponESP );
Toggle( "Bomb ESP" , "##Visual.BombESP" , Settings::Visual::BombESP );
EndPanel();
BeginPanel( "Player Box" );
Toggle( "Player Box" , "##Visual.PlayerBox" , Settings::Visual::PlayerBox );
@@ -19,6 +19,10 @@ namespace Settings
inline auto GlowTeam = true;
inline auto GlowEnemy = true;
inline auto NameESP = true;
inline auto WeaponESP = true;
inline auto BombESP = true;
inline auto PlayerBoxType = 3;
inline auto GlassyBox = false;
inline auto GlassOpacity = 55;