Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Menu_Items
- {
- AIM_Enabled,
- Aim_Smooth,
- AIM_Fov,
- AIM_Bone,
- AIM_Mode,
- ESP_Enabled,
- ESP_Color
- };
- Menu::Menu() :
- m_Engine(Engine::Connect()),
- m_CVars(CVars::Connect()),
- m_Menu(0, 25, 220, 300),
- m_MenuColor(0, 0, 0, 170),
- m_Index(0),
- m_MouseEnabled(m_Engine->GetCVar()->FindVar(Tools::GetName("gmZljtslgjbcn`", 0x9552134290151514)))
- {
- m_AimEnabledStr = Tools::GetNameW(L"_@llX!Egcfodf", 0x9552134290151514);
- m_AimSmoothStr = Tools::GetNameW(L"_@llX!Sdmkwi", 0x9552134290151514);
- m_AimFovStr = Tools::GetNameW(L"_@llX!Fft", 0x9552134290151514);
- m_AimBoneIdStr = Tools::GetNameW(L"_@llX!BflaJe", 0x9552134290151514);
- m_AimModeStr = Tools::GetNameW(L"_@llX!Mffa", 0x9552134290151514);
- m_EspEnabledStr = Tools::GetNameW(L"_DvqX!Egcfodf", 0x9552134290151514);
- m_EspColorStr = Tools::GetNameW(L"_DvqX!Cfnkq", 0x9552134290151514);
- m_JzrMenuStr = Tools::GetNameW(L"K[P(Dgo})!", 0x8190230981298211);
- Init();
- }
- Menu::~Menu()
- {
- }
- void Menu::Init()
- {
- //Gets ScreenSize
- m_Engine->GetVEngine()->GetScreenSize(m_ScreenSize.x, m_ScreenSize.y);
- m_Menu.x = (m_ScreenSize.x - m_Menu.w - 25);
- //Creates Fonts
- m_MenuFont = m_Engine->GetSurface()->ICreateFont();
- m_Engine->GetSurface()->SetFontGlyphSet(m_MenuFont, "impact", 25, 0, 0, 0, 2);
- m_FFont = m_Engine->GetSurface()->ICreateFont();
- m_Engine->GetSurface()->SetFontGlyphSet(m_FFont, "arial", 15, 0, 0, 0, 0);
- //MenuItems Add
- AddItem(m_AimEnabledStr, std::to_wstring(m_CVars->GetAimState()));
- AddItem(m_AimSmoothStr, std::to_wstring(m_CVars->GetAimSmooth()));
- AddItem(m_AimFovStr, std::to_wstring(m_CVars->GetAimFov()));
- AddItem(m_AimBoneIdStr, m_CVars->GetBoneIdStr());
- AddItem(m_AimModeStr, m_CVars->GetAimModeStr());
- AddItem(m_EspEnabledStr, std::to_wstring(m_CVars->GetEspState()));
- AddItem(m_EspColorStr, m_CVars->GetEspColorStr());
- }
- void Menu::AddItem(const std::wstring & Label, const std::wstring & Item)
- {
- m_MenuItems.push_back(Label);
- m_MenuStates.push_back(Item);
- }
- void Menu::Update()
- {
- static int ButtonTick = 0;
- if (m_Engine->GetInput()->IsButtonDown(sdk::KEY_LCONTROL) &&
- m_Engine->GetInput()->IsButtonDown(sdk::KEY_LALT) &&
- m_Engine->GetInput()->IsButtonDown(sdk::KEY_UP))
- {
- ButtonTick++;
- if (ButtonTick == 1)
- {
- m_CVars->SetMenuState(!m_CVars->GetMenuState());
- m_Engine->GetSurface()->SetFontGlyphSet(m_MenuFont, "impact", 25, 0, 0, 0, 2);
- m_Engine->GetSurface()->SetFontGlyphSet(m_FFont, "arial", 15, 0, 0, 0, 0);
- }
- }
- else
- {
- if (ButtonTick != 0)
- {
- ButtonTick = 0;
- }
- }
- if(m_CVars->GetMenuState() == true)
- {
- static int MouseEnabled = 1;
- static int CursorMoved = 0;
- if (m_Engine->GetInput()->IsButtonDown(sdk::MOUSE_4))
- {
- MouseEnabled = 0;
- m_MouseEnabled->SetValue(0);
- CursorMoved++;
- if (CursorMoved == 1)
- {
- m_Engine->GetInput()->SetCursorPosition(m_Menu.x, m_Menu.y);
- }
- m_Engine->GetInput()->GetCursorPosition(m_Menu.x, m_Menu.y);
- }
- else
- {
- if (MouseEnabled == 0)
- {
- m_MouseEnabled->SetValue(1);
- MouseEnabled = 1;
- CursorMoved = 0;
- }
- }
- DrawMenuRect();
- DrawTitleRect();
- DrawItems();
- UpdateMenuKeys();
- }
- }
- void Menu::DrawMenuRect()
- {
- static vec2<int> nSize;
- m_Engine->GetVEngine()->GetScreenSize(nSize.x, nSize.y);
- if (m_ScreenSize != nSize)
- {
- m_Engine->GetSurface()->SetFontGlyphSet(m_MenuFont, "impact", 25, 0, 0, 0, 2);
- m_Engine->GetSurface()->SetFontGlyphSet(m_FFont, "arial", 15, 0, 0, 0, 0);
- m_ScreenSize = nSize;
- }
- m_Engine->GetSurface()->DrawSetColor(m_MenuColor.r, m_MenuColor.g, m_MenuColor.b, m_MenuColor.a);
- m_Engine->GetSurface()->DrawFilledRect(m_Menu.x, m_Menu.y, m_Menu.x + m_Menu.w, m_Menu.y + m_Menu.h);
- m_Engine->GetSurface()->DrawSetColor(12, 116, 191, 255);
- m_Engine->GetSurface()->DrawFilledRect(m_Menu.x, m_Menu.y, m_Menu.x + m_Menu.w, m_Menu.y + 12);
- }
- void Menu::DrawTitleRect()
- {
- m_Engine->GetSurface()->DrawSetTextFont(m_MenuFont);
- m_Engine->GetSurface()->DrawSetTextColor(255, 255, 255, 255);
- m_Engine->GetSurface()->DrawSetTextPos(m_Menu.x + 65, m_Menu.y + 15);
- m_Engine->GetSurface()->DrawPrintText(m_JzrMenuStr, 10);
- }
- void Menu::DrawItems()
- {
- for (int i = 0; i < (int)m_MenuItems.size(); i++)
- {
- if (m_Index == i)
- {
- m_Engine->GetSurface()->DrawSetColor(12, 116, 191, 255);
- m_Engine->GetSurface()->DrawFilledRect(m_Menu.x + 10, m_Menu.y + 60 + i * 20, m_Menu.x + m_Menu.w - 10, m_Menu.y + 80 + i * 20);
- }
- DrawMenuText(m_MenuItems[i].c_str(), m_MenuStates[i].c_str(), 10, 60 + i * 20, Color(255, 255, 255, 255));
- }
- }
- void Menu::UpdateMenuKeys()
- {
- static int ButtonTick = 0;
- if (m_Engine->GetInput()->IsButtonDown(sdk::KEY_LEFT))
- {
- ButtonTick++;
- if (ButtonTick == 1 || ButtonTick > 150)
- {
- UpdateMenuValues(CVars_Minus);
- }
- }
- else if (m_Engine->GetInput()->IsButtonDown(sdk::KEY_RIGHT))
- {
- ButtonTick++;
- if (ButtonTick == 1 || ButtonTick > 150)
- {
- UpdateMenuValues(CVars_Plus);
- }
- }
- else if (m_Engine->GetInput()->IsButtonDown(sdk::KEY_UP))
- {
- ButtonTick++;
- if (ButtonTick == 1 || ButtonTick > 150)
- {
- if (m_Index > 0)
- {
- m_Index--;
- }
- }
- }
- else if (m_Engine->GetInput()->IsButtonDown(sdk::KEY_DOWN))
- {
- ButtonTick++;
- if (ButtonTick == 1 || ButtonTick > 150)
- {
- if (m_Index < (int)m_MenuItems.size() - 1)
- {
- m_Index++;
- }
- }
- }
- else
- {
- if (ButtonTick != 0)
- {
- ButtonTick = 0;
- }
- }
- }
- void Menu::UpdateMenuValues(int State)
- {
- switch (m_Index)
- {
- case AIM_Enabled:
- {
- m_CVars->SetAimState(State);
- m_MenuStates[m_Index] = std::to_wstring(m_CVars->GetAimState());
- break;
- }
- case Aim_Smooth:
- {
- m_CVars->SetAimSmooth(State);
- m_MenuStates[m_Index] = std::to_wstring(m_CVars->GetAimSmooth());
- break;
- }
- case AIM_Fov:
- {
- m_CVars->SetAimFov(State);
- m_MenuStates[m_Index] = std::to_wstring(m_CVars->GetAimFov());
- break;
- }
- case AIM_Bone:
- {
- m_CVars->SetBoneId(State);
- m_MenuStates[m_Index] = m_CVars->GetBoneIdStr();
- break;
- }
- case AIM_Mode:
- {
- m_CVars->SetAimMode(State);
- m_MenuStates[m_Index] = m_CVars->GetAimModeStr();
- break;
- }
- case ESP_Enabled:
- {
- m_CVars->SetEspState(State);
- m_MenuStates[m_Index] = std::to_wstring(m_CVars->GetEspState());
- break;
- }
- case ESP_Color:
- {
- m_CVars->SetEspColor(State);
- m_MenuStates[m_Index] = m_CVars->GetEspColorStr();
- break;
- }
- }
- }
- void Menu::DrawMenuText(const wchar_t * Label, const wchar_t* Item, const int & x, const int & y, const Color & color) const
- {
- m_Engine->GetSurface()->DrawSetTextFont(m_FFont);
- m_Engine->GetSurface()->DrawSetTextColor(color.r, color.g, color.b, color.a);
- m_Engine->GetSurface()->DrawSetTextPos(m_Menu.x + x, m_Menu.y + y);
- m_Engine->GetSurface()->DrawPrintText(Label, wcslen(Label));
- m_Engine->GetSurface()->DrawSetTextPos(m_Menu.x + x + 120, m_Menu.y + y);
- m_Engine->GetSurface()->DrawPrintText(Item, wcslen(Item));
- }
- CVars::CVars() :
- m_Aim(1),
- m_AimSmooth(1),
- m_AimFov(1.0),
- m_BoneId(Aim_Body),
- m_AimMode(AIM_Mode_Faceit),
- m_Esp(0),
- m_EspColor(ESP_Color_Red),
- m_Menu(false)
- {
- m_BodyString = Tools::GetNameW(L"Fnax", 0x9552134290151514);
- m_SilentString = Tools::GetNameW(L"Whidku", 0x9552134290151514);
- m_FaceitStr = Tools::GetNameW(L"B`fdlu", 0x9552134290151514);
- }
- CVars::~CVars()
- {
- }
- int CVars::GetAimState() const
- {
- return m_Aim;
- }
- int CVars::GetAimSmooth() const
- {
- return m_AimSmooth;
- }
- double CVars::GetAimFov() const
- {
- return m_AimFov;
- }
- int CVars::GetBoneId() const
- {
- return m_BoneId;
- }
- std::wstring CVars::GetBoneIdStr() const
- {
- std::wstring String;
- if (m_BoneId == Aim_Body)
- {
- String = m_BodyString;
- }
- else
- {
- String = std::to_wstring(m_BoneId);
- }
- return String;
- }
- int CVars::GetAimMode() const
- {
- return m_AimMode;
- }
- std::wstring CVars::GetAimModeStr() const
- {
- std::wstring String;
- switch (m_AimMode)
- {
- case AIM_Mode_Faceit:
- {
- String = m_FaceitStr;
- break;
- }
- case AIM_Mode_Normal:
- {
- String = L"Normal";
- break;
- }
- case AIM_Mode_Silent:
- {
- String = m_SilentString;
- break;
- }
- }
- return String;
- }
- int CVars::GetEspState() const
- {
- return m_Esp;
- }
- int CVars::GetEspColor() const
- {
- return m_EspColor;
- }
- std::wstring CVars::GetEspColorStr() const
- {
- std::wstring String;
- switch (m_EspColor)
- {
- case ESP_Color_Red:
- {
- String = L"Red";
- break;
- }
- case ESP_Color_Green:
- {
- String = L"Green";
- break;
- }
- case ESP_Color_Blue:
- {
- String = L"Blue";
- break;
- }
- case ESP_Color_White:
- {
- String = L"White";
- break;
- }
- }
- return String;
- }
- bool CVars::GetMenuState() const
- {
- return m_Menu;
- }
- void CVars::SetAimState(const int & State)
- {
- SetValue(State, m_Aim, 0, 1);
- }
- void CVars::SetAimSmooth(const int & State)
- {
- SetValue(State, m_AimSmooth, 0, 30);
- }
- void CVars::SetAimFov(const int & State)
- {
- SetValueDbl(State, m_AimFov, 0.0, 180.0);
- }
- void CVars::SetBoneId(const int & State)
- {
- SetValue(State, m_BoneId, 0, 8);
- }
- void CVars::SetAimMode(const int & State)
- {
- SetValue(State, m_AimMode, AIM_Mode_Faceit, AIM_Mode_Silent);
- }
- void CVars::SetEspState(const int & State)
- {
- SetValue(State, m_Esp, 0, 1);
- }
- void CVars::SetEspColor(const int & State)
- {
- SetValue(State, m_EspColor, ESP_Color_Red, ESP_Color_White);
- }
- void CVars::SetMenuState(const bool & State)
- {
- m_Menu = State;
- }
- void CVars::SetValue(const int & State, int & Value, const int & Min, const int & Max)
- {
- switch (State)
- {
- case CVars_Plus:
- {
- if (Value <= Max)
- {
- Value++;
- }
- if (Value > Max)
- Value = Min;
- break;
- }
- case CVars_Minus:
- {
- if (Value >= Min)
- {
- Value--;
- }
- if (Value < Min)
- Value = Max;
- break;
- }
- }
- }
- void CVars::SetValueDbl(const int & State, double & Value, const double & Min, const double & Max)
- {
- switch (State)
- {
- case CVars_Plus:
- {
- if (Value <= Max)
- {
- Value = Value + 0.20;
- }
- if (Value > Max)
- Value = Min;
- break;
- }
- case CVars_Minus:
- {
- if (Value >= Min)
- {
- Value = Value - 0.20;
- }
- if (Value < Min)
- Value = Max;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement