Add Health/Armor ESP bars; rebuild menu with standard ImGui look

This commit is contained in:
2026-08-05 16:14:13 +02:00
parent 4cea078340
commit d7b08444d9
5 changed files with 151 additions and 401 deletions
@@ -1,5 +1,7 @@
#include "CVisual.hpp" #include "CVisual.hpp"
#include <algorithm>
#include <CS2/SDK/SDK.hpp> #include <CS2/SDK/SDK.hpp>
#include <CS2/SDK/Interface/IEngineToClient.hpp> #include <CS2/SDK/Interface/IEngineToClient.hpp>
@@ -155,10 +157,62 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con
} }
} }
if ( Settings::Visual::HealthESP || Settings::Visual::ArmorESP )
OnRenderHealthBars( pC_CSPlayerPawn , min , max );
OnRenderPlayerText( pCCSPlayerController , pC_CSPlayerPawn , min , max , PlayerColor , bVisible ); OnRenderPlayerText( pCCSPlayerController , pC_CSPlayerPawn , min , max , PlayerColor , bVisible );
} }
} }
auto CVisual::OnRenderHealthBars( C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax ) -> void
{
if ( !pPawn )
return;
const float BarWidth = 5.f;
const float Spacing = 3.f;
const float BarHeight = ( BoxMax.y - BoxMin.y );
float x = BoxMin.x - BarWidth - Spacing;
if ( Settings::Visual::ArmorESP )
x -= BarWidth + Spacing;
auto DrawBar = [ & ]( const float bx , const float Value , const float MaxValue , const ImColor& Color )
{
const float Ratio = std::clamp( MaxValue > 0.f ? Value / MaxValue : 0.f , 0.f , 1.f );
GetRenderStackSystem()->DrawFillBox( ImVec2( bx - 1.f , BoxMin.y - 1.f ) , ImVec2( bx + BarWidth + 1.f , BoxMax.y + 1.f ) , ImColor( 0 , 0 , 0 , 190 ) );
const float FillY = BoxMax.y - BarHeight * Ratio;
GetRenderStackSystem()->DrawFillBox( ImVec2( bx , FillY ) , ImVec2( bx + BarWidth , BoxMax.y ) , Color );
};
if ( Settings::Visual::HealthESP )
{
const float Health = static_cast<float>( pPawn->m_iHealth() );
const float MaxHealth = static_cast<float>( pPawn->m_iMaxHealth() );
const float Ratio = std::clamp( MaxHealth > 0.f ? Health / MaxHealth : 0.f , 0.f , 1.f );
const ImColor HealthColor(
static_cast<int>( 255.f * ( 1.f - Ratio ) ) ,
static_cast<int>( 255.f * Ratio ) ,
0 );
DrawBar( x , Health , MaxHealth , HealthColor );
x += BarWidth + Spacing;
}
if ( Settings::Visual::ArmorESP )
{
const float Armor = static_cast<float>( pPawn->m_ArmorValue() );
DrawBar( x , Armor , 100.f , ImColor( 80 , 180 , 255 ) );
}
}
auto CVisual::OnRenderPlayerText( CCSPlayerController* pCCSPlayerController , C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax , const ImColor& PlayerColor , const bool bVisible ) -> void 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; auto* pFont = &GetFontManager()->m_VerdanaFont;
@@ -40,6 +40,7 @@ private:
auto OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , const Rect_t& bBox , const bool bVisible ) -> void; 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 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 OnRenderPlayerText( CCSPlayerController* pCCSPlayerController , C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax , const ImColor& PlayerColor , const bool bVisible ) -> void;
auto OnRenderHealthBars( C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax ) -> void;
auto GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*; auto GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*;
auto HasBomb( C_CSPlayerPawn* pPawn ) -> bool; auto HasBomb( C_CSPlayerPawn* pPawn ) -> bool;
@@ -11,41 +11,6 @@
static CAndromedaMenu g_CAndromedaMenu{}; static CAndromedaMenu g_CAndromedaMenu{};
namespace
{
auto AccentU32( const ImVec4& Accent ) -> ImU32
{
return ImGui::ColorConvertFloat4ToU32( Accent );
}
// Public-API toggle switch, drawn as a rounded pill.
bool ToggleSwitch( const char* szID , bool* pbValue , const ImVec4& Accent )
{
const float Height = ImGui::GetFrameHeight();
const float Width = Height * 1.9f;
const ImVec2 Pos = ImGui::GetCursorScreenPos();
const bool bClicked = ImGui::InvisibleButton( szID , ImVec2( Width , Height ) );
ImDrawList* pDraw = ImGui::GetWindowDrawList();
const ImU32 Track = *pbValue ? AccentU32( Accent ) : IM_COL32( 255 , 255 , 255 , 22 );
pDraw->AddRectFilled( Pos , Pos + ImVec2( Width , Height ) , Track , Height * 0.5f );
const float KnobSize = Height - 6.f;
const float KnobX = *pbValue ? ( Pos.x + Width - KnobSize - 3.f ) : ( Pos.x + 3.f );
pDraw->AddCircleFilled( ImVec2( KnobX + KnobSize * 0.5f , Pos.y + Height * 0.5f ) , KnobSize * 0.5f , IM_COL32( 255 , 255 , 255 , 235 ) );
if ( bClicked )
*pbValue = !*pbValue;
return bClicked;
}
}
auto CAndromedaMenu::GetUIScale() -> float auto CAndromedaMenu::GetUIScale() -> float
{ {
float Scale = ImGui::GetIO().DisplaySize.y / 1080.f; float Scale = ImGui::GetIO().DisplaySize.y / 1080.f;
@@ -65,39 +30,10 @@ auto CAndromedaMenu::OnRenderMenu() -> void
ImGui::GetIO().FontGlobalScale = m_fUIScale; ImGui::GetIO().FontGlobalScale = m_fUIScale;
const float MenuAlpha = static_cast<float>( Settings::Menu::MenuAlpha ) / 255.f;
ImGui::PushStyleVar( ImGuiStyleVar_Alpha , MenuAlpha );
ImGui::PushStyleColor( ImGuiCol_WindowBg , IM_COL32( 19 , 20 , 24 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_ChildBg , IM_COL32( 0 , 0 , 0 , 0 ) );
ImGui::PushStyleColor( ImGuiCol_FrameBg , IM_COL32( 40 , 42 , 50 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_FrameBgHovered , IM_COL32( 50 , 53 , 63 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_FrameBgActive , IM_COL32( 58 , 61 , 73 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_CheckMark , m_Accent );
ImGui::PushStyleColor( ImGuiCol_SliderGrab , m_Accent );
ImGui::PushStyleColor( ImGuiCol_SliderGrabActive , m_Accent );
ImGui::PushStyleColor( ImGuiCol_Button , IM_COL32( 45 , 48 , 58 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_ButtonHovered , IM_COL32( 55 , 59 , 72 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_ButtonActive , m_Accent );
ImGui::PushStyleColor( ImGuiCol_Header , m_Accent );
ImGui::PushStyleColor( ImGuiCol_HeaderHovered , IM_COL32( 60 , 45 , 58 , 255 ) );
ImGui::PushStyleColor( ImGuiCol_HeaderActive , IM_COL32( 70 , 48 , 62 , 255 ) );
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding , ImVec2( 8.f , 8.f ) );
ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding , 8.f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize , 0.f );
ImGui::PushStyleVar( ImGuiStyleVar_FrameRounding , 4.f );
ImGui::PushStyleVar( ImGuiStyleVar_ItemSpacing , ImVec2( 8.f , 6.f ) );
const ImVec2 DisplaySize = ImGui::GetIO().DisplaySize; const ImVec2 DisplaySize = ImGui::GetIO().DisplaySize;
float MenuW = 1120.f * m_fUIScale; float MenuW = 720.f * m_fUIScale;
float MenuH = 640.f * m_fUIScale; float MenuH = 560.f * m_fUIScale;
if ( MenuW > DisplaySize.x - 16.f ) if ( MenuW > DisplaySize.x - 16.f )
MenuW = DisplaySize.x - 16.f; MenuW = DisplaySize.x - 16.f;
@@ -108,208 +44,74 @@ auto CAndromedaMenu::OnRenderMenu() -> void
ImGui::SetNextWindowSize( ImVec2( MenuW , MenuH ) , ImGuiCond_Always ); ImGui::SetNextWindowSize( ImVec2( MenuW , MenuH ) , ImGuiCond_Always );
ImGui::SetNextWindowPos( ImVec2( ( DisplaySize.x - MenuW ) * 0.5f , ( DisplaySize.y - MenuH ) * 0.5f ) , ImGuiCond_Always ); ImGui::SetNextWindowPos( ImVec2( ( DisplaySize.x - MenuW ) * 0.5f , ( DisplaySize.y - MenuH ) * 0.5f ) , ImGuiCond_Always );
if ( ImGui::Begin( XorStr( "Evicted" ) , nullptr , ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar ) ) if ( ImGui::Begin( XorStr( "Evicted" ) , nullptr , ImGuiWindowFlags_NoCollapse ) )
{ {
RenderSidebar(); if ( ImGui::BeginTabBar( "##MainTabs" ) )
ImGui::SameLine( 0.f , 0.f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding , ImVec2( 18.f , 16.f ) );
if ( ImGui::BeginChild( "##Content" , ImVec2( 0.f , 0.f ) , false ) )
{ {
switch ( m_iSelectedTab ) if ( ImGui::BeginTabItem( "Visuals" ) )
{ {
case TAB_VISUALS: RenderVisualPanel(); break; RenderVisualPanel();
case TAB_GLOW: RenderGlowPanel(); break; ImGui::EndTabItem();
case TAB_SKINS: RenderSkinPanel(); break;
case TAB_MUSIC: RenderMusicPanel(); break;
case TAB_CONFIG: RenderConfigPanel(); break;
default: break;
}
} }
ImGui::EndChild(); if ( ImGui::BeginTabItem( "Glow & Chams" ) )
{
RenderGlowPanel();
ImGui::EndTabItem();
}
ImGui::PopStyleVar(); if ( ImGui::BeginTabItem( "Skins" ) )
{
RenderSkinPanel();
ImGui::EndTabItem();
}
if ( ImGui::BeginTabItem( "Music Kit" ) )
{
RenderMusicPanel();
ImGui::EndTabItem();
}
if ( ImGui::BeginTabItem( "Config" ) )
{
RenderConfigPanel();
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
} }
ImGui::End(); ImGui::End();
ImGui::PopStyleVar();
ImGui::PopStyleVar();
ImGui::PopStyleVar();
ImGui::PopStyleVar();
ImGui::PopStyleVar();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleColor();
ImGui::PopStyleVar();
}
auto CAndromedaMenu::RenderSidebar() -> void
{
const float S = m_fUIScale;
const ImVec2 Avail = ImGui::GetContentRegionAvail();
ImDrawList* pDraw = ImGui::GetWindowDrawList();
const ImVec2 WinMin = ImGui::GetWindowPos();
const ImVec2 SidebarMax = WinMin + ImVec2( 210.f * S , Avail.y + 16.f );
pDraw->AddRectFilled( WinMin , SidebarMax , IM_COL32( 25 , 26 , 32 , 255 ) , 8.f );
if ( ImGui::BeginChild( "##Sidebar" , ImVec2( 210.f * S , Avail.y ) , false ) )
{
const float HeaderHeight = 92.f * S;
const ImVec2 HeaderMin = ImGui::GetCursorScreenPos();
const ImVec2 HeaderMax = HeaderMin + ImVec2( 210.f * S , HeaderHeight );
pDraw->AddRectFilled( HeaderMin , HeaderMax , AccentU32( m_Accent ) , 8.f );
pDraw->AddRectFilled( ImVec2( HeaderMax.x - 60.f * S , HeaderMin.y ) , HeaderMax , IM_COL32( 0 , 0 , 0 , 18 ) , 8.f );
pDraw->AddRectFilled( ImVec2( HeaderMin.x , HeaderMax.y - 22.f * S ) , HeaderMax , IM_COL32( 0 , 0 , 0 , 40 ) );
ImFont* pIcon = GetAndromedaGUI()->GetIconFont();
ImFont* pBold = GetAndromedaGUI()->GetBoldSegoeFont();
const char* szLogoIcon = "?";
const char* szLogoText = "EVI CTED";
const char* szSubText = "ANDROMEDA";
const float IconW = pIcon->CalcTextSizeA( 34.f * S , FLT_MAX , 0.f , szLogoIcon ).x;
ImGui::SetCursorScreenPos( ImVec2( HeaderMin.x + 18.f * S , HeaderMin.y + 20.f * S ) );
ImGui::PushFont( pIcon );
ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.95f ) , "%s" , szLogoIcon );
ImGui::PopFont();
ImGui::SameLine( 0.f , 10.f * S );
ImGui::PushFont( pBold );
ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 1.f ) , "%s" , szLogoText );
ImGui::PopFont();
ImGui::SameLine( 0.f , 8.f * S );
ImFont* pSeg = GetAndromedaGUI()->GetSegoeFont();
ImGui::PushFont( pSeg );
ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.85f ) , "%s" , szSubText );
ImGui::PopFont();
ImGui::SetCursorScreenPos( ImVec2( HeaderMin.x + 18.f * S , HeaderMin.y + 52.f * S ) );
ImGui::Dummy( ImVec2( 0.f , 34.f * S ) );
ImGui::SetCursorPosX( 4.f * S );
const ImVec2 TabSize( 202.f * S , 40.f * S );
TabButton( "I" , "Visuals" , TAB_VISUALS , TabSize );
TabButton( "P" , "Glow & Chams" , TAB_GLOW , TabSize );
TabButton( "T" , "Skins" , TAB_SKINS , TabSize );
TabButton( "N" , "Music Kit" , TAB_MUSIC , TabSize );
TabButton( "S" , "Config" , TAB_CONFIG , TabSize );
ImGui::SetCursorPosY( ImGui::GetCursorPosY() + 6.f * S );
ImGui::Separator();
ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.35f ) , "%s" , " Insert to close" );
}
ImGui::EndChild();
}
auto CAndromedaMenu::TabButton( const char* szIcon , const char* szLabel , const int iTab , const ImVec2& Size ) -> void
{
const bool bSelected = ( m_iSelectedTab == iTab );
const ImVec2 Pos = ImGui::GetCursorScreenPos();
const ImVec2 Max = Pos + Size;
char szID[ 32 ];
std::snprintf( szID , sizeof szID , "##tab_%d" , iTab );
ImGui::InvisibleButton( szID , Size );
const bool bHovered = ImGui::IsItemHovered();
const bool bClicked = ImGui::IsItemClicked();
if ( bClicked )
m_iSelectedTab = iTab;
ImDrawList* pDraw = ImGui::GetWindowDrawList();
ImU32 Bg = IM_COL32( 0 , 0 , 0 , 0 );
if ( bSelected )
Bg = AccentU32( m_Accent );
else if ( bHovered )
Bg = IM_COL32( 255 , 255 , 255 , 16 );
pDraw->AddRectFilled( Pos , Max , Bg , 6.f );
const float TextColorOn = bSelected ? 1.f : 0.45f;
ImFont* pIcon = GetAndromedaGUI()->GetIconFont();
ImFont* pText = GetAndromedaGUI()->GetDefaultFont();
const float S = m_fUIScale;
const ImVec2 Icon( Pos.x + 14.f * S , Pos.y + ( Size.y - 26.f * S ) * 0.5f );
pDraw->AddText( pIcon , 26.f * S , Icon , IM_COL32( 255 , 255 , 255 , (int)( TextColorOn * 255.f ) ) , szIcon );
const float IconW = pIcon->CalcTextSizeA( 26.f * S , FLT_MAX , 0.f , szIcon ).x;
pDraw->AddText( pText , pText->FontSize * S , ImVec2( Icon.x + IconW + 12.f * S , Pos.y + ( Size.y - pText->FontSize * S ) * 0.5f ) , IM_COL32( 255 , 255 , 255 , (int)( TextColorOn * 255.f ) ) , szLabel );
} }
auto CAndromedaMenu::RenderVisualPanel() -> void auto CAndromedaMenu::RenderVisualPanel() -> void
{ {
BeginPanel( "Visuals" ); ImGui::SeparatorText( "Visuals" );
Toggle( "Enabled" , "##Visual.Active" , Settings::Visual::Active ); Checkbox( "Enabled" , Settings::Visual::Active );
Toggle( "Teammates" , "##Visual.Team" , Settings::Visual::Team ); Checkbox( "Teammates" , Settings::Visual::Team );
Toggle( "Enemies" , "##Visual.Enemy" , Settings::Visual::Enemy ); Checkbox( "Enemies" , Settings::Visual::Enemy );
Toggle( "Only Visible" , "##Visual.OnlyVisible" , Settings::Visual::OnlyVisible ); Checkbox( "Only Visible" , Settings::Visual::OnlyVisible );
EndPanel(); ImGui::SeparatorText( "Player Info" );
BeginPanel( "Player Info" ); Checkbox( "Name ESP" , Settings::Visual::NameESP );
Checkbox( "Health ESP" , Settings::Visual::HealthESP );
Checkbox( "Armor ESP" , Settings::Visual::ArmorESP );
Checkbox( "Weapon ESP" , Settings::Visual::WeaponESP );
Checkbox( "Bomb ESP" , Settings::Visual::BombESP );
Toggle( "Name ESP" , "##Visual.NameESP" , Settings::Visual::NameESP ); ImGui::SeparatorText( "Player Box" );
Toggle( "Weapon ESP" , "##Visual.WeaponESP" , Settings::Visual::WeaponESP );
Toggle( "Bomb ESP" , "##Visual.BombESP" , Settings::Visual::BombESP );
EndPanel(); Checkbox( "Player Box" , Settings::Visual::PlayerBox );
BeginPanel( "Player Box" );
Toggle( "Player Box" , "##Visual.PlayerBox" , Settings::Visual::PlayerBox );
const char* PlayerBoxTypeItems[] = const char* PlayerBoxTypeItems[] =
{ {
"Box" , "Outline Box" , "Coal Box" , "Outline Coal Box" , "Glassy Box" "Box" , "Outline Box" , "Coal Box" , "Outline Coal Box" , "Circle 3D" , "Glassy Box"
}; };
if ( Combo( "Type" , "##Visual.PlayerBoxType" , Settings::Visual::PlayerBoxType , PlayerBoxTypeItems , IM_ARRAYSIZE( PlayerBoxTypeItems ) ) ) if ( Combo( "Type" , Settings::Visual::PlayerBoxType , PlayerBoxTypeItems , IM_ARRAYSIZE( PlayerBoxTypeItems ) ) )
{ {
if ( Settings::Visual::PlayerBoxType == 5 ) if ( Settings::Visual::PlayerBoxType == 5 )
Settings::Visual::GlassyBox = true; Settings::Visual::GlassyBox = true;
@@ -318,75 +120,65 @@ auto CAndromedaMenu::RenderVisualPanel() -> void
} }
if ( Settings::Visual::PlayerBoxType == 5 ) if ( Settings::Visual::PlayerBoxType == 5 )
SliderInt( "Glass Opacity" , "##Visual.GlassOpacity" , Settings::Visual::GlassOpacity , 10 , 90 , "%d%%" ); SliderInt( "Glass Opacity" , Settings::Visual::GlassOpacity , 10 , 90 , "%d%%" );
EndPanel(); ImGui::SeparatorText( "Skeleton" );
BeginPanel( "Skeleton" ); Checkbox( "Bone ESP" , Settings::Visual::BoneESP );
Toggle( "Bone ESP" , "##Visual.BoneESP" , Settings::Visual::BoneESP );
if ( Settings::Visual::BoneESP ) if ( Settings::Visual::BoneESP )
{ {
Toggle( " Teammates" , "##Visual.BoneESPTeam" , Settings::Visual::BoneESPTeam ); Checkbox( " Teammates" , Settings::Visual::BoneESPTeam );
Toggle( " Enemies" , "##Visual.BoneESPEnemy" , Settings::Visual::BoneESPEnemy ); Checkbox( " Enemies" , Settings::Visual::BoneESPEnemy );
} }
EndPanel();
} }
auto CAndromedaMenu::RenderGlowPanel() -> void auto CAndromedaMenu::RenderGlowPanel() -> void
{ {
BeginPanel( "Glow" ); ImGui::SeparatorText( "Glow" );
Toggle( "Glow Enabled" , "##Visual.Glow" , Settings::Visual::Glow ); Checkbox( "Glow Enabled" , Settings::Visual::Glow );
if ( Settings::Visual::Glow ) if ( Settings::Visual::Glow )
{ {
Toggle( " Teammates" , "##Visual.GlowTeam" , Settings::Visual::GlowTeam ); Checkbox( " Teammates" , Settings::Visual::GlowTeam );
Toggle( " Enemies" , "##Visual.GlowEnemy" , Settings::Visual::GlowEnemy ); Checkbox( " Enemies" , Settings::Visual::GlowEnemy );
ImGui::NewLine(); ImGui::NewLine();
ColorEdit( "Glow TT" , "##Colors.Visual.GlowTT" , &Settings::Colors::Visual::GlowTT.x ); ColorEdit( "Glow TT" , &Settings::Colors::Visual::GlowTT.x );
ColorEdit( "Glow TT Visible" , "##Colors.Visual.GlowTT_Visible" , &Settings::Colors::Visual::GlowTT_Visible.x ); ColorEdit( "Glow TT Visible" , &Settings::Colors::Visual::GlowTT_Visible.x );
ColorEdit( "Glow CT" , "##Colors.Visual.GlowCT" , &Settings::Colors::Visual::GlowCT.x ); ColorEdit( "Glow CT" , &Settings::Colors::Visual::GlowCT.x );
ColorEdit( "Glow CT Visible" , "##Colors.Visual.GlowCT_Visible" , &Settings::Colors::Visual::GlowCT_Visible.x ); ColorEdit( "Glow CT Visible" , &Settings::Colors::Visual::GlowCT_Visible.x );
} }
EndPanel(); ImGui::SeparatorText( "Chams" );
BeginPanel( "Chams" ); Checkbox( "Material Chams" , Settings::Chams::Enabled );
Toggle( "Material Chams" , "##Chams.Enabled" , Settings::Chams::Enabled );
if ( Settings::Chams::Enabled ) if ( Settings::Chams::Enabled )
{ {
Toggle( "Through Walls" , "##Chams.IgnoreZ" , Settings::Chams::IgnoreZ ); Checkbox( "Through Walls" , Settings::Chams::IgnoreZ );
ImGui::NewLine(); ImGui::NewLine();
ColorEdit( "Visible Color" , "##Chams.Visible" , &Settings::Chams::Visible.x ); ColorEdit( "Visible Color" , &Settings::Chams::Visible.x );
ColorEdit( "Occluded Color" , "##Chams.Occluded" , &Settings::Chams::Occluded.x ); ColorEdit( "Occluded Color" , &Settings::Chams::Occluded.x );
} }
EndPanel(); ImGui::SeparatorText( "Glassy Box" );
BeginPanel( "Glassy Box" ); Checkbox( "Glass Fill" , Settings::Visual::GlassyBox );
Toggle( "Glass Fill" , "##Visual.GlassyBox" , Settings::Visual::GlassyBox );
if ( Settings::Visual::GlassyBox ) if ( Settings::Visual::GlassyBox )
{ {
SliderInt( "Opacity" , "##Visual.GlassOpacity" , Settings::Visual::GlassOpacity , 10 , 90 , "%d%%" ); SliderInt( "Opacity" , Settings::Visual::GlassOpacity , 10 , 90 , "%d%%" );
ImGui::NewLine(); ImGui::NewLine();
ColorEdit( "Box TT" , "##Colors.Visual.PlayerBoxTT" , &Settings::Colors::Visual::PlayerBoxTT.x ); ColorEdit( "Box TT" , &Settings::Colors::Visual::PlayerBoxTT.x );
ColorEdit( "Box CT" , "##Colors.Visual.PlayerBoxCT" , &Settings::Colors::Visual::PlayerBoxCT.x ); ColorEdit( "Box CT" , &Settings::Colors::Visual::PlayerBoxCT.x );
} }
EndPanel();
} }
auto CAndromedaMenu::RenderSkinPanel() -> void auto CAndromedaMenu::RenderSkinPanel() -> void
@@ -441,7 +233,7 @@ auto CAndromedaMenu::RenderSkinPanel() -> void
{ {
const auto& Item = Items[ m_iSelectedItemIdx ]; const auto& Item = Items[ m_iSelectedItemIdx ];
ImGui::TextColored( m_Accent , "%s" , Item.m_DisplayName.c_str() ); ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.9f ) , "%s" , Item.m_DisplayName.c_str() );
ImGui::Separator(); ImGui::Separator();
@@ -531,129 +323,49 @@ auto CAndromedaMenu::RenderMusicPanel() -> void
auto CAndromedaMenu::RenderConfigPanel() -> void auto CAndromedaMenu::RenderConfigPanel() -> void
{ {
BeginPanel( "Menu" ); ImGui::SeparatorText( "Menu" );
SliderInt( "Menu Alpha" , "##Menu.MenuAlpha" , Settings::Menu::MenuAlpha , 100 , 255 ); SliderInt( "Menu Alpha" , Settings::Menu::MenuAlpha , 100 , 255 );
const char* MenuStyleItems[] = const char* MenuStyleItems[] =
{ {
"Indigo" , "Vermillion" , "Classic Steam" "Indigo" , "Vermillion" , "Classic Steam"
}; };
if ( Combo( "Menu Style" , "##Menu.MenuStyle" , Settings::Menu::MenuStyle , MenuStyleItems , IM_ARRAYSIZE( MenuStyleItems ) ) ) if ( Combo( "Menu Style" , Settings::Menu::MenuStyle , MenuStyleItems , IM_ARRAYSIZE( MenuStyleItems ) ) )
GetAndromedaGUI()->UpdateStyle(); GetAndromedaGUI()->UpdateStyle();
EndPanel(); ImGui::SeparatorText( "Skinchanger" );
BeginPanel( "Skinchanger" );
ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.4f ) , "%s" , "The skin changer now applies only the skins you configure per weapon." ); ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.4f ) , "%s" , "The skin changer now applies only the skins you configure per weapon." );
if ( ImGui::Button( "Clear All Skins" , ImVec2( 150.f * m_fUIScale , 28.f * m_fUIScale ) ) ) if ( ImGui::Button( "Clear All Skins" , ImVec2( 150.f * m_fUIScale , 28.f * m_fUIScale ) ) )
GetInventoryItemsManager()->ClearAllSelections(); GetInventoryItemsManager()->ClearAllSelections();
EndPanel();
} }
auto CAndromedaMenu::BeginPanel( const char* szTitle ) -> void auto CAndromedaMenu::Checkbox( const char* szLabel , bool& bValue ) -> bool
{ {
ImGui::PushID( szTitle ); return ImGui::Checkbox( szLabel , &bValue );
ImGui::PushFont( GetAndromedaGUI()->GetBoldSegoeFont() );
ImGui::TextColored( ImVec4( 1.f , 1.f , 1.f , 0.95f ) , "%s" , szTitle );
ImGui::PopFont();
ImDrawList* pDraw = ImGui::GetWindowDrawList();
const ImVec2 Pos = ImGui::GetCursorScreenPos();
const float RightEdge = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x;
const float AccentW = 28.f * m_fUIScale;
pDraw->AddRectFilled( Pos , ImVec2( Pos.x + AccentW , Pos.y + 2.f ) , AccentU32( m_Accent ) );
pDraw->AddRectFilled( ImVec2( Pos.x + AccentW , Pos.y + 2.f ) , ImVec2( RightEdge , Pos.y + 2.f ) , IM_COL32( 255 , 255 , 255 , 18 ) );
ImGui::SetCursorPosY( ImGui::GetCursorPosY() + 12.f );
ImGui::Indent( 4.f );
} }
auto CAndromedaMenu::EndPanel() -> void auto CAndromedaMenu::SliderInt( const char* szLabel , int& iValue , int iMin , int iMax , const char* szFormat ) -> bool
{ {
ImGui::Unindent( 4.f ); return ImGui::SliderInt( szLabel , &iValue , iMin , iMax , szFormat );
ImGui::SetCursorPosY( ImGui::GetCursorPosY() + 14.f );
ImGui::PopID();
} }
auto CAndromedaMenu::Toggle( const char* szLabel , const char* szStrID , bool& bValue ) -> bool auto CAndromedaMenu::SliderFloat( const char* szLabel , float& fValue , float fMin , float fMax , const char* szFormat ) -> bool
{ {
ImGui::AlignTextToFramePadding(); return ImGui::SliderFloat( szLabel , &fValue , fMin , fMax , szFormat );
ImGui::TextUnformatted( szLabel );
ImGui::SameLine();
ImGui::SetCursorPosX( ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 40.f );
return ToggleSwitch( szStrID , &bValue , m_Accent );
} }
auto CAndromedaMenu::SliderInt( const char* szLabel , const char* szStrID , int& iValue , int iMin , int iMax , const char* szFormat ) -> bool auto CAndromedaMenu::Combo( const char* szLabel , int& iValue , const char* Items[] , int iItemsCount ) -> bool
{ {
ImGui::AlignTextToFramePadding(); return ImGui::Combo( szLabel , &iValue , Items , iItemsCount );
ImGui::TextUnformatted( szLabel );
ImGui::SameLine();
ImGui::PushItemWidth( ImGui::GetContentRegionAvail().x - 10.f );
const bool bRet = ImGui::SliderInt( szStrID , &iValue , iMin , iMax , szFormat );
ImGui::PopItemWidth();
return bRet;
} }
auto CAndromedaMenu::SliderFloat( const char* szLabel , const char* szStrID , float& fValue , float fMin , float fMax , const char* szFormat ) -> bool auto CAndromedaMenu::ColorEdit( const char* szLabel , float* flColor ) -> bool
{ {
ImGui::AlignTextToFramePadding(); return ImGui::ColorEdit4( szLabel , flColor , ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_NoInputs );
ImGui::TextUnformatted( szLabel );
ImGui::SameLine();
ImGui::PushItemWidth( ImGui::GetContentRegionAvail().x - 10.f );
const bool bRet = ImGui::SliderFloat( szStrID , &fValue , fMin , fMax , szFormat );
ImGui::PopItemWidth();
return bRet;
}
auto CAndromedaMenu::Combo( const char* szLabel , const char* szStrID , int& iValue , const char* Items[] , int iItemsCount ) -> bool
{
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted( szLabel );
ImGui::SameLine();
ImGui::PushItemWidth( ImGui::GetContentRegionAvail().x - 10.f );
const bool bRet = ImGui::Combo( szStrID , &iValue , Items , iItemsCount );
ImGui::PopItemWidth();
return bRet;
}
auto CAndromedaMenu::ColorEdit( const char* szLabel , const char* szStrID , float* flColor ) -> bool
{
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted( szLabel );
ImGui::SameLine();
ImGui::PushItemWidth( ImGui::GetContentRegionAvail().x - 10.f );
const bool bRet = ImGui::ColorEdit4( szStrID , flColor , ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_NoInputs );
ImGui::PopItemWidth();
return bRet;
} }
auto GetAndromedaMenu() -> CAndromedaMenu* auto GetAndromedaMenu() -> CAndromedaMenu*
@@ -9,16 +9,6 @@ class CAndromedaMenu final
public: public:
auto OnRenderMenu() -> void; auto OnRenderMenu() -> void;
private:
enum ETab : int32_t
{
TAB_VISUALS,
TAB_GLOW,
TAB_SKINS,
TAB_MUSIC,
TAB_CONFIG,
};
private: private:
auto RenderVisualPanel() -> void; auto RenderVisualPanel() -> void;
auto RenderGlowPanel() -> void; auto RenderGlowPanel() -> void;
@@ -26,20 +16,14 @@ private:
auto RenderMusicPanel() -> void; auto RenderMusicPanel() -> void;
auto RenderConfigPanel() -> void; auto RenderConfigPanel() -> void;
auto RenderSidebar() -> void; private:
auto Checkbox( const char* szLabel , bool& bValue ) -> bool;
auto TabButton( const char* szIcon , const char* szLabel , const int iTab , const ImVec2& Size ) -> void; auto SliderInt( const char* szLabel , int& iValue , int iMin , int iMax , const char* szFormat = "%d" ) -> bool;
auto Toggle( const char* szLabel , const char* szStrID , bool& bValue ) -> bool; auto SliderFloat( const char* szLabel , float& fValue , float fMin , float fMax , const char* szFormat = "%.2f" ) -> bool;
auto SliderInt( const char* szLabel , const char* szStrID , int& iValue , int iMin , int iMax , const char* szFormat = "%d" ) -> bool; auto Combo( const char* szLabel , int& iValue , const char* Items[] , int iItemsCount ) -> bool;
auto SliderFloat( const char* szLabel , const char* szStrID , float& fValue , float fMin , float fMax , const char* szFormat = "%.2f" ) -> bool; auto ColorEdit( const char* szLabel , float* flColor ) -> bool;
auto Combo( const char* szLabel , const char* szStrID , int& iValue , const char* Items[] , int iItemsCount ) -> bool;
auto ColorEdit( const char* szLabel , const char* szStrID , float* flColor ) -> bool;
auto BeginPanel( const char* szTitle ) -> void;
auto EndPanel() -> void;
private: private:
int m_iSelectedTab = TAB_VISUALS;
int m_iCurrentComboId = 0;
int m_iSelectedItemIdx = -1; int m_iSelectedItemIdx = -1;
int m_iSelectedSkinIdx = 0; int m_iSelectedSkinIdx = 0;
int m_iSelectedMusicIdx = -1; int m_iSelectedMusicIdx = -1;
@@ -48,9 +32,6 @@ private:
private: private:
auto GetUIScale() -> float; auto GetUIScale() -> float;
private:
ImVec4 m_Accent = ImVec4( 0.78f , 0.18f , 0.29f , 1.00f );
}; };
auto GetAndromedaMenu() -> CAndromedaMenu*; auto GetAndromedaMenu() -> CAndromedaMenu*;
@@ -20,6 +20,8 @@ namespace Settings
inline auto GlowEnemy = true; inline auto GlowEnemy = true;
inline auto NameESP = true; inline auto NameESP = true;
inline auto HealthESP = true;
inline auto ArmorESP = true;
inline auto WeaponESP = true; inline auto WeaponESP = true;
inline auto BombESP = true; inline auto BombESP = true;