fix glow
This commit is contained in:
@@ -165,6 +165,7 @@
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_AntiTamper.cpp" />
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_CreateMove.cpp" />
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_CreateSwapChain.cpp" />
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_DrawGlow.cpp" />
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_EquipItemInLoadout.cpp" />
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_FireEventClientSide.cpp" />
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_FrameStageNotify.cpp" />
|
||||
@@ -348,6 +349,7 @@
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_AntiTamper.hpp" />
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_CreateMove.hpp" />
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_CreateSwapChain.hpp" />
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_DrawGlow.hpp" />
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_EquipItemInLoadout.hpp" />
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_FireEventClientSide.hpp" />
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_FrameStageNotify.hpp" />
|
||||
|
||||
@@ -124,6 +124,9 @@
|
||||
<Filter Include="Andromeda-CS2-Base\AndromedaClient\Features\CInventoryChanger">
|
||||
<UniqueIdentifier>{fe55cde6-ca84-4245-b799-edaad8c9c80d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual">
|
||||
<UniqueIdentifier>{8c1b7cf4-69bc-41fb-8a38-52d85347e1a2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Andromeda-CS2-Base\DllLauncher.cpp">
|
||||
@@ -450,9 +453,6 @@
|
||||
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\GUI\CAndromedaMenu.cpp">
|
||||
<Filter>Andromeda-CS2-Base\AndromedaClient\GUI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.cpp">
|
||||
<Filter>Andromeda-CS2-Base\AndromedaClient\Features</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Andromeda-CS2-Base\GameClient\CL_Bones.cpp">
|
||||
<Filter>Andromeda-CS2-Base\GameClient</Filter>
|
||||
</ClCompile>
|
||||
@@ -477,6 +477,12 @@
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_EquipItemInLoadout.cpp">
|
||||
<Filter>Andromeda-CS2-Base\CS2\Hook</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.cpp">
|
||||
<Filter>Andromeda-CS2-Base\AndromedaClient\Features\CVisual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Andromeda-CS2-Base\CS2\Hook\Hook_DrawGlow.cpp">
|
||||
<Filter>Andromeda-CS2-Base\CS2\Hook</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Andromeda-CS2-Base\DllLauncher.hpp">
|
||||
@@ -1097,9 +1103,6 @@
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\SDK\Interface\IEngineCvar.hpp">
|
||||
<Filter>Andromeda-CS2-Base\CS2\SDK\Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.hpp">
|
||||
<Filter>Andromeda-CS2-Base\AndromedaClient\Features</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Andromeda-CS2-Base\Common\Base64.h">
|
||||
<Filter>Andromeda-CS2-Base\Common</Filter>
|
||||
</ClInclude>
|
||||
@@ -1130,5 +1133,11 @@
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_EquipItemInLoadout.hpp">
|
||||
<Filter>Andromeda-CS2-Base\CS2\Hook</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Andromeda-CS2-Base\AndromedaClient\Features\CVisual\CVisual.hpp">
|
||||
<Filter>Andromeda-CS2-Base\AndromedaClient\Features\CVisual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Andromeda-CS2-Base\CS2\Hook\Hook_DrawGlow.hpp">
|
||||
<Filter>Andromeda-CS2-Base\CS2\Hook</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+51
-108
@@ -146,105 +146,6 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con
|
||||
}
|
||||
}
|
||||
|
||||
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<C_CSPlayerPawn>();
|
||||
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<BYTE>( VisibleColorVec.x * 255.f ) ,
|
||||
static_cast<BYTE>( VisibleColorVec.y * 255.f ) ,
|
||||
static_cast<BYTE>( VisibleColorVec.z * 255.f ) ,
|
||||
static_cast<BYTE>( VisibleColorVec.w * 255.f )
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlowColor = Color(
|
||||
static_cast<BYTE>( ColorVec.x * 255.f ) ,
|
||||
static_cast<BYTE>( ColorVec.y * 255.f ) ,
|
||||
static_cast<BYTE>( ColorVec.z * 255.f ) ,
|
||||
static_cast<BYTE>( 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<BYTE>( VisibleColorVec.x * 255.f ) ,
|
||||
static_cast<BYTE>( VisibleColorVec.y * 255.f ) ,
|
||||
static_cast<BYTE>( VisibleColorVec.z * 255.f ) ,
|
||||
static_cast<BYTE>( VisibleColorVec.w * 255.f )
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlowColor = Color(
|
||||
static_cast<BYTE>( ColorVec.x * 255.f ) ,
|
||||
static_cast<BYTE>( ColorVec.y * 255.f ) ,
|
||||
static_cast<BYTE>( ColorVec.z * 255.f ) ,
|
||||
static_cast<BYTE>( 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();
|
||||
@@ -276,15 +177,6 @@ auto CVisual::OnCreateMove() -> void
|
||||
auto* pCCSPlayerController = reinterpret_cast<CCSPlayerController*>( pEntity );
|
||||
|
||||
CachedEntity.m_bVisible = GetCL_VisibleCheck()->IsPlayerControllerVisible( pCCSPlayerController );
|
||||
|
||||
if ( Settings::Visual::Glow && pCCSPlayerController->m_bPawnIsAlive() )
|
||||
{
|
||||
auto* pC_CSPlayerPawn = pCCSPlayerController->m_hPawn().Get<C_CSPlayerPawn>();
|
||||
if ( pC_CSPlayerPawn && pC_CSPlayerPawn->IsPlayerPawn() )
|
||||
{
|
||||
ApplyGlow( pC_CSPlayerPawn , CachedEntity.m_bVisible , pCCSPlayerController->m_iTeamNum() );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -293,6 +185,57 @@ auto CVisual::OnCreateMove() -> void
|
||||
}
|
||||
}
|
||||
|
||||
auto CVisual::OnDrawGlow( CGlowProperty* pCGlowProperty ) -> void
|
||||
{
|
||||
if ( Settings::Visual::Active )
|
||||
{
|
||||
auto* pPlayerPawn = reinterpret_cast<C_CSPlayerPawn*>( pCGlowProperty->m_pOwner() );
|
||||
auto* pLocalPlayerPawn = GetCL_Players()->GetLocalPlayerPawn();
|
||||
|
||||
if ( pPlayerPawn && pPlayerPawn->IsPlayerPawn() && pPlayerPawn->IsAlive() && pLocalPlayerPawn && pPlayerPawn != pLocalPlayerPawn )
|
||||
{
|
||||
auto SetGlove = true;
|
||||
auto Visible = GetCL_VisibleCheck()->IsPlayerPawnVisible( pPlayerPawn );
|
||||
|
||||
if ( !Settings::Visual::Team && pPlayerPawn->m_iTeamNum() == pLocalPlayerPawn->m_iTeamNum() )
|
||||
SetGlove = false;
|
||||
|
||||
if ( !Settings::Visual::Enemy && pPlayerPawn->m_iTeamNum() != pLocalPlayerPawn->m_iTeamNum() )
|
||||
SetGlove = false;
|
||||
|
||||
if ( Settings::Visual::OnlyVisible && !Visible )
|
||||
SetGlove = false;
|
||||
|
||||
if ( SetGlove )
|
||||
{
|
||||
auto PlayerColor = Color( 255 , 255 , 255 );
|
||||
|
||||
if ( pPlayerPawn->m_iTeamNum() == TEAM_TT )
|
||||
{
|
||||
PlayerColor = Color( static_cast<int>( Settings::Colors::Visual::GlowTT.x * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowTT.y * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowTT.z * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowTT.w * 255.f ) );
|
||||
|
||||
if ( Visible )
|
||||
PlayerColor = Color( static_cast<int>( Settings::Colors::Visual::GlowTT_Visible.x * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowTT_Visible.y * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowTT_Visible.z * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowTT_Visible.w * 255.f ) );
|
||||
}
|
||||
else if ( pPlayerPawn->m_iTeamNum() == TEAM_CT )
|
||||
{
|
||||
PlayerColor = Color( static_cast<int>( Settings::Colors::Visual::GlowCT.x * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowCT.y * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowCT.z * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowCT.w * 255.f ) );
|
||||
if ( Visible )
|
||||
PlayerColor = Color( static_cast<int>( Settings::Colors::Visual::GlowCT_Visible.x * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowCT_Visible.y * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowCT_Visible.z * 255.f ) , static_cast<int>( Settings::Colors::Visual::GlowCT_Visible.w * 255.f ) );
|
||||
}
|
||||
|
||||
if ( Settings::Visual::Glow )
|
||||
{
|
||||
pCGlowProperty->m_glowColorOverride() = PlayerColor;
|
||||
pCGlowProperty->m_bGlowing() = true;
|
||||
}
|
||||
else
|
||||
pCGlowProperty->m_bGlowing() = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto CVisual::CalculateBoundingBoxes() -> void
|
||||
{
|
||||
if ( !SDK::Interfaces::EngineToClient()->IsInGame() )
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
class CCSPlayerController;
|
||||
class C_CSPlayerPawn;
|
||||
class CGlowProperty;
|
||||
|
||||
class IVisual
|
||||
{
|
||||
@@ -13,6 +14,7 @@ public:
|
||||
virtual void OnRender() = 0;
|
||||
virtual void OnClientOutput() = 0;
|
||||
virtual void OnCreateMove() = 0;
|
||||
virtual void OnDrawGlow( CGlowProperty* pCGlowProperty ) = 0;
|
||||
};
|
||||
|
||||
class CVisual final : public IVisual
|
||||
@@ -21,6 +23,7 @@ public:
|
||||
virtual void OnRender() override;
|
||||
virtual void OnClientOutput() override;
|
||||
virtual void OnCreateMove() override;
|
||||
virtual void OnDrawGlow( CGlowProperty* pCGlowProperty ) override;
|
||||
|
||||
private:
|
||||
enum EVisualBoxType_t : int32_t
|
||||
@@ -34,7 +37,6 @@ 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;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <CS2/Hook/Hook_AntiTamper.hpp>
|
||||
#include <CS2/Hook/Hook_IsLoadoutAllowed.hpp>
|
||||
#include <CS2/Hook/Hook_EquipItemInLoadout.hpp>
|
||||
#include <CS2/Hook/Hook_DrawGlow.hpp>
|
||||
|
||||
static CHook_Loader g_CHook_Loader{};
|
||||
|
||||
@@ -77,6 +78,7 @@ auto CHook_Loader::InstallSecondHook() -> bool
|
||||
{ { XorStr( "Hook::AntiTamper" ) , XorStr( "40 53 41 57 48 83 EC ? 48 89 74 24 ? 48 8B F1" ) , CLIENT_DLL } , &Hook_AntiTamper , reinterpret_cast<LPVOID*>( &AntiTamper_o ) },
|
||||
{ {XorStr("Hook::IsLoadoutAllowed") , XorStr("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B E9 48 8B 0D ? ? ? ? ? ? ? FF 50") , CLIENT_DLL } ,&Hook_IsLoadoutAllowed , reinterpret_cast<LPVOID*>(&IsLoadoutAllowed_o) , true , true } ,
|
||||
{ { XorStr( "Hook::EquipItemInLoadout" ) , XorStr( "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 89 54 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC ? 0F B7 FA" ) , CLIENT_DLL } ,& Hook_EquipItemInLoadout , reinterpret_cast<LPVOID*>( &EquipItemInLoadout_o ) },
|
||||
{ { XorStr( "Hook::DrawGlow" ) , XorStr( "40 53 48 83 EC 20 48 8B 54" ) , CLIENT_DLL } , &Hook_DrawGlow , reinterpret_cast<LPVOID*>( &DrawGlow_o ) },
|
||||
};
|
||||
|
||||
return InstallHooks();
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "Hook_DrawGlow.hpp"
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
#include <CS2/SDK/SDK.hpp>
|
||||
#include <CS2/SDK/Interface/IEngineToClient.hpp>
|
||||
|
||||
#include <AndromedaClient/Features/CVisual/CVisual.hpp>
|
||||
|
||||
auto Hook_DrawGlow( CGlowProperty* pCGlowProperty ) -> void*
|
||||
{
|
||||
auto pResult = DrawGlow_o( pCGlowProperty );
|
||||
|
||||
if ( SDK::Interfaces::EngineToClient()->IsInGame() )
|
||||
GetVisual()->OnDrawGlow( pCGlowProperty );
|
||||
|
||||
return pResult;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/Common.hpp>
|
||||
|
||||
class CGlowProperty;
|
||||
|
||||
auto Hook_DrawGlow( CGlowProperty* pCGlowProperty ) -> void*;
|
||||
|
||||
using DrawGlow_t = decltype( &Hook_DrawGlow );
|
||||
inline DrawGlow_t DrawGlow_o = nullptr;
|
||||
@@ -7,7 +7,7 @@
|
||||
#define CONFIG_FILE "config.json"
|
||||
|
||||
#define CHEAT_NAME "Andromeda CS2 Base"
|
||||
#define CHEAT_VERSION "1.2.1"
|
||||
#define CHEAT_VERSION "1.2.2"
|
||||
|
||||
// Project Buid Config:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user