From d7b08444d9db2b21943ea6e14209234318dd9018 Mon Sep 17 00:00:00 2001 From: whitehai11 Date: Wed, 5 Aug 2026 16:14:13 +0200 Subject: [PATCH] Add Health/Armor ESP bars; rebuild menu with standard ImGui look --- .../Features/CVisual/CVisual.cpp | 54 ++ .../Features/CVisual/CVisual.hpp | 1 + .../AndromedaClient/GUI/CAndromedaMenu.cpp | 462 ++++-------------- .../AndromedaClient/GUI/CAndromedaMenu.hpp | 33 +- .../AndromedaClient/Settings/Settings.hpp | 2 + 5 files changed, 151 insertions(+), 401 deletions(-) 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 5c4a2a7..9750f03 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 @@ -1,5 +1,7 @@ #include "CVisual.hpp" +#include + #include #include @@ -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 ); } } +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( pPawn->m_iHealth() ); + const float MaxHealth = static_cast( pPawn->m_iMaxHealth() ); + const float Ratio = std::clamp( MaxHealth > 0.f ? Health / MaxHealth : 0.f , 0.f , 1.f ); + + const ImColor HealthColor( + static_cast( 255.f * ( 1.f - Ratio ) ) , + static_cast( 255.f * Ratio ) , + 0 ); + + DrawBar( x , Health , MaxHealth , HealthColor ); + + x += BarWidth + Spacing; + } + + if ( Settings::Visual::ArmorESP ) + { + const float Armor = static_cast( 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* pFont = &GetFontManager()->m_VerdanaFont; 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 bce861e..37f822a 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 @@ -40,6 +40,7 @@ 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 OnRenderHealthBars( C_CSPlayerPawn* pPawn , const ImVec2& BoxMin , const ImVec2& BoxMax ) -> void; auto GetPlayerWeaponName( C_CSPlayerPawn* pPawn ) -> const char*; auto HasBomb( C_CSPlayerPawn* pPawn ) -> bool; 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 69afb6a..097dcf7 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.cpp @@ -11,41 +11,6 @@ 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 { float Scale = ImGui::GetIO().DisplaySize.y / 1080.f; @@ -65,39 +30,10 @@ auto CAndromedaMenu::OnRenderMenu() -> void ImGui::GetIO().FontGlobalScale = m_fUIScale; - const float MenuAlpha = static_cast( 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; - float MenuW = 1120.f * m_fUIScale; - float MenuH = 640.f * m_fUIScale; + float MenuW = 720.f * m_fUIScale; + float MenuH = 560.f * m_fUIScale; if ( 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::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(); - - 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 ) ) + if ( ImGui::BeginTabBar( "##MainTabs" ) ) { - switch ( m_iSelectedTab ) + if ( ImGui::BeginTabItem( "Visuals" ) ) { - case TAB_VISUALS: RenderVisualPanel(); break; - case TAB_GLOW: RenderGlowPanel(); break; - case TAB_SKINS: RenderSkinPanel(); break; - case TAB_MUSIC: RenderMusicPanel(); break; - case TAB_CONFIG: RenderConfigPanel(); break; - default: break; + RenderVisualPanel(); + ImGui::EndTabItem(); } + + if ( ImGui::BeginTabItem( "Glow & Chams" ) ) + { + RenderGlowPanel(); + ImGui::EndTabItem(); + } + + 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::EndChild(); - - ImGui::PopStyleVar(); } 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 { - BeginPanel( "Visuals" ); + ImGui::SeparatorText( "Visuals" ); - Toggle( "Enabled" , "##Visual.Active" , Settings::Visual::Active ); - Toggle( "Teammates" , "##Visual.Team" , Settings::Visual::Team ); - Toggle( "Enemies" , "##Visual.Enemy" , Settings::Visual::Enemy ); - Toggle( "Only Visible" , "##Visual.OnlyVisible" , Settings::Visual::OnlyVisible ); + Checkbox( "Enabled" , Settings::Visual::Active ); + Checkbox( "Teammates" , Settings::Visual::Team ); + Checkbox( "Enemies" , Settings::Visual::Enemy ); + 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 ); - Toggle( "Weapon ESP" , "##Visual.WeaponESP" , Settings::Visual::WeaponESP ); - Toggle( "Bomb ESP" , "##Visual.BombESP" , Settings::Visual::BombESP ); + ImGui::SeparatorText( "Player Box" ); - EndPanel(); - - BeginPanel( "Player Box" ); - - Toggle( "Player Box" , "##Visual.PlayerBox" , Settings::Visual::PlayerBox ); + Checkbox( "Player Box" , Settings::Visual::PlayerBox ); 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 ) Settings::Visual::GlassyBox = true; @@ -318,75 +120,65 @@ auto CAndromedaMenu::RenderVisualPanel() -> void } 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" ); - - Toggle( "Bone ESP" , "##Visual.BoneESP" , Settings::Visual::BoneESP ); + Checkbox( "Bone ESP" , Settings::Visual::BoneESP ); if ( Settings::Visual::BoneESP ) { - Toggle( " Teammates" , "##Visual.BoneESPTeam" , Settings::Visual::BoneESPTeam ); - Toggle( " Enemies" , "##Visual.BoneESPEnemy" , Settings::Visual::BoneESPEnemy ); + Checkbox( " Teammates" , Settings::Visual::BoneESPTeam ); + Checkbox( " Enemies" , Settings::Visual::BoneESPEnemy ); } - - EndPanel(); } 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 ) { - Toggle( " Teammates" , "##Visual.GlowTeam" , Settings::Visual::GlowTeam ); - Toggle( " Enemies" , "##Visual.GlowEnemy" , Settings::Visual::GlowEnemy ); + Checkbox( " Teammates" , Settings::Visual::GlowTeam ); + Checkbox( " Enemies" , Settings::Visual::GlowEnemy ); ImGui::NewLine(); - ColorEdit( "Glow TT" , "##Colors.Visual.GlowTT" , &Settings::Colors::Visual::GlowTT.x ); - ColorEdit( "Glow TT Visible" , "##Colors.Visual.GlowTT_Visible" , &Settings::Colors::Visual::GlowTT_Visible.x ); - ColorEdit( "Glow CT" , "##Colors.Visual.GlowCT" , &Settings::Colors::Visual::GlowCT.x ); - ColorEdit( "Glow CT Visible" , "##Colors.Visual.GlowCT_Visible" , &Settings::Colors::Visual::GlowCT_Visible.x ); + ColorEdit( "Glow TT" , &Settings::Colors::Visual::GlowTT.x ); + ColorEdit( "Glow TT Visible" , &Settings::Colors::Visual::GlowTT_Visible.x ); + ColorEdit( "Glow CT" , &Settings::Colors::Visual::GlowCT.x ); + ColorEdit( "Glow CT Visible" , &Settings::Colors::Visual::GlowCT_Visible.x ); } - EndPanel(); + ImGui::SeparatorText( "Chams" ); - BeginPanel( "Chams" ); - - Toggle( "Material Chams" , "##Chams.Enabled" , Settings::Chams::Enabled ); + Checkbox( "Material Chams" , Settings::Chams::Enabled ); if ( Settings::Chams::Enabled ) { - Toggle( "Through Walls" , "##Chams.IgnoreZ" , Settings::Chams::IgnoreZ ); + Checkbox( "Through Walls" , Settings::Chams::IgnoreZ ); ImGui::NewLine(); - ColorEdit( "Visible Color" , "##Chams.Visible" , &Settings::Chams::Visible.x ); - ColorEdit( "Occluded Color" , "##Chams.Occluded" , &Settings::Chams::Occluded.x ); + ColorEdit( "Visible Color" , &Settings::Chams::Visible.x ); + ColorEdit( "Occluded Color" , &Settings::Chams::Occluded.x ); } - EndPanel(); + ImGui::SeparatorText( "Glassy Box" ); - BeginPanel( "Glassy Box" ); - - Toggle( "Glass Fill" , "##Visual.GlassyBox" , Settings::Visual::GlassyBox ); + Checkbox( "Glass Fill" , 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(); - ColorEdit( "Box TT" , "##Colors.Visual.PlayerBoxTT" , &Settings::Colors::Visual::PlayerBoxTT.x ); - ColorEdit( "Box CT" , "##Colors.Visual.PlayerBoxCT" , &Settings::Colors::Visual::PlayerBoxCT.x ); + ColorEdit( "Box TT" , &Settings::Colors::Visual::PlayerBoxTT.x ); + ColorEdit( "Box CT" , &Settings::Colors::Visual::PlayerBoxCT.x ); } - - EndPanel(); } auto CAndromedaMenu::RenderSkinPanel() -> void @@ -441,7 +233,7 @@ auto CAndromedaMenu::RenderSkinPanel() -> void { 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(); @@ -531,132 +323,52 @@ auto CAndromedaMenu::RenderMusicPanel() -> 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[] = { "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(); - EndPanel(); - - BeginPanel( "Skinchanger" ); + ImGui::SeparatorText( "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." ); if ( ImGui::Button( "Clear All Skins" , ImVec2( 150.f * m_fUIScale , 28.f * m_fUIScale ) ) ) GetInventoryItemsManager()->ClearAllSelections(); - - EndPanel(); } -auto CAndromedaMenu::BeginPanel( const char* szTitle ) -> void +auto CAndromedaMenu::Checkbox( const char* szLabel , bool& bValue ) -> bool { - ImGui::PushID( szTitle ); - - 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 ); + return ImGui::Checkbox( szLabel , &bValue ); } -auto CAndromedaMenu::EndPanel() -> void +auto CAndromedaMenu::SliderInt( const char* szLabel , int& iValue , int iMin , int iMax , const char* szFormat ) -> bool { - ImGui::Unindent( 4.f ); - - ImGui::SetCursorPosY( ImGui::GetCursorPosY() + 14.f ); - - ImGui::PopID(); + return ImGui::SliderInt( szLabel , &iValue , iMin , iMax , szFormat ); } -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(); - ImGui::TextUnformatted( szLabel ); - - ImGui::SameLine(); - - ImGui::SetCursorPosX( ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 40.f ); - - return ToggleSwitch( szStrID , &bValue , m_Accent ); + return ImGui::SliderFloat( szLabel , &fValue , fMin , fMax , szFormat ); } -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(); - 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; + return ImGui::Combo( szLabel , &iValue , Items , iItemsCount ); } -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(); - 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; + return ImGui::ColorEdit4( szLabel , flColor , ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_NoInputs ); } auto GetAndromedaMenu() -> CAndromedaMenu* { return &g_CAndromedaMenu; -} \ No newline at end of file +} diff --git a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.hpp b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.hpp index 316c01e..4214b95 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.hpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/GUI/CAndromedaMenu.hpp @@ -9,16 +9,6 @@ class CAndromedaMenu final public: auto OnRenderMenu() -> void; -private: - enum ETab : int32_t - { - TAB_VISUALS, - TAB_GLOW, - TAB_SKINS, - TAB_MUSIC, - TAB_CONFIG, - }; - private: auto RenderVisualPanel() -> void; auto RenderGlowPanel() -> void; @@ -26,20 +16,14 @@ private: auto RenderMusicPanel() -> void; auto RenderConfigPanel() -> void; - auto RenderSidebar() -> void; - - auto TabButton( const char* szIcon , const char* szLabel , const int iTab , const ImVec2& Size ) -> void; - auto Toggle( const char* szLabel , const char* szStrID , bool& bValue ) -> bool; - auto SliderInt( const char* szLabel , const char* szStrID , int& iValue , int iMin , int iMax , const char* szFormat = "%d" ) -> bool; - auto SliderFloat( const char* szLabel , const char* szStrID , float& fValue , float fMin , float fMax , const char* szFormat = "%.2f" ) -> 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: + auto Checkbox( const char* szLabel , bool& bValue ) -> bool; + auto SliderInt( const char* szLabel , int& iValue , int iMin , int iMax , const char* szFormat = "%d" ) -> bool; + auto SliderFloat( const char* szLabel , float& fValue , float fMin , float fMax , const char* szFormat = "%.2f" ) -> bool; + auto Combo( const char* szLabel , int& iValue , const char* Items[] , int iItemsCount ) -> bool; + auto ColorEdit( const char* szLabel , float* flColor ) -> bool; private: - int m_iSelectedTab = TAB_VISUALS; - int m_iCurrentComboId = 0; int m_iSelectedItemIdx = -1; int m_iSelectedSkinIdx = 0; int m_iSelectedMusicIdx = -1; @@ -48,9 +32,6 @@ private: private: auto GetUIScale() -> float; - -private: - ImVec4 m_Accent = ImVec4( 0.78f , 0.18f , 0.29f , 1.00f ); }; -auto GetAndromedaMenu() -> CAndromedaMenu*; \ No newline at end of file +auto GetAndromedaMenu() -> CAndromedaMenu*; 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 4fa358d..19442b5 100644 --- a/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp +++ b/Andromeda-CS2-Base/Andromeda-CS2-Base/AndromedaClient/Settings/Settings.hpp @@ -20,6 +20,8 @@ namespace Settings inline auto GlowEnemy = true; inline auto NameESP = true; + inline auto HealthESP = true; + inline auto ArmorESP = true; inline auto WeaponESP = true; inline auto BombESP = true;