Fix weapon ESP names (use friendly name table); add Misc features (bhop, no flash, FOV, spectator list, watermark, hitmarker/sound)

This commit is contained in:
2026-08-05 16:25:51 +02:00
parent d7b08444d9
commit 483dd5cb59
11 changed files with 348 additions and 3 deletions
@@ -141,7 +141,8 @@
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CInventoryChanger\CInventoryChanger.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CInventoryChanger\CInventoryItemsManager.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CChams\CChams.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CChams\CChams.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CMisc\CMisc.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Fonts\CFont.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Fonts\CFontManager.cpp" />
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\GUI\CAndromedaMenu.cpp" />
@@ -262,6 +263,7 @@
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CInventoryChanger\CInventoryChanger.hpp" />
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CInventoryChanger\CInventoryItemsManager.hpp" />
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.hpp" />
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CMisc\CMisc.hpp" />
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Fonts\CFont.hpp" />
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Fonts\CFontManager.hpp" />
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\GUI\CAndromedaMenu.hpp" />
@@ -127,6 +127,9 @@
<Filter Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual">
<UniqueIdentifier>{8c1b7cf4-69bc-41fb-8a38-52d85347e1a2}</UniqueIdentifier>
</Filter>
<Filter Include="Andromeda-CS2-Base\AndromedaClient\Features\CMisc">
<UniqueIdentifier>{3d9e5f80-2b7a-4c46-a2f1-9e8b54d1c0b3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Andromeda-CS2-Base\DllLauncher.cpp">
@@ -477,6 +480,9 @@
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.cpp">
<Filter>Andromeda-CS2-Base\AndromedaClient\Features\CVisual</Filter>
</ClCompile>
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CMisc\CMisc.cpp">
<Filter>Andromeda-CS2-Base\AndromedaClient\Features\CMisc</Filter>
</ClCompile>
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_DrawGlow.cpp">
<Filter>Andromeda-CS2-Base\CS2\Hook</Filter>
</ClCompile>
@@ -1130,6 +1136,9 @@
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.hpp">
<Filter>Andromeda-CS2-Base\AndromedaClient\Features\CVisual</Filter>
</ClInclude>
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CMisc\CMisc.hpp">
<Filter>Andromeda-CS2-Base\AndromedaClient\Features\CMisc</Filter>
</ClInclude>
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_DrawGlow.hpp">
<Filter>Andromeda-CS2-Base\CS2\Hook</Filter>
</ClInclude>
@@ -12,6 +12,7 @@
#include <AndromedaClient/Features/CVisual/CVisual.hpp>
#include <AndromedaClient/Features/CChams/CChams.hpp>
#include <AndromedaClient/Features/CInventoryChanger/CInventoryChanger.hpp>
#include <AndromedaClient/Features/CMisc/CMisc.hpp>
#include <GameClient/CEntityCache/CEntityCache.hpp>
@@ -25,11 +26,13 @@ auto CAndromedaClient::OnInit() -> void
auto CAndromedaClient::OnFrameStageNotify( int FrameStage ) -> void
{
GetInventoryChanger()->OnFrameStageNotify( FrameStage );
GetMisc()->OnFrameStageNotify( FrameStage );
}
auto CAndromedaClient::OnFireEventClientSide( IGameEvent* pGameEvent ) -> void
{
GetInventoryChanger()->OnFireEventClientSide( pGameEvent );
GetMisc()->OnFireEventClientSide( pGameEvent );
}
auto CAndromedaClient::OnAddEntity( CEntityInstance* pInst , CHandle handle ) -> void
@@ -48,7 +51,7 @@ auto CAndromedaClient::OnRender() -> void
GetAndromedaMenu()->OnRenderMenu();
GetFontManager()->FirstInitFonts();
GetFontManager()->m_VerdanaFont.DrawString( 1 , 1 , ImColor( 255 , 255 , 0 ) , FW1_LEFT , XorStr( CHEAT_NAME ) );
GetMisc()->OnRender();
if ( SDK::Interfaces::EngineToClient()->IsInGame() )
{
@@ -61,12 +64,14 @@ auto CAndromedaClient::OnClientOutput() -> void
if ( SDK::Interfaces::EngineToClient()->IsInGame() )
{
GetVisual()->OnClientOutput();
GetMisc()->OnClientOutput();
}
}
auto CAndromedaClient::OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void
{
GetVisual()->OnCreateMove();
GetMisc()->OnCreateMove( pInput , pUserCmd );
}
auto GetAndromedaClient() -> CAndromedaClient*
@@ -0,0 +1,227 @@
#include "CMisc.hpp"
#include <cstdio>
#include <ctime>
#include <mmsystem.h>
#pragma comment( lib , "winmm.lib" )
#include <CS2/SDK/SDK.hpp>
#include <CS2/SDK/Interface/IEngineToClient.hpp>
#include <CS2/SDK/Interface/IGameEvent.hpp>
#include <CS2/SDK/Update/CCSGOInput.hpp>
#include <CS2/SDK/Update/CUserCmd.hpp>
#include <CS2/SDK/Types/CEntityData.hpp>
#include <AndromedaClient/Settings/Settings.hpp>
#include <AndromedaClient/Fonts/CFontManager.hpp>
#include <AndromedaClient/Render/CRenderStackSystem.hpp>
#include <GameClient/CL_Players.hpp>
#include <GameClient/CEntityCache/CEntityCache.hpp>
#include <ImGui/imgui.h>
static CMisc g_CMisc{};
auto CMisc::OnRender() -> void
{
if ( !Settings::Misc::Watermark )
return;
const auto t = std::time( nullptr );
std::tm tm{};
localtime_s( &tm , &t );
char szBuffer[ 128 ];
std::snprintf( szBuffer , sizeof szBuffer , XorStr( "Evicted | FPS: %.0f | %02d:%02d:%02d" ) , ImGui::GetIO().Framerate , tm.tm_hour , tm.tm_min , tm.tm_sec );
GetFontManager()->m_VerdanaFont.DrawString( 8 , 8 , ImColor( 255 , 255 , 0 ) , FW1_LEFT , "%s" , szBuffer );
}
auto CMisc::OnClientOutput() -> void
{
if ( !SDK::Interfaces::EngineToClient()->IsInGame() )
return;
if ( Settings::Misc::SpectatorList )
{
auto* pLocalController = GetCL_Players()->GetLocalPlayerController();
auto* pFont = &GetFontManager()->m_VerdanaFont;
if ( pLocalController && pFont )
{
const CHandle LocalPawnHandle = pLocalController->m_hPawn();
const auto DisplaySize = ImGui::GetIO().DisplaySize;
const float ListX = DisplaySize.x - 8.f;
float ListY = pFont->GetFontSize() + 12.f;
const auto& CachedVec = GetEntityCache()->GetCachedEntity();
std::scoped_lock Lock( GetEntityCache()->GetLock() );
for ( const auto& CachedEntity : *CachedVec )
{
if ( CachedEntity.m_Type != CachedEntity_t::PLAYER_CONTROLLER )
continue;
auto* pEntity = CachedEntity.m_Handle.Get();
if ( !pEntity )
continue;
auto* pController = reinterpret_cast<CCSPlayerController*>( pEntity );
if ( pController == pLocalController )
continue;
auto* pPawn = pController->m_hPawn().Get<C_CSPlayerPawn>();
if ( !pPawn || !pPawn->IsPlayerPawn() )
continue;
auto* pObserverServices = pPawn->m_pObserverServices();
if ( !pObserverServices )
continue;
const auto ObserverMode = pObserverServices->m_iObserverMode();
if ( ObserverMode != 4 && ObserverMode != 5 )
continue;
if ( pObserverServices->m_hObserverTarget() != LocalPawnHandle )
continue;
const char* szName = pController->m_sSanitizedPlayerName();
if ( !szName || !szName[ 0 ] )
continue;
GetRenderStackSystem()->DrawString( pFont , ImVec2( ListX , ListY ) , FW1_RIGHT | FW1_TOP , ImColor( 255 , 255 , 255 ) , "%s" , szName );
ListY += pFont->GetFontSize() + 2.f;
}
}
}
if ( Settings::Misc::Hitmarker )
{
if ( m_HitTime.time_since_epoch().count() > 0 )
{
const auto Elapsed = std::chrono::duration<float>( std::chrono::steady_clock::now() - m_HitTime ).count();
if ( Elapsed <= 0.25f )
{
const auto DisplaySize = ImGui::GetIO().DisplaySize;
const ImVec2 Center( DisplaySize.x * 0.5f , DisplaySize.y * 0.5f );
const float Size = 6.f;
GetRenderStackSystem()->DrawLine( ImVec2( Center.x - Size , Center.y - Size ) , ImVec2( Center.x - 2.f , Center.y - 2.f ) , ImColor( 255 , 255 , 255 ) , 1.5f );
GetRenderStackSystem()->DrawLine( ImVec2( Center.x + Size , Center.y - Size ) , ImVec2( Center.x + 2.f , Center.y - 2.f ) , ImColor( 255 , 255 , 255 ) , 1.5f );
GetRenderStackSystem()->DrawLine( ImVec2( Center.x - Size , Center.y + Size ) , ImVec2( Center.x - 2.f , Center.y + 2.f ) , ImColor( 255 , 255 , 255 ) , 1.5f );
GetRenderStackSystem()->DrawLine( ImVec2( Center.x + Size , Center.y + Size ) , ImVec2( Center.x + 2.f , Center.y + 2.f ) , ImColor( 255 , 255 , 255 ) , 1.5f );
}
}
}
}
auto CMisc::OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void
{
if ( !pUserCmd )
return;
if ( Settings::Misc::Bunnyhop )
{
auto* pLocalPawn = GetCL_Players()->GetLocalPlayerPawn();
if ( pLocalPawn && pLocalPawn->IsAlive() )
{
constexpr auto FL_ONGROUND = 1u;
const bool bOnGround = ( pLocalPawn->m_fFlags() & FL_ONGROUND ) != 0;
const bool bHoldingJump = ( pUserCmd->button_states.buttonstate1 & IN_JUMP ) != 0;
if ( bHoldingJump )
{
if ( bOnGround )
pUserCmd->button_states.buttonstate1 |= IN_JUMP;
else
pUserCmd->button_states.buttonstate1 &= ~IN_JUMP;
}
}
}
if ( Settings::Misc::FOVChanger )
{
auto* pLocalPawn = GetCL_Players()->GetLocalPlayerPawn();
if ( pLocalPawn )
{
if ( auto* pCameraServices = pLocalPawn->m_pCameraServices(); pCameraServices )
pCameraServices->m_iFOV() = static_cast<uint32>( Settings::Misc::FOV );
}
}
}
auto CMisc::OnFrameStageNotify( int FrameStage ) -> void
{
if ( FrameStage != 6 )
return;
if ( !Settings::Misc::NoFlash )
return;
auto* pLocalPawn = GetCL_Players()->GetLocalPlayerPawn();
if ( !pLocalPawn )
return;
pLocalPawn->m_flFlashDuration() = 0.f;
pLocalPawn->m_flFlashMaxAlpha() = 0.f;
}
auto CMisc::OnFireEventClientSide( IGameEvent* pGameEvent ) -> void
{
if ( !pGameEvent )
return;
if ( _strcmpi( pGameEvent->GetName() , XorStr( "player_hurt" ) ) != 0 )
return;
auto* pLocalController = GetCL_Players()->GetLocalPlayerController();
if ( !pLocalController )
return;
auto* pAttackerController = pGameEvent->GetPlayerController( XorStr( "attacker" ) );
if ( pAttackerController != pLocalController )
return;
const auto Now = std::chrono::steady_clock::now();
if ( Settings::Misc::Hitmarker )
m_HitTime = Now;
if ( Settings::Misc::HitSound )
{
if ( ( Now - m_HitSoundTime ) > std::chrono::milliseconds( 50 ) )
{
m_HitSoundTime = Now;
PlaySoundW( L"SystemHand" , nullptr , SND_ALIAS | SND_ASYNC | SND_NODEFAULT );
}
}
}
auto GetMisc() -> CMisc*
{
return &g_CMisc;
}
@@ -0,0 +1,35 @@
#pragma once
#include <Common/Common.hpp>
#include <chrono>
class CCSGOInput;
class CUserCmd;
class IGameEvent;
class IMisc
{
public:
virtual void OnRender() = 0;
virtual void OnClientOutput() = 0;
virtual void OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) = 0;
virtual void OnFrameStageNotify( int FrameStage ) = 0;
virtual void OnFireEventClientSide( IGameEvent* pGameEvent ) = 0;
};
class CMisc final : public IMisc
{
public:
virtual void OnRender() override;
virtual void OnClientOutput() override;
virtual void OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) override;
virtual void OnFrameStageNotify( int FrameStage ) override;
virtual void OnFireEventClientSide( IGameEvent* pGameEvent ) override;
private:
std::chrono::steady_clock::time_point m_HitTime{};
std::chrono::steady_clock::time_point m_HitSoundTime{};
};
auto GetMisc() -> CMisc*;
@@ -265,7 +265,7 @@ auto CVisual::GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*
const int iDefIdx = pWeapon->m_AttributeManager()->m_Item()->m_iItemDefinitionIndex();
return GetWeaponDescFromDefinitionIndex( iDefIdx );
return GetWeaponNameFromDefinitionIndex( iDefIdx );
}
auto CVisual::HasBomb( C_CSPlayerPawn* pPawn ) -> bool
@@ -72,6 +72,12 @@ auto CAndromedaMenu::OnRenderMenu() -> void
ImGui::EndTabItem();
}
if ( ImGui::BeginTabItem( "Misc" ) )
{
RenderMiscPanel();
ImGui::EndTabItem();
}
if ( ImGui::BeginTabItem( "Config" ) )
{
RenderConfigPanel();
@@ -321,6 +327,31 @@ auto CAndromedaMenu::RenderMusicPanel() -> void
ImGui::EndChild();
}
auto CAndromedaMenu::RenderMiscPanel() -> void
{
ImGui::SeparatorText( "Movement" );
Checkbox( "Bunnyhop" , Settings::Misc::Bunnyhop );
Checkbox( "No Flash" , Settings::Misc::NoFlash );
ImGui::SeparatorText( "Camera" );
Checkbox( "FOV Changer" , Settings::Misc::FOVChanger );
if ( Settings::Misc::FOVChanger )
SliderInt( "FOV" , Settings::Misc::FOV , 70 , 120 );
ImGui::SeparatorText( "Overlays" );
Checkbox( "Watermark" , Settings::Misc::Watermark );
Checkbox( "Spectator List" , Settings::Misc::SpectatorList );
ImGui::SeparatorText( "Combat Feedback" );
Checkbox( "Hitmarker" , Settings::Misc::Hitmarker );
Checkbox( "Hit Sound" , Settings::Misc::HitSound );
}
auto CAndromedaMenu::RenderConfigPanel() -> void
{
ImGui::SeparatorText( "Menu" );
@@ -15,6 +15,7 @@ private:
auto RenderSkinPanel() -> void;
auto RenderMusicPanel() -> void;
auto RenderConfigPanel() -> void;
auto RenderMiscPanel() -> void;
private:
auto Checkbox( const char* szLabel , bool& bValue ) -> bool;
@@ -41,6 +41,17 @@ namespace Settings
inline auto MenuAlpha = 200;
inline auto MenuStyle = 0;
}
namespace Misc
{
inline auto Bunnyhop = false;
inline auto NoFlash = false;
inline auto FOVChanger = false;
inline auto FOV = 90;
inline auto SpectatorList = false;
inline auto Watermark = true;
inline auto Hitmarker = true;
inline auto HitSound = true;
}
namespace Colors
{
namespace Visual
@@ -114,6 +114,29 @@ auto GetWeaponDescFromDefinitionIndex( int DefinitionIndex ) -> const char*
return "";
}
auto GetWeaponNameFromDefinitionIndex( int DefinitionIndex ) -> const char*
{
for ( size_t i = 0; i < g_WeaponsNames.size(); i++ )
{
if ( g_WeaponsNames[i].m_WeaponDefinitionIndex == DefinitionIndex )
return g_WeaponsNames[i].m_pszName;
}
for ( size_t i = 0; i < g_KnifesNames.size(); i++ )
{
if ( g_KnifesNames[i].m_WeaponDefinitionIndex == DefinitionIndex )
return g_KnifesNames[i].m_pszName;
}
for ( size_t i = 0; i < g_GrenadeNames.size(); i++ )
{
if ( g_GrenadeNames[i].m_WeaponDefinitionIndex == DefinitionIndex )
return g_GrenadeNames[i].m_pszName;
}
return "";
}
auto GetGloveDescFromDefinitionIndex( int DefinitionIndex ) -> const char*
{
for ( size_t i = 0; i < g_GlovesNames.size(); i++ )
@@ -144,6 +144,7 @@ extern std::vector<GrenadeName_t> g_GrenadeNames;
// Weapon Info
auto GetWeaponDescFromDefinitionIndex( int DefinitionIndex ) -> const char*;
auto GetWeaponNameFromDefinitionIndex( int DefinitionIndex ) -> const char*;
auto GetGloveDescFromDefinitionIndex( int DefinitionIndex ) -> const char*;
auto GetKnifeDescFromDefinitionIndex( int DefinitionIndex ) -> const char*;
auto GetKnifeIconNameFromDefinitionIndex( int DefinitionIndex ) -> const char*;