Add Menu Controlls
This commit is contained in:
@@ -65,8 +65,6 @@ auto CAndromedaClient::OnClientOutput() -> void
|
||||
auto CAndromedaClient::OnCreateMove( CCSGOInput* pInput , CUserCmd* pUserCmd ) -> void
|
||||
{
|
||||
GetVisual()->OnCreateMove();
|
||||
|
||||
DEV_LOG( "%s\n" , pUserCmd->cmd.DebugString().c_str() );
|
||||
}
|
||||
|
||||
auto GetAndromedaClient() -> CAndromedaClient*
|
||||
|
||||
@@ -508,11 +508,11 @@ auto CAndromedaGUI::UpdateStyle() -> void
|
||||
{
|
||||
ImGui::SetCurrentContext( m_pImGuiContext );
|
||||
|
||||
if ( Settings::Misc::MenuStyle == EAndromedaGuiStyle_t::ANDROMEDA_GUI_STYLE_INDIGO )
|
||||
if ( Settings::Menu::MenuStyle == EAndromedaGuiStyle_t::ANDROMEDA_GUI_STYLE_INDIGO )
|
||||
SetIndigoStyle();
|
||||
else if ( Settings::Misc::MenuStyle == EAndromedaGuiStyle_t::ANDROMEDA_GUI_STYLE_VERMILLION )
|
||||
else if ( Settings::Menu::MenuStyle == EAndromedaGuiStyle_t::ANDROMEDA_GUI_STYLE_VERMILLION )
|
||||
SetVermillionStyle();
|
||||
else if ( Settings::Misc::MenuStyle == EAndromedaGuiStyle_t::ANDROMEDA_GUI_STYLE_CLASSIC_STEAM )
|
||||
else if ( Settings::Menu::MenuStyle == EAndromedaGuiStyle_t::ANDROMEDA_GUI_STYLE_CLASSIC_STEAM )
|
||||
SetClassicSteamStyle();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,14 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con
|
||||
if ( Settings::Visual::Enemy && IsEnemy )
|
||||
Draw = true;
|
||||
|
||||
if ( Settings::Visual::OnlyVisible )
|
||||
{
|
||||
if ( bVisible )
|
||||
Draw = true;
|
||||
else
|
||||
Draw = false;
|
||||
}
|
||||
|
||||
if ( Draw )
|
||||
{
|
||||
if ( Settings::Visual::PlayerBox )
|
||||
@@ -84,17 +92,17 @@ auto CVisual::OnRenderPlayerEsp( CCSPlayerController* pCCSPlayerController , con
|
||||
|
||||
if ( pCCSPlayerController->m_iTeamNum() == TEAM_TT )
|
||||
{
|
||||
PlayerColor = ImColor( Settings::Colors::Visual::PlayerBoxTT[0] , Settings::Colors::Visual::PlayerBoxTT[1] , Settings::Colors::Visual::PlayerBoxTT[2] , Settings::Colors::Visual::PlayerBoxTT[3] );
|
||||
PlayerColor = Settings::Colors::Visual::PlayerBoxTT;
|
||||
|
||||
if ( bVisible )
|
||||
PlayerColor = ImColor( Settings::Colors::Visual::PlayerBoxTT_Visible[0] , Settings::Colors::Visual::PlayerBoxTT_Visible[1] , Settings::Colors::Visual::PlayerBoxTT_Visible[2] , Settings::Colors::Visual::PlayerBoxTT_Visible[3] );
|
||||
PlayerColor = Settings::Colors::Visual::PlayerBoxTT_Visible;
|
||||
}
|
||||
else if ( pCCSPlayerController->m_iTeamNum() == TEAM_CT )
|
||||
{
|
||||
PlayerColor = ImColor( Settings::Colors::Visual::PlayerBoxCT[0] , Settings::Colors::Visual::PlayerBoxCT[1] , Settings::Colors::Visual::PlayerBoxCT[2] , Settings::Colors::Visual::PlayerBoxCT[3] );
|
||||
PlayerColor = Settings::Colors::Visual::PlayerBoxCT;
|
||||
|
||||
if ( bVisible )
|
||||
PlayerColor = ImColor( Settings::Colors::Visual::PlayerBoxCT_Visible[0] , Settings::Colors::Visual::PlayerBoxCT_Visible[1] , Settings::Colors::Visual::PlayerBoxCT_Visible[2] , Settings::Colors::Visual::PlayerBoxCT_Visible[3] );
|
||||
PlayerColor = Settings::Colors::Visual::PlayerBoxCT_Visible;
|
||||
}
|
||||
|
||||
if ( Settings::Visual::PlayerBoxType == EVisualBoxType_t::BOX )
|
||||
|
||||
@@ -3,19 +3,56 @@
|
||||
#include <ImGui/imgui.h>
|
||||
|
||||
#include <AndromedaClient/Settings/Settings.hpp>
|
||||
#include <AndromedaClient/CAndromedaGUI.hpp>
|
||||
|
||||
static CAndromedaMenu g_CAndromedaMenu{};
|
||||
|
||||
auto CAndromedaMenu::OnRenderMenu() -> void
|
||||
{
|
||||
const float MenuAlpha = static_cast<float>( Settings::Misc::MenuAlpha ) / 255.f;
|
||||
const float MenuAlpha = static_cast<float>( Settings::Menu::MenuAlpha ) / 255.f;
|
||||
|
||||
ImGui::PushStyleVar( ImGuiStyleVar_Alpha , MenuAlpha );
|
||||
ImGui::SetNextWindowSize( ImVec2( 500 , 500 ) , ImGuiCond_FirstUseEver );
|
||||
|
||||
if ( ImGui::Begin( XorStr( CHEAT_NAME ) , 0 ) )
|
||||
{
|
||||
if ( ImGui::CollapsingHeader( XorStr( "Visuals" ) ) )
|
||||
{
|
||||
RenderCheckBox( XorStr( "Active" ) , XorStr( "##Visual.Active" ) , Settings::Visual::Active );
|
||||
RenderCheckBox( XorStr( "Team" ) , XorStr( "##Visual.Team" ) , Settings::Visual::Team );
|
||||
RenderCheckBox( XorStr( "Enemy" ) , XorStr( "##Visual.Enemy" ) , Settings::Visual::Enemy );
|
||||
RenderCheckBox( XorStr( "OnlyVisible" ) , XorStr( "##Visual.OnlyVisible" ) , Settings::Visual::OnlyVisible );
|
||||
|
||||
RenderCheckBox( XorStr( "Player Box" ) , XorStr( "##Visual.PlayerBox" ) , Settings::Visual::PlayerBox );
|
||||
|
||||
const char* PlayerBoxTypeItems[] =
|
||||
{
|
||||
"Box" , "Outline Box" , "Coal Box" , "Outline Coal Box"
|
||||
};
|
||||
|
||||
RenderComboBox( XorStr( "PlayerBox Type" ) , XorStr( "##Visual.PlayerBoxType" ) , Settings::Visual::PlayerBoxType , PlayerBoxTypeItems , IM_ARRAYSIZE( PlayerBoxTypeItems ) );
|
||||
}
|
||||
|
||||
if ( ImGui::CollapsingHeader( XorStr( "Colors" ) ) )
|
||||
{
|
||||
RenderColorEdit( XorStr( "Player Box TT" ) , XorStr( "##Colors.Visual.PlayerBoxTT" ) , &Settings::Colors::Visual::PlayerBoxTT.x );
|
||||
RenderColorEdit( XorStr( "Player Box TT Visible" ) , XorStr( "##Colors.Visual.PlayerBoxTT_Visible" ) , &Settings::Colors::Visual::PlayerBoxTT_Visible.x );
|
||||
RenderColorEdit( XorStr( "Player Box CT" ) , XorStr( "##Colors.Visual.PlayerBoxCT" ) , &Settings::Colors::Visual::PlayerBoxCT.x );
|
||||
RenderColorEdit( XorStr( "Player Box CT Visible" ) , XorStr( "##Colors.Visual.PlayerBoxCT_Visible" ) , &Settings::Colors::Visual::PlayerBoxCT_Visible.x );
|
||||
}
|
||||
|
||||
if ( ImGui::CollapsingHeader( XorStr( "Menu" ) ) )
|
||||
{
|
||||
RenderSliderInt( XorStr( "Menu Alpha" ) , XorStr( "##Menu.MenuAlpha" ) , Settings::Menu::MenuAlpha , 0 , 255 );
|
||||
|
||||
const char* MenuStyleItems[] =
|
||||
{
|
||||
"Indigo" , "Vermillion" , "Classic Steam"
|
||||
};
|
||||
|
||||
if ( RenderComboBox( XorStr( "Menu Style" ) , XorStr( "##Menu.MenuStyle" ) , Settings::Menu::MenuStyle , MenuStyleItems , IM_ARRAYSIZE( MenuStyleItems ) ) )
|
||||
GetAndromedaGUI()->UpdateStyle();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
@@ -23,6 +60,74 @@ auto CAndromedaMenu::OnRenderMenu() -> void
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
auto CAndromedaMenu::RenderCheckBox( const char* szTitle , const char* szStrID , bool& SettingsItem ) -> bool
|
||||
{
|
||||
if ( szTitle )
|
||||
{
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text( szTitle );
|
||||
ImGui::SameLine( ImGui::CalcTextSize( szTitle ).x + 10.f );
|
||||
}
|
||||
|
||||
const auto LeftPadding = ImGui::GetStyle().FramePadding.x;
|
||||
|
||||
ImGui::Dummy( ImVec2( ImGui::GetContentRegionAvail().x - 27.f - LeftPadding , 0.f ) );
|
||||
ImGui::SameLine();
|
||||
|
||||
const auto Ret = ImGui::Checkbox( szStrID , &SettingsItem );
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
auto CAndromedaMenu::RenderComboBox( const char* szTitle , const char* szStrID , int& v , const char* Items[] , int ItemsCount ) -> bool
|
||||
{
|
||||
if ( szTitle )
|
||||
{
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text( szTitle );
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::PushItemWidth( -1.f );
|
||||
const auto Ret = ImGui::Combo( szStrID , &v , Items , ItemsCount );
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
auto CAndromedaMenu::RenderColorEdit( const char* szTitle , const char* szStrID , float* Color ) -> bool
|
||||
{
|
||||
if ( szTitle )
|
||||
{
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text( szTitle );
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
const auto Ret = ImGui::ColorEdit4( szStrID , Color );
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
auto CAndromedaMenu::RenderSliderInt( const char* szTitle , const char* szStrID , int& Value , int Min , int Max ) -> bool
|
||||
{
|
||||
if ( szTitle )
|
||||
{
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text( szTitle );
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::PushItemWidth( -1.f );
|
||||
const auto Ret = ImGui::SliderInt( szStrID , &Value , Min , Max );
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
auto GetAndromedaMenu() -> CAndromedaMenu*
|
||||
{
|
||||
return &g_CAndromedaMenu;
|
||||
|
||||
@@ -6,6 +6,12 @@ class CAndromedaMenu final
|
||||
{
|
||||
public:
|
||||
auto OnRenderMenu() -> void;
|
||||
|
||||
private:
|
||||
auto RenderCheckBox( const char* szTitle , const char* szStrID , bool& SettingsItem ) -> bool;
|
||||
auto RenderComboBox( const char* szTitle , const char* szStrID , int& v , const char* Items[] , int ItemsCount ) -> bool;
|
||||
auto RenderColorEdit( const char* szTitle , const char* szStrID , float* Color ) -> bool;
|
||||
auto RenderSliderInt( const char* szTitle , const char* szStrID , int& Value , int Min , int Max ) -> bool;
|
||||
};
|
||||
|
||||
auto GetAndromedaMenu() -> CAndromedaMenu*;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Common/Common.hpp>
|
||||
#include <ImGui/imgui.h>
|
||||
|
||||
namespace Settings
|
||||
{
|
||||
@@ -9,11 +10,12 @@ namespace Settings
|
||||
inline auto Active = true;
|
||||
inline auto Team = true;
|
||||
inline auto Enemy = true;
|
||||
inline auto OnlyVisible = false;
|
||||
inline auto PlayerBox = true;
|
||||
|
||||
inline auto PlayerBoxType = 3;
|
||||
}
|
||||
namespace Misc
|
||||
namespace Menu
|
||||
{
|
||||
inline auto MenuAlpha = 200;
|
||||
inline auto MenuStyle = 0;
|
||||
@@ -22,10 +24,10 @@ namespace Settings
|
||||
{
|
||||
namespace Visual
|
||||
{
|
||||
inline float PlayerBoxTT[4] = { 255.f / 255.f , 75.f / 255.f , 75.f / 255.f , 1.f };
|
||||
inline float PlayerBoxTT_Visible[4] = { 0 , 1.f , 0.f , 1.f };
|
||||
inline float PlayerBoxCT[4] = { 65.f / 255.f , 200 / 255.f , 255.f / 255.f , 1.f };
|
||||
inline float PlayerBoxCT_Visible[4] = { 0 , 1.f , 0.f , 1.f };
|
||||
inline ImVec4 PlayerBoxTT = { 255.f / 255.f , 75.f / 255.f , 75.f / 255.f , 1.f };
|
||||
inline ImVec4 PlayerBoxTT_Visible = { 0 , 1.f , 0.f , 1.f };
|
||||
inline ImVec4 PlayerBoxCT = { 65.f / 255.f , 200 / 255.f , 255.f / 255.f , 1.f };
|
||||
inline ImVec4 PlayerBoxCT_Visible = { 0 , 1.f , 0.f , 1.f };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user