Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Menu.h"
- #include "TGFCfg.h"
- #include "../SDK/Vector.h"
- #include "../SDK/ISurface.h"
- #include "../Utils/Color.h"
- #include "../Utils/GlobalVars.h"
- #include "config.h"
- Menu g_Menu;
- bool manually_set_key = false;
- /*
- *
- * CREDITS TO : stickrpg
- *
- * BEST MENU FRAMEWORK IN EXISTENCE
- *
- */
- enum TABS
- {
- Aimbot = 0,
- Visuals = 1,
- Misc = 2
- };
- #define or ||
- #define and &&
- int TopLeftGroupBox_X = 5;
- int TopLeftGroupBox_Y = 52 + (309 / 1.5) + 5;
- int GroupBoxSize_Width = 350;
- int GroupBoxSize_Height = 510;
- void GradientV(int x, int y, int w, int h, Color c1, Color c2)
- {
- g_pSurface->FilledRect(x, y, w, h, c1);
- BYTE first = c2.red;
- BYTE second = c2.green;
- BYTE third = c2.blue;
- for (int i = 0; i < h; i++)
- {
- float fi = i, fh = h;
- float a = fi / fh;
- DWORD ia = a * 255;
- g_pSurface->FilledRect(x, y + i, w, 1, Color(first, second, third, ia));
- }
- }
- void GradientVEnd(int x, int y, int w, int h, Color c1, Color c2)
- {
- //g_pSurface->FilledRect(x, y, w, h, c1);
- BYTE first = c2.red;
- BYTE second = c2.green;
- BYTE third = c2.blue;
- for (float i = 0; i < h / 1.5; i++)
- {
- float fi = i, fh = h / 1.5;
- float a = fi / fh;
- DWORD ia = a * 255;
- g_pSurface->FilledRect(x, y + i, w, 2, Color(first, second, third, ia));
- }
- }
- void DrawESPPlayersSubTab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
- {
- int in_sizew_esp_player_subtabs = (375 / 1.5) - 8;
- static std::string ESP_Player_SubTabs_Names[3] = {"Main", "Main PT 2", "Model"};
- for (int i = 0; i < tab_amount; i++)
- {
- RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
- int tab_area[4] = {
- _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + 52 + 5,
- (in_sizew_esp_player_subtabs / tab_amount), 20
- };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
- tab_area[3]))
- current_players_esp_subtab = i;
- if (current_players_esp_subtab == i)
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(50, 50, 50, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- else
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- }
- }
- void DrawAimbotTargetSubTab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
- {
- int in_sizew_esp_player_subtabs = (375 / 1.5) - 8;
- static std::string ESP_Player_SubTabs_Names[2] = {"Target", "Body-Aim"};
- for (int i = 0; i < tab_amount; i++)
- {
- RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
- int tab_area[4] = {
- _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + TopLeftGroupBox_Y + 5,
- (in_sizew_esp_player_subtabs / tab_amount), 20
- };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
- tab_area[3]))
- current_players_esp_subtab = i;
- // g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(23, 23, 25, MenuAlpha_Main));
- if (current_players_esp_subtab == i)
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(50, 50, 50, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- else
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- }
- } //
- void DrawAimbotAccuracy_Subtab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
- {
- int in_sizew_esp_player_subtabs = GroupBoxSize_Width - 8;
- static std::string ESP_Player_SubTabs_Names[5] = {"Auto", "Scout", "Awp", "H. Pistol", "Other"};
- for (int i = 0; i < tab_amount; i++)
- {
- RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
- int tab_area[4] = {
- _pos.x + TopLeftGroupBox_X + GroupBoxSize_Width + 5 + 4 + (i * (in_sizew_esp_player_subtabs / tab_amount)),
- _pos.y + 52 + 5, (in_sizew_esp_player_subtabs / tab_amount), 20
- };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
- tab_area[3]))
- current_players_esp_subtab = i;
- if (current_players_esp_subtab == i)
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(50, 50, 50, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- else
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- }
- }
- void DrawAntiAim_Subtab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
- {
- int in_sizew_esp_player_subtabs = GroupBoxSize_Width - 8;
- static std::string ESP_Player_SubTabs_Names[4] = {"Standing", "Moving", "Air", "Misc"};
- for (int i = 0; i < tab_amount; i++)
- {
- RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
- int tab_area[4] = {
- _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + 52 + 5,
- (in_sizew_esp_player_subtabs / tab_amount), 20
- };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
- tab_area[3]))
- current_players_esp_subtab = i;
- if (current_players_esp_subtab == i)
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(50, 50, 50, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- else
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- }
- } //
- #include <tuple>
- class vars : public singleton< vars > {
- private:
- public:
- bool visuals_box = false;
- };
- void DrawAimbotMain_Subtab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
- {
- int in_sizew_esp_player_subtabs = GroupBoxSize_Width - 8;
- static std::string ESP_Player_SubTabs_Names[2] = {"Main", "Resolver"};
- for (int i = 0; i < tab_amount; i++)
- {
- RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
- int tab_area[4] = {
- _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + 52 + 5,
- (in_sizew_esp_player_subtabs / tab_amount), 20
- };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
- tab_area[3]))
- current_players_esp_subtab = i;
- if (current_players_esp_subtab == i)
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(50, 50, 50, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- else
- {
- g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
- //g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
- Color(143, 143, 143, MenuAlpha_Main), Globals::SmallText, false,
- ESP_Player_SubTabs_Names[i].c_str());
- }
- // g_pSurface->OutlinedRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(40, 44, 53, MenuAlpha_Main));
- }
- } //
- std::ptrdiff_t ExtraOffsets::deadflag = NULL;
- std::string config_slots[8] = {
- "Slot 1", "Slot 2", "Slot 3", "Slot 4", "Slot 5", "Slot 6", "Slot 7", "Slot 8"
- };
- static int save_slot = 0;
- #include "../Features/Visuals/EventLogging.h"
- void Save_Config()
- {
- Config2->Save(config_slots[save_slot]);
- std::string string_to_add;
- string_to_add += "saved '";
- string_to_add += config_slots[save_slot];
- string_to_add += "'.";
- c_event_logs::get().add(string_to_add, Color(255, 255, 255, 255));
- }
- void Load_Config()
- {
- Config2->Load(config_slots[save_slot]);
- std::string string_to_add;
- string_to_add += "loaded '";
- string_to_add += config_slots[save_slot];
- string_to_add += "'.";
- c_event_logs::get().add(string_to_add, Color(255, 255, 255, 255));
- }
- void Export_Config()
- {
- Config2->export_to_clipboard("export");
- }
- void Import_Config()
- {
- Config2->import_from_clipboard("import");
- }
- void Save()
- {
- std::string ConfigName;
- switch (2)
- {
- case 0: ConfigName = "1";
- break;
- case 1: ConfigName = "2";
- break;
- case 2: ConfigName = "3";
- break;
- case 3: ConfigName = "4";
- break;
- case 4: ConfigName = "5";
- break;
- }
- Config2->Save(ConfigName);
- }
- void GradientH(int x, int y, int w, int h, Color c1, Color c2)
- {
- g_pSurface->FilledRect(x, y, w, h, c1);
- BYTE first = c2.red;
- BYTE second = c2.green;
- BYTE third = c2.blue;
- for (int i = 0; i < w; i++)
- {
- float fi = i, fw = w;
- float a = fi / fw;
- DWORD ia = a * 255;
- g_pSurface->FilledRect(x + i, y, w, h, Color(first, second, third, ia));
- }
- }
- #include <experimental/filesystem>
- #include <filesystem>
- #include <iostream>
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- using namespace std;
- #include "../SDK/ClientClass.h"
- #include "../SDK/IBaseClientDll.h"
- DWORD FindSig(DWORD dwAddress, DWORD dwLength, const char* szPattern)
- {
- if (!dwAddress || !dwLength || !szPattern)
- return 0;
- const char* pat = szPattern;
- DWORD firstMatch = NULL;
- for (DWORD pCur = dwAddress; pCur < dwLength; pCur++)
- {
- if (!*pat)
- return firstMatch;
- if (*(PBYTE)pat == '\?' || *(BYTE*)pCur == GET_BYTE(pat))
- {
- if (!firstMatch)
- firstMatch = pCur;
- if (!pat[2])
- return firstMatch;
- if (*(PWORD)pat == '\?\?' || *(PBYTE)pat != '\?')
- pat += 3;
- else pat += 2;
- }
- else
- {
- pat = szPattern;
- firstMatch = 0;
- }
- }
- return 0;
- }
- DWORD FindSignaturenew(const char* szModuleName, const char* PatternName, char* szPattern)
- {
- HMODULE hModule = GetModuleHandleA(szModuleName);
- PIMAGE_DOS_HEADER pDOSHeader = (PIMAGE_DOS_HEADER)hModule;
- PIMAGE_NT_HEADERS pNTHeaders = (PIMAGE_NT_HEADERS)(((DWORD)hModule) + pDOSHeader->e_lfanew);
- DWORD ret = FindSig(((DWORD)hModule) + pNTHeaders->OptionalHeader.BaseOfCode, ((DWORD)hModule) + pNTHeaders->OptionalHeader.SizeOfCode, szPattern);;
- return ret;
- }
- void ForceDaUpdate() {
- }
- std::string text_uwu;
- bool dont_recieve_input = false;
- void Menu::Render()
- {
- static bool _pressed = true;
- if (!_pressed && GetAsyncKeyState(VK_INSERT))
- _pressed = true;
- else if (_pressed && !GetAsyncKeyState(VK_INSERT))
- {
- _pressed = false;
- menuOpened = !menuOpened;
- }
- g_pEngine->GetScreenSize(screen_width, screen_width);
- static Vector2D _mouse_pos;
- static int groupbox_bottom;
- static int _drag_x = 300;
- static int _drag_y = 300;
- //int _width = 514;
- //int _height = 473; //
- int _width = 800;
- int _height = 600; //
- static Vector2D oldPos;
- static Vector2D mousePos;
- static bool _dragging = false;
- bool _click = false;
- static bool _resizing = false;
- g_InputSystem->EnableInput(!menuOpened);
- if (menuOpened)
- {
- MenuAlpha_Main = min(MenuAlpha_Main + 15, 255);
- MenuAlpha_Text = min(MenuAlpha_Text + 5, 255);
- //MenuAlpha_Main = 255;
- //MenuAlpha_Text = 255;
- if (GetAsyncKeyState(VK_LBUTTON))
- _click = true;
- Vector2D _mouse_pos = g_pSurface->GetMousePosition();
- if (_dragging and !_click)
- _dragging = false;
- if (_resizing and !_click)
- _resizing = false;
- if (_dragging and _click)
- {
- _pos.x = _mouse_pos.x - _drag_x;
- _pos.y = _mouse_pos.y - _drag_y;
- }
- if (g_pSurface->MouseInRegion(_pos.x, _pos.y, _width, _height) && !(g_pSurface->MouseInRegion(
- _pos.x + 10, _pos.y + 20, _width - 10, _height - 10)))
- {
- _dragging = true;
- _drag_x = _mouse_pos.x - _pos.x;
- _drag_y = _mouse_pos.y - _pos.y;
- }
- // if (mouse_in_params(_pos.x + 20, _pos.y + 20, _width - 10, _height - 10))
- // {
- // _resizing = true;
- // }
- }
- else
- {
- MenuAlpha_Main = max(MenuAlpha_Main - 15, 0);
- MenuAlpha_Text = max(MenuAlpha_Text - 25, 0);
- }
- int sum = 0;
- int x;
- ifstream inFile;
- string path;
- static string username;
- static string rent;
- static bool GrabName = true;
- if (GrabName) {
- path = getenv("appdata");
- path += "\\xd";
- inFile.open(path);
- inFile >> username >> rent;
- cout << username << rent << endl;
- GrabName = false;
- }
- static bool state = false;
- static float alp = 0;
- alp += 0.65f;
- if (alp > 255)
- alp = 0;
- if (!menuOpened)
- alp = 0;
- //main window
- g_pSurface->FilledRect(_pos.x, _pos.y - 60, 800, 660, Color(0, 0, 0, MenuAlpha_Main));
- //up poloska
- g_pSurface->FilledRect(_pos.x, _pos.y - 60, 800, 20, Color(0, 0, 0, MenuAlpha_Main));
- //down//
- g_pSurface->FilledRect(_pos.x, _pos.y - 38, 800, 92, Color(0, 0, 0, MenuAlpha_Main));
- //poloska
- g_pSurface->FilledRect(_pos.x, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 75, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 150, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 225, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 300, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 375, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 450, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 525, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 600, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 675, _pos.y - 40, 75, 2, Color(255, 125, 150, alp));
- g_pSurface->FilledRect(_pos.x + 750, _pos.y - 40, 50, 2, Color(255, 125, 150, alp));
- g_pSurface->DrawT(_pos.x + 15, _pos.y - 15, Color(255, 255, 255, MenuAlpha_Main), Globals::MyMainFont, false, "UNHITTABLE");
- int in_sizew = 514 - 1;
- static int tab_selected = 0;
- static const int tab_amount = 6;
- static std::string tab_names[tab_amount] = { "Legit", "Rage", "Anti-Hit", "Visuals", "Misc", "Skins" };
- //TAAAABSBSBBSSBBSS
- for (int i = 0; i < tab_amount; i++)
- {
- RECT text_size = g_pSurface->GetTextSizeRect(Globals::TabFont, tab_names[i].c_str());
- int tab_area[4] = { _pos.x + 280 + (i * (in_sizew / tab_amount)), _pos.y - 40, (in_sizew / tab_amount), 80 };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
- tab_area[3]))
- tab_selected = i;
- if (tab_selected == i)
- {
- g_pSurface->FilledRect(tab_area[0] + 14, tab_area[1] + tab_area[3] - 20, tab_area[2] - 25, 1, Color(156, 25, 74, MenuAlpha_Main));
- g_pSurface->DrawT(tab_area[0] + (((in_sizew / tab_amount) / 2) - (text_size.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size.bottom / 2), Color(255, 255, 255, MenuAlpha_Text),
- Globals::TabFont, false, tab_names[i].c_str());
- }
- else
- {
- g_pSurface->DrawT(tab_area[0] + (((in_sizew / tab_amount) / 2) - (text_size.right / 2)),
- tab_area[1] + (tab_area[3] / 2) - (text_size.bottom / 2), Color(150, 150, 150, MenuAlpha_Text),
- Globals::TabFont, false, tab_names[i].c_str());
- }
- }
- //FUNNCNCNCNCNCNCNCNC
- static int aimbot_main_subtab = 0;
- std::string pitch[5] = { "Disabled", "Down", "Up", "Origin", "Offset" };
- std::string BodyAimOptions[5] = { "In Air", "Slow Walk", "High Inaccuracy", "Vulnerable", "Lethal" };
- std::string AutoStopOptions[4] = { "Minimum Speed", "Full Stop" };
- std::string BodyAimModeOptions[2] = { "Prefer", "Force" };
- if (tab_selected == 0)
- {
- g_pSurface->FilledRect(_pos.x + 10, _pos.y + 60, 780, 530, Color(0, 0, 0, MenuAlpha_Main));
- groupbox(20, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Legit");
- checkbox("Enabled", &c_config::get().legit_aimbot_enabled);
- checkbox("Backtrack", &c_config::get().legit_aimbot_backtrack);
- checkbox("Enabled RCS", &c_config::get().rcs);
- SliderInt(100, "RCS pitch", &c_config::get().rcs_x, "", 1);
- SliderInt(100, "RCS yaw", &c_config::get().rcs_y, "", 1);
- groupbox(430, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Weapons");
- std::string Weaponss[7] = { "Auto", "Scout", "AWP", "Heavy Pistols", "Pistols", "Rifles", "Other" };
- static int CurrentKeybind = 0;
- combobox(7, "Weapon", Weaponss, &CurrentKeybind);
- switch (CurrentKeybind)
- {
- case 0:
- SliderInt(100, "Fov Auto", &c_config::get().auto_fov, "", 1);
- SliderInt(100, "Smooth Auto", &c_config::get().auto_smot, "speed", 1);
- break;
- case 1:
- SliderInt(100, "Fov Scout", &c_config::get().scout_fov, "", 1);
- SliderInt(100, "Smooth Scout", &c_config::get().scout_smot, "speed", 1);
- break;
- case 2:
- SliderInt(100, "Fov AWP", &c_config::get().awp_fov, "", 1);
- SliderInt(100, "Smooth AWP", &c_config::get().awp_smot, "speed", 1);
- break;
- case 3:
- SliderInt(100, "Fov Heavy Pistols", &c_config::get().heavy_pistol_fov, "", 1);
- SliderInt(100, "Smooth Heavy Pistols", &c_config::get().heavy_pistol_smot, "speed", 1);
- break;
- case 4:
- SliderInt(100, "Fov Pistols", &c_config::get().pistolss_fov, "", 1);
- SliderInt(100, "Smooth Pistols", &c_config::get().pistolss_smot, "speed", 1);
- break;
- case 5:
- SliderInt(100, "Fov Rifles", &c_config::get().rifles_fov, "", 1);
- SliderInt(100, "Smooth Rifles", &c_config::get().rifles_smot, "speed", 1);
- break;
- case 6:
- SliderInt(100, "Fov Other", &c_config::get().other_fov, "", 1);
- SliderInt(100, "Smooth Other", &c_config::get().other_smot, "speed", 1);
- break;
- }
- }
- else if (tab_selected == 1)
- {
- g_pSurface->FilledRect(_pos.x + 10, _pos.y + 60, 780, 530, Color(0, 0, 0, MenuAlpha_Main));
- groupbox(20, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Main aim");
- checkbox("Enabled", &c_config::get().aimbot_enabled);
- checkbox("Silent Aim", &c_config::get().aimbot_silentaim);
- checkbox("Remove Recoil", &c_config::get().aimbot_norecoil);
- checkbox("Fakelag Prediction", &c_config::get().fakelag_prediction);
- checkbox("Auto Stop", &c_config::get().autostop);
- if (c_config::get().autostop)
- combobox(2, "", AutoStopOptions, &c_config::get().autostop_mode);
- if (c_config::get().autostop)
- checkbox("Stop Between Shots", &c_config::get().stop_inbetween_shots);
- checkbox("Auto Scope", &c_config::get().auto_scope);
- checkbox("Auto Revolver", &c_config::get().autorevolver);
- checkbox("Accuracy Boost", &c_config::get().accuracy_boost);
- checkbox("Resolver", &c_config::get().aimbot_resolver);
- std::string Hitboxes[5] = { "Head", "Chest", "Stomach", "Arms", "Foot" };
- MultiComboBox(5, "Hitbox to scan", { "Head", "Chest", "Stomach", "Arms", "Foot" }, c_config::get().hitboxesscan);
- SliderInt(100, "Head Scale", &c_config::get().aimbot_headpointscale, "%", 1);
- SliderInt(100, "Body Scale", &c_config::get().aimbot_bodypointscale, "%", 1);
- MultiComboBox(5, "Body-Aim", { "In Air", "Slow Walk", "High Inaccuracy", "Vulnerable", "Lethal" }, c_config::get().prefer_bodyaim);
- //combobox(2, "Baim mode", BodyAimModeOptions, &c_config::get().bodyaim_mode);
- groupbox(430, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Weapon Settings");
- std::string Weaponss[7] = { "Auto", "Scout", "AWP", "Heavy Pistols", "Pistols", "Rifles", "Other" };
- static int CurrentKeybind = 0;
- combobox(7, "Weapon", Weaponss, &CurrentKeybind);
- switch (CurrentKeybind)
- {
- case 0:
- SliderInt(100, "Hitchance Auto", &c_config::get().auto_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage Auto", &c_config::get().auto_mindamage, "HP", 1);
- break;
- case 1:
- SliderInt(100, "Hitchance Scout", &c_config::get().scout_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage Scout", &c_config::get().scout_mindamage, "HP", 1);
- break;
- case 2:
- SliderInt(100, "Hitchance AWP", &c_config::get().awp_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage AWP", &c_config::get().awp_mindamage, "HP", 1);
- break;
- case 3:
- SliderInt(100, "Hitchance Heavy Pistols", &c_config::get().heavy_pistol_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage Heavy Pistols", &c_config::get().heavy_pistol_mindamage, "HP", 1);
- break;
- case 4:
- SliderInt(100, "Hitchance Pistols", &c_config::get().pistolss_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage Pistols", &c_config::get().pistolss_mindamage, "HP", 1);
- break;
- case 5:
- SliderInt(100, "Hitchance Rifles", &c_config::get().rifles_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage Rifles", &c_config::get().rifles_mindamage, "HP", 1);
- break;
- case 6:
- SliderInt(100, "Hitchance Other", &c_config::get().other_hitchance, "%", 1);
- SliderInt(100, "Minimum Damage Other", &c_config::get().other_mindamage, "HP", 1);
- break;
- }
- }
- else if (tab_selected == 2)
- {
- std::string pitch[5] = { "Disabled", "Down", "Up", "Origin", "Offset" };
- std::string yaw[5] = { "Disabled", "Backwards", "Origin", "Spin", "Manual" };
- std::string on_shot[2] = { "Anti backshoot", "Hide shoot" };
- std::string desync[5] = { "none", "Static", "Balance", "Lord", "Jitter" };
- std::string freestand_mode[3] = { "Threat", "Crosshair", "Distance" };
- g_pSurface->FilledRect(_pos.x + 10, _pos.y + 60, 780, 530, Color(0, 0, 0, MenuAlpha_Main));
- groupbox(20, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Anti-aims");
- checkbox("Enabled", &c_config::get().antiaim_enabled);
- SliderInt(14, "Fakelag", &c_config::get().fakelag, "Tick", 1);
- SliderInt(14, "Variance", &c_config::get().varianses, "V", 1);
- checkbox("Anti backshoot", &c_config::get().on_shot_aa);
- if (c_config::get().on_shot_aa)
- {
- combobox(2, "Anti backshoot type", on_shot, &c_config::get().on_shot_aa_type);
- }
- combobox(5, "Pitch Stand", pitch, &c_config::get().pitch_standing);
- combobox(5, "Yaw Stand", yaw, &c_config::get().yaw_standing);
- combobox(5, "Pitch Move", pitch, &c_config::get().pitch_moving);
- combobox(5, "Yaw Move", yaw, &c_config::get().yaw_moving);
- combobox(5, "Pitch Air", pitch, &c_config::get().pitch_air);
- combobox(5, "Yaw Air", yaw, &c_config::get().yaw_air);
- groupbox(430, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Misc Anti-aims");
- SliderInt(100, "Slow Walk", &c_config::get().slowwalk_speed, "%", 1);
- std::string KeyBindList[7] = { "Manual right", "Manual left", "Manual back", "Slow Walk", "Desync", "Fake duck", "Baim key" };
- static int CurrentKeybind = 0;
- combobox(7, "Keybind", KeyBindList, &CurrentKeybind);
- switch (CurrentKeybind)
- {
- case 0: keybind(&c_config::get().manual_swap_r, "Manual Right");
- break;
- case 1: keybind(&c_config::get().manual_swap_l, "Manual Left");
- break;
- case 2: keybind(&c_config::get().manual_swap_b, "Manual Back");
- break;
- case 3: keybind(&c_config::get().slowwalk_bind, "Slow Walk");
- break;
- case 4: keybind(&c_config::get().desync_swap_bind, "Desync Spaw");
- break;
- case 5: keybind(&c_config::get().fake_duck_bind, "Fake duck");
- break;
- case 6: keybind(&c_config::get().baim_key_bind, "Baim key");
- break;
- }
- checkbox("Desync anim", &c_config::get().desync_enabled);
- combobox(5, "Desync", desync, &c_config::get().desync);
- }
- else if (tab_selected == 3)
- {
- static int current_players_esp_subtab = 0;
- std::string WireFrameHands[3] = { "Disabled", "Invisible", "Chams" };
- std::string EventLogsOptions[5] = { "Weapon Purchase", "Player Hurt", "Player Killed" };
- g_pSurface->FilledRect(_pos.x + 10, _pos.y + 60, 780, 530, Color(0, 0, 0, MenuAlpha_Main));
- groupbox(20, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Visuals player");
- std::string Health_Type[3] = { "Disabled", "Normal", "Battery" };
- std::string Hitmarker_Type[2] = { "Disabled", "Arena Switch" };
- checkbox("Enabled", &c_config::get().visuals_enabled);
- color_selector("box_col", &c_config::get().box_esp_color_r, &c_config::get().box_esp_color_g, &c_config::get().box_esp_color_b, &c_config::get().box_esp_color_a);
- checkbox("Box", &c_config::get().box_enemies);
- checkbox("Health", &c_config::get().heal_enemy);
- color_selector("name_col", &c_config::get().name_esp_color_r, &c_config::get().name_esp_color_g, &c_config::get().name_esp_color_b, &c_config::get().name_esp_color_a);
- checkbox("Name", &c_config::get().name_enemies);
- color_selector("weapon_col", &c_config::get().weapon_esp_color_r, &c_config::get().weapon_esp_color_g, &c_config::get().weapon_esp_color_b, &c_config::get().weapon_esp_color_a);
- checkbox("Weapon", &c_config::get().weapon_enemies);
- if (c_config::get().weapon_enemies)
- {
- checkbox("Icon", &c_config::get().show_icon_when_possible_enemies);
- checkbox("Ammo", &c_config::get().ammo_enemy);
- }
- checkbox("Flags", &c_config::get().flags_enemy);
- color_selector("glow_col", &c_config::get().glow_esp_color_r, &c_config::get().glow_esp_color_g, &c_config::get().glow_esp_color_b, &c_config::get().glow_esp_color_a);
- checkbox("Glow", &c_config::get().glow_enemies);
- color_selector("chams_col", &c_config::get().chams_esp_color_r, &c_config::get().chams_esp_color_g, &c_config::get().chams_esp_color_b, &c_config::get().chams_esp_color_a);
- checkbox("Visible chams", &c_config::get().chams_enemies);
- color_selector("chams_xqz_col", &c_config::get().chams_xqz_esp_color_r, &c_config::get().chams_xqz_esp_color_g, &c_config::get().chams_xqz_esp_color_b, &c_config::get().chams_xqz_esp_color_a);
- checkbox("Hidden chams", &c_config::get().chams_xqz_enemies);
- color_selector("local_cham_col", &c_config::get().local_chams_color_r, &c_config::get().local_chams_color_g, &c_config::get().local_chams_color_b, &c_config::get().local_chams_color_a);
- checkbox("Local Chams", &c_config::get().local_chams);
- color_selector("local_glow_col", &c_config::get().local_glow_color_r, &c_config::get().local_glow_color_g, &c_config::get().local_glow_color_b, &c_config::get().local_glow_color_a);
- checkbox("Local Glow", &c_config::get().local_glow);
- color_selector("local__fake_cham_col", &c_config::get().local_fake_chams_color_r, &c_config::get().local_fake_chams_color_g, &c_config::get().local_fake_chams_color_b, &c_config::get().local_fake_chams_color_a);
- checkbox("Local Desync Chams", &c_config::get().local_fake_chams);
- groupbox(430, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Other Visuals");
- checkbox("Hit Marker", &c_config::get().hitmarker);
- combobox(2, "Hit Sound", Hitmarker_Type, &c_config::get().hitmarker_sound);
- checkbox("Grenade Prediction", &c_config::get().grenade_prediction);
- SliderInt(135, "FOV", &c_config::get().fov, "\B0", 90);
- checkbox("FOV IF ZOOM", &c_config::get().fov_while_zoomed);
- SliderInt(135, "Viewmodel Field Of View", &c_config::get().viewmodel_fov, "\B0", 90);
- checkbox("Nightmode", &c_config::get().nightmode);
- SliderInt(100, "Nightmode brightness", &c_config::get().brightness, "%", 25);
- checkbox("Transparent Props", &c_config::get().transparent_props);
- SliderInt(135, "Thirdperson Distance", &c_config::get().thirdperson_distance, "m", 1);
- keybind(&c_config::get().thirdperson_bind, "Thirdperson");
- checkbox("Remove Visual Recoil", &c_config::get().remove_visual_recoil);
- std::string nosmoke_type[3] = { "Disabled", "No Draw", "Wireframe" };
- checkbox("Force Crosshair", &c_config::get().force_crosshair);
- checkbox("Autowall Crosshair", &c_config::get().penetration_crosshair);
- checkbox("No Smoke", &c_config::get().no_smoke);
- checkbox("No Flash", &c_config::get().remove_flash);
- checkbox("Remove Scope", &c_config::get().remove_scope);
- MultiComboBox(3, "Event Logger", { "Weapon Purchase", "Player Hurt", "Player Killed" }, c_config::get().event_logger);
- }
- else if (tab_selected == 4)
- {
- g_pSurface->FilledRect(_pos.x + 10, _pos.y + 60, 780, 530, Color(0, 0, 0, MenuAlpha_Main));
- groupbox(20, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Misc");
- checkbox("Bhop", &c_config::get().misc_bhop);
- checkbox("Auto Strafe", &c_config::get().misc_autostrafe);
- checkbox("Fast duck", &c_config::get().misc_fastcrouch);
- checkbox("ClanTag", &c_config::get().misc_clantag);
- checkbox("Buy-Bot", &c_config::get().misc_buy);
- if (c_config::get().misc_buy)
- {
- const char* main[] = { "Auto", "Awp", "Scout" };
- const char* second[] = { "Deagle&Revolver", "Dual" };
- const char* other[] = { "Vesthelm", "None" };
- const char* grenade[] = { "None", "All" };
- std::string one[3] = { "Auto", "Awp", "Scout" };
- std::string two[2] = { "Heavy Pistol", "Dual" };
- std::string sri[2] = { "None", "All" };
- std::string four[2] = { "None", "All" };
- combobox(3, "Main Weapon", one, &c_config::get().misc_primary);
- combobox(2, "Second Weapon", two, &c_config::get().misc_second);
- combobox(2, "Armor", sri, &c_config::get().misc_armor);
- MultiComboBox(7, "Other", { "Flashbang", "Decoy Grenade", "Smoke Grenade", "High-explosive (HE) Grenade", "Flame Grenade (Molotov & Incendiary Grenade)", "Defuse", "Taser" }, c_config::get().misc_grenade);
- }
- groupbox(430, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Configs");
- //color_selector("Menu theme", &c_config::get().menu_color_r, &c_config::get().menu_color_g, &c_config::get().menu_color_b, &c_config::get().menu_color_a);
- checkbox("Anti Untrusted", &c_config::get().misc_antiuntrusted);
- combobox(8, "CFG", config_slots, &save_slot);
- button(Save_Config, "Save");
- button(Load_Config, "Load");
- }
- else if (tab_selected == 5)
- {
- g_pSurface->FilledRect(_pos.x + 10, _pos.y + 60, 780, 530, Color(0, 0, 0, MenuAlpha_Main));
- std::string knife_options[15] = {
- "Default",
- "M9 Bayonet",
- "Bayonet",
- "Flip",
- "Gut",
- "Karambit",
- "Huntsman",
- "Falchion",
- "Bowie",
- "Butterfly",
- "Shadow Daggers",
- "Navaja",
- "Stiletto",
- "Ursus",
- "Talon"
- };
- std::string skin_list[17] = {
- "None",
- "Candy Apple",
- "Skulls",
- "Gunsmoke",
- "Bulldozer",
- "Carbon Fiber",
- "Ultraviolet",
- "Death By Kitty",
- "Emerald",
- "Dragon King",
- "Doppler",
- "Monkey Business",
- "Sun In Leo",
- "Gamma Doppler",
- "Aloha",
- "White Out",
- "Cyrex"
- };
- std::string weapon_options[10] = {
- "Knife",
- "Scar20",
- "G3SG1",
- "SSG08",
- "AK47",
- "M4A4",
- "M4A1-S",
- "DEAGLE",
- "REVOLVER",
- "CZ75"
- };
- groupbox(20, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Knife");
- combobox(15, "Knife model", knife_options, &c_config::get().knife_model);
- combobox(17, "Knife Skin", skin_list, &c_config::get().knife_skin);
- groupbox(430, 70, GroupBoxSize_Width, GroupBoxSize_Height, "Weapons");
- combobox(17, "M4A4 Skin", skin_list, &c_config::get().m4a4_skin);
- combobox(17, "M4A1-S Skin", skin_list, &c_config::get().m4a1_s_skin);
- combobox(17, "Ak-47 Skin", skin_list, &c_config::get().ak47_skin);
- combobox(17, "G3sg1 Skin", skin_list, &c_config::get().g3sg1_skin);
- combobox(17, "Scar-20 Skin", skin_list, &c_config::get().scar20_skin);
- combobox(17, "SG556 Skin", skin_list, &c_config::get().sg556_skin);
- combobox(17, "R8 Skin", skin_list, &c_config::get().r8_skin);
- combobox(17, "Tec-9 Skin", skin_list, &c_config::get().tec9_skin);
- combobox(17, "Deagle Skin", skin_list, &c_config::get().deagle_skin);
- combobox(17, "Dual Skin", skin_list, &c_config::get().dualelites_skin);
- combobox(17, "Usp Skin", skin_list, &c_config::get().usps_skin);
- combobox(17, "Ssg-08 Skin", skin_list, &c_config::get().ssg08_skin);
- /*static int SelectedWeapon;
- if (SelectedWeapon == 0) {
- this->ListBox(5, 50, GroupBoxSize_Width / 1.5, (GroupBoxSize_Height * 2) + 5, 10, "Weapon", weapon_options, &SelectedWeapon);
- this->ListBox(5 + (GroupBoxSize_Width / 1.5) + 5, 50, GroupBoxSize_Width / 1.5 - 4, (GroupBoxSize_Height * 2) + 5, 15, "Knife Model", knife_options, &c_config::get().knife_model);
- this->ListBox(5 + ((GroupBoxSize_Width / 1.5) * 2) + 5, 50, GroupBoxSize_Width / 1.5, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().knife_skin);
- }
- else {
- this->ListBox(5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 10, "Weapon", weapon_options, &SelectedWeapon);
- switch (SelectedWeapon) {
- case 1: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 16, "Skin", skin_list, &c_config::get().scar20_skin); break;
- case 2: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 16, "Skin", skin_list, &c_config::get().g3sg1_skin); break;
- case 3: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().ssg08_skin); break;
- case 4: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().ak47_skin); break;
- case 5: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().m4a4_skin); break;
- case 6: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().m4a1_s_skin); break;
- case 7: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().deagle_skin); break;
- case 8: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().r8_skin); break;
- case 9: this->ListBox(5 + GroupBoxSize_Width + 5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 17, "Skin", skin_list, &c_config::get().cz75_skin); break;
- }
- }*/
- }
- else if (tab_selected == 6)
- {
- DoPlayerList(5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5);
- }
- }
- void Menu::DoPlayerList(int x, int y, int w, int h) {
- g_pSurface->FilledRect(_pos.x + x, _pos.y + y, w, h, Color(25, 26, 33, MenuAlpha_Main));
- g_pSurface->OutlinedRect(_pos.x + x, _pos.y + y, w, h, Color(40, 44, 53, MenuAlpha_Main));
- g_pSurface->FilledRect(_pos.x + x + 1, _pos.y + y + 1, w - 2, 15, Color(31, 31, 38, MenuAlpha_Main));
- g_pSurface->Line(_pos.x + x + 1, _pos.y + y + 15, _pos.x + x + w - 2, _pos.y + y + 15, Color(40, 44, 53, MenuAlpha_Main));
- g_pSurface->DrawT(_pos.x + x + (w / 2), _pos.y + y + 1, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, true, "Players");
- if (g_pEngine->IsInGame() && g_pEngine->IsConnected()) {
- for (int i = 0; i < g_pGlobalVars->maxClients; i++) {
- auto Entity = g_pEntityList->GetClientEntity(i);
- if (!Globals::LocalPlayer || !Entity)
- continue;
- if (Entity->GetTeam() == Globals::LocalPlayer->GetTeam())
- continue;
- PlayerInfo_s EntityInfo;
- if (g_pEngine->GetPlayerInfo(i, &EntityInfo)) {
- auto SteamID = EntityInfo.iSteamID;
- PlayerList_Player[i] = SteamID;
- static int selected_player;
- RECT Area = { _pos.x + x, _pos.y + y + 17 + (16 * i), w, 15 };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(Area.left, Area.top, Area.right, Area.bottom) && menuOpened) {
- selected_player = SteamID;
- }
- if (selected_player == SteamID) {
- g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(28, 28, 35, MenuAlpha_Main));
- }
- else {
- g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(21, 21, 28, MenuAlpha_Main));
- }
- g_pSurface->OutlinedRect(Area.left, Area.top, Area.right, Area.bottom, Color(40, 44, 53, MenuAlpha_Main));
- g_pSurface->DrawT(Area.left + (Area.right / 2), Area.top + 1, Color(143, 143, 143, MenuAlpha_Main), Globals::MenuSub, true, EntityInfo.szName);
- }
- }
- }
- }
- void Menu::groupbox(int x, int y, int w, int h, std::string name, bool dont_draw, bool has_subtabs)
- {
- if (!dont_draw)
- {
- // g_pSurface->OutlinedRect(_pos.x + x - 1, _pos.y + y - 1, w + 2, h + 2, Color(0, 0, 0, 185));
- g_pSurface->FilledRect(_pos.x + x, _pos.y + y, w, h, Color(0, 0, 0, MenuAlpha_Main));
- g_pSurface->OutlinedRect(_pos.x + x, _pos.y + y, w, h, Color(120, 120, 120, MenuAlpha_Main));
- g_pSurface->DrawT(_pos.x + x + (w / 2), _pos.y + y, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, true, name.c_str());
- auto a = _pos;
- }
- int ItemsToDraw = h / 24;
- Vector2D a = g_pSurface->GetMousePosition();
- // x left 2 right (im braindead)
- groupbox_top = _pos.y + y;
- if (has_subtabs)
- {
- y_offset = (_pos.y + (y + 34));
- }
- else
- {
- y_offset = (_pos.y + (y + 12));
- }
- x_offset = _pos.x + x;
- groupbox_bottom = (_pos.y + (y + h));
- groupbox_width = (_pos.x + (x + w));
- }
- void Menu::ScrollableGroupBox(int x, int y, int w, int h)
- {
- static bool pressed = false;
- static int add;
- if (GetAsyncKeyState(VK_DOWN) & 1)
- {
- add += 16;
- }
- if (GetAsyncKeyState(VK_UP) & 1)
- {
- add -= 16;
- }
- y_offset = y_offset + add;
- }
- void Menu::checkbox(std::string name, bool* item)
- {
- if (groupbox_bottom <= y_offset + 21)
- return;
- int size = 15;
- static bool pressed = false;
- RECT text_size = g_pSurface->GetTextSizeRect(Globals::MenuSub, name.c_str());
- if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 6, y_offset, size + 17 + text_size.right,
- size) && !dont_recieve_input && menuOpened)
- {
- if (pressed)
- *item = !*item;
- pressed = false;
- }
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 6, y_offset, size + 17 + text_size.right, size) && !pressed)
- pressed = true;
- if (*item == true)
- {
- g_pSurface->FilledRect(x_offset + 5, y_offset, size, size, Color(255, 110, 135, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 6, y_offset + 1, size - 2, size - 2, Color(0, 0, 0, MenuAlpha_Main / 1.05));
- g_pSurface->OutlinedRect(x_offset + 5, y_offset, size, size, Color(255, 110, 135, MenuAlpha_Main / 1.05));
- g_pSurface->DrawT(x_offset + 25, y_offset, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, false, name.c_str());
- }
- else
- {
- g_pSurface->DrawT(x_offset + 25, y_offset, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, false, name.c_str());
- }
- if (g_pSurface->MouseInRegion(x_offset + 5, y_offset, size + 17 + text_size.right, size))
- {
- g_pSurface->OutlinedRect(x_offset + 5, y_offset, size, size, Color(255, 110, 135, MenuAlpha_Main / 1.05));
- }
- else
- {
- if (*item == false)
- {
- g_pSurface->OutlinedRect(x_offset + 5, y_offset, size, size, Color(255, 110, 135, MenuAlpha_Main / 1.05));
- }
- }
- y_offset += 21;
- }
- void Menu::combobox(int size, std::string name, std::string* itemname, int* item)
- {
- if (groupbox_bottom <= y_offset + 25)
- return;
- bool pressed = false;
- bool open = false;
- static bool selected_opened = false;
- static bool click_rest;
- static bool rest;
- static std::string name_selected;
- int ComboSize = GroupBoxSize_Width - 120;
- static int offset = 0;
- if (name == "")
- {
- offset = -3;
- }
- else
- {
- offset = 14;
- }
- if (menuOpened)
- {
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset + offset, ComboSize, 20)
- && !click_rest && !dont_recieve_input)
- {
- name_selected = name;
- pressed = true;
- click_rest = true;
- }
- else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
- x_offset + 20, y_offset + offset, ComboSize, 20))
- click_rest = false;
- if (pressed)
- {
- if (!rest)
- selected_opened = !selected_opened;
- rest = true;
- }
- else
- rest = false;
- if (name_selected == name)
- open = selected_opened;
- }
- g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, false,
- name.c_str());
- g_pSurface->FilledRect(x_offset + 20, y_offset + offset, ComboSize, 20, Color(195, 110, 135, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset, ComboSize, 20, Color(202, 45, 100, MenuAlpha_Main));
- if (open)
- {
- g_pSurface->FilledRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (size * 19),
- Color(195, 110, 135, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (size * 19),
- Color(202, 45, 100, MenuAlpha_Main));
- for (int i = 0; i < size; i++)
- {
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
- x_offset + 20, y_offset + offset + 4 + 4 + 15 + i * 19, ComboSize, 19))
- {
- *item = i;
- }
- if (i == *item)
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19,
- Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, false, itemname[i].c_str());
- else
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19,
- Color(150, 150, 150, MenuAlpha_Main), Globals::MenuSub, false, itemname[i].c_str());
- }
- }
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 3, Color(255, 255, 255, MenuAlpha_Main),
- Globals::MenuSub, false, itemname[*item].c_str());
- if (open) // i added 1 more to 42 bec the space between the main box and the drop down
- {
- if (name == "")
- {
- y_offset += 47 - 26 + (size * 19);
- }
- else
- {
- y_offset += 47 + (size * 19);
- }
- }
- else
- {
- if (name == "")
- {
- y_offset += 47 - 26;
- }
- else
- {
- y_offset += 41;
- }
- }
- }
- void Menu::SliderInt(int max, std::string name, int* item, std::string suffix, int step)
- {
- if (groupbox_bottom <= y_offset + 30)
- return;
- float SliderSize = GroupBoxSize_Width - 120;
- std::string gay2;
- gay2 += std::to_string(*item);
- gay2 += suffix.c_str();
- RECT Text_Size_Meme = g_pSurface->GetTextSizeRect(Globals::MenuSub, gay2.c_str());
- float _pixel_value = max / SliderSize;
- static bool opened = false;
- static bool initx = false;
- if (menuOpened)
- {
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20 - 3, y_offset + 14, SliderSize + (3 * 2), 16) && !dont_recieve_input && menuOpened)
- {
- *item = abs(g_pSurface->GetMousePosition().x - (x_offset + 20)) * _pixel_value;
- }
- if (g_pSurface->MouseInRegion(x_offset + (SliderSize) - 3, y_offset - 3, 6, 12) && !dont_recieve_input && menuOpened)
- {
- static bool hold = false;
- if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
- {
- hold = true;
- }
- else if (hold)
- {
- *item = *item - 1;
- hold = false;
- }
- }
- if (g_pSurface->MouseInRegion(x_offset + (SliderSize) - 13, y_offset - 3, 6, 12) && !dont_recieve_input && menuOpened)
- {
- static bool hold = false;
- if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
- {
- hold = true;
- }
- else if (hold)
- {
- *item = *item + 1;
- hold = false;
- }
- }
- static bool pressed_subtract = false;
- static bool pressed_add = false;
- }
- std::string namedisplay;
- namedisplay += name.c_str();
- if (*item > max)
- {
- *item = max;
- }
- if (*item < step)
- {
- *item = step;
- }
- g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, false, namedisplay.c_str());
- g_pSurface->FilledRect(x_offset + 20, y_offset + 14, SliderSize, 16, Color(195, 110, 135, MenuAlpha_Main));
- UINT hp = SliderSize - *item / max;
- int Red = 255 - ((SliderSize * (*item / _pixel_value) * 2.55));
- int Green = (SliderSize * (*item / _pixel_value) * 2.55);
- if (*item)
- {
- if (*item == max) //to fix dumb math stufffff bec pixel size
- g_pSurface->FilledRect(x_offset + 20, y_offset + 14, SliderSize, 16, Color(255, 110, 135, MenuAlpha_Main));
- else
- g_pSurface->FilledRect(x_offset + 20, y_offset + 14, (*item / _pixel_value), 16, Color(255, 110, 135, MenuAlpha_Main));
- }
- if (g_pSurface->MouseInRegion(x_offset + 20 - 3, y_offset + 14, SliderSize + (3 * 2), 16) && menuOpened)
- {
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + 14, SliderSize, 16, Color(202, 45, 100, MenuAlpha_Main));
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20 - 3, y_offset + 14, SliderSize + (3 * 2), 16) && menuOpened)
- {
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + 14, SliderSize, 16, Color(202, 45, 100, MenuAlpha_Main));
- }
- }
- else
- {
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + 14, SliderSize, 16, Color(202, 45, 100, MenuAlpha_Main));
- }
- g_pSurface->DrawT(x_offset + (SliderSize) - 10, y_offset, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, true, "+");
- g_pSurface->DrawT(x_offset + (SliderSize), y_offset, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, true, "-");
- g_pSurface->DrawT(x_offset + (SliderSize / 2), y_offset + 15, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, true, "%s%s", std::to_string(*item).c_str(), suffix.c_str());
- y_offset += 40;
- }
- void Menu::MultiComboBox(float indexes, std::string name, const std::vector<std::string> &itemname, bool* item)
- {
- static bool multiPressed = false;
- bool pressed = false;
- bool open = false;
- static bool selectedOpened = false;
- static bool clickRest;
- static bool rest;
- static std::string nameSelected;
- std::string itemsSelected = "";
- int lastItem = 0;
- int ComboSize = GroupBoxSize_Width - 120;
- int offset = 0;
- if (name == "")
- {
- offset = 0;
- }
- else
- {
- offset = 14;
- }
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset + offset, ComboSize, 17) && !clickRest
- )
- {
- nameSelected = name;
- pressed = true;
- clickRest = true;
- }
- else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset + offset, ComboSize, 20))
- clickRest = false;
- if (pressed)
- {
- if (!rest)
- selectedOpened = !selectedOpened;
- rest = true;
- }
- else
- rest = false;
- if (nameSelected == name)
- open = selectedOpened;
- g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(155, 155, 155, MenuAlpha_Main), Globals::MenuSub, false,
- name.c_str());
- g_pSurface->FilledRect(x_offset + 20, y_offset + offset - 2, ComboSize, 20, Color(195, 110, 135, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset - 2, ComboSize, 20, Color(202, 45, 100, MenuAlpha_Main));
- if (open)
- {
- g_pSurface->FilledRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (indexes * 19),
- Color(195, 110, 135, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (indexes * 19),
- Color(202, 45, 100, MenuAlpha_Main));
- for (int i = 0; i < indexes; i++)
- {
- if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
- x_offset + 20, y_offset + offset + 4 + 4 + 15 + i * 19, ComboSize, 20))
- {
- if (multiPressed)
- item[i] = !item[i];
- multiPressed = false;
- }
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
- x_offset + 20, y_offset + offset + 16 + (i * 19), ComboSize, 20) && !multiPressed)
- multiPressed = true;
- if (item[i])
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19, Color(255, 255, 255, MenuAlpha_Main),
- Globals::MenuSub, false, itemname[i].c_str());
- else
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19, Color(200, 200, 200, MenuAlpha_Main),
- Globals::MenuSub, false, itemname[i].c_str());
- }
- }
- bool items = false;
- for (int i = 0; i < indexes; i++)
- {
- if (item[i])
- {
- if (lastItem < i)
- lastItem = i;
- }
- }
- for (int i = 0; i < indexes; i++)
- {
- if (item[i])
- {
- items = true;
- RECT TextSize = g_pSurface->GetTextSizeRect(Globals::MenuSub, itemsSelected.c_str());
- RECT TextSizeGonaAdd = g_pSurface->GetTextSizeRect(Globals::MenuSub, itemname[i].c_str());
- if (TextSize.right + TextSizeGonaAdd.right < ComboSize)
- itemsSelected += itemname[i] + ((lastItem == i) ? "" : ", ");
- }
- }
- if (!items)
- itemsSelected = "-";
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 1, Color(255, 255, 255, MenuAlpha_Main), Globals::MenuSub, false,
- itemsSelected.c_str());
- if (open) // i added 1 more to 42 bec the space between the main box and the drop down
- y_offset += 52 + (indexes * 16);
- else
- y_offset += 41;
- }
- char* KeyStringsStick[254] = {
- "INVLD", "MOUSE 1", "MOUSE 2", "BRK", "MIDDLE MOUSE", "MOUSE 4", "MOUSE 5",
- "INVLD", "BSPC", "TAB", "INVLD", "INVLD", "INVLD", "ENTER", "INVLD", "INVLD", "SHIFT",
- "CTRL", "ALT", "PAU", "CAPS", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "ESC", "INVLD", "INVLD", "INVLD", "INVLD", "SPACE", "PGUP", "PGDOWN", "END", "HOME", "LEFT",
- "UP", "RIGHT", "DOWN", "INVLD", "PRNT", "INVLD", "PRTSCR", "INS", "DEL", "INVLD", "0", "1",
- "2", "3", "4", "5", "6", "7", "8", "9", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
- "V", "W", "X", "Y", "Z", "LFTWIN", "RGHTWIN", "INVLD", "INVLD", "INVLD", "NUM0", "NUM1",
- "NUM2", "NUM3", "NUM4", "NUM5", "NUM6", "NUM7", "NUM8", "NUM9", "*", "+", "_", "-", ".", "/", "F1", "F2", "F3",
- "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20",
- "F21",
- "F22", "F23", "F24", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "NUM LOCK", "SCROLL LOCK", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "LEFT SHIFT", "RIGHT SHFT", "LEFT CTRL",
- "RIGHT CTRL", "LMENU", "RMENU", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "NTRK", "PTRK", "STOP", "PLAY", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", ";", "+", ",", "-", ".", "/?", "~", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "{", "\\|", "}", "'\"", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
- "INVLD", "INVLD"
- };
- bool keys[256];
- bool oldKeys[256];
- bool GetKeyPress(unsigned int key)
- {
- if (keys[key] == true && oldKeys[key] == false)
- return true;
- return false;
- }
- void Menu::keybind(int* item, std::string name)
- {
- if (groupbox_bottom <= y_offset + 41)
- return;
- int ComboSize = GroupBoxSize_Width - 120; // 163
- static std::string nameSelected;
- static bool IsGettingKey = false;
- static int Key = 0;
- static bool GoodKeyName = false;
- Color text_color = Color(120, 120, 120, 255);
- std::copy(keys, keys + 255, oldKeys);
- for (int x = 0; x < 255; x++)
- {
- //oldKeys[x] = oldKeys[x] & keys[x];
- keys[x] = (GetAsyncKeyState(x));
- }
- char NameBuffer[128];
- char* KeyName = "Nope";
- RECT text_size = g_pSurface->GetTextSizeRect(Globals::MenuSub, KeyName);
- static bool LetsBindy0 = false;
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset, 157, 20) && menuOpened)
- {
- if (!IsGettingKey)
- {
- IsGettingKey = true;
- }
- }
- if (IsGettingKey)
- {
- for (int i = 0; i < 255; i++)
- {
- if (GetKeyPress(i))
- {
- if (i == VK_ESCAPE)
- {
- Key = -1;
- *item = Key;
- IsGettingKey = false;
- return;
- }
- Key = i;
- *item = Key;
- IsGettingKey = false;
- return;
- }
- }
- }
- if (IsGettingKey)
- {
- KeyName = "Press Key";
- text_color = Color(143, 143, 143, 255);
- }
- else
- {
- if (*item >= 0)
- {
- KeyName = KeyStringsStick[*item];
- if (KeyName)
- {
- GoodKeyName = true;
- }
- else
- {
- if (GetKeyNameText(*item << 16, NameBuffer, 127))
- {
- KeyName = NameBuffer;
- GoodKeyName = true;
- }
- }
- }
- if (!GoodKeyName)
- {
- KeyName = "Nope";
- }
- }
- if (manually_set_key)
- {
- Key = *item;
- manually_set_key = false;
- }
- std::string namedisplay;
- namedisplay += name.c_str();
- g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(195, 110, 135, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 20, y_offset, ComboSize, 20, Color(202, 45, 100, MenuAlpha_Main));
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + 3, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, false, KeyName);
- g_pSurface->DrawT(x_offset + 20 + 150, y_offset + 3, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, false, namedisplay.c_str());
- y_offset += 29;
- }
- unsigned int rgb(double hue)
- {
- int h = int(hue * 256 * 6);
- int x = h % 0x100;
- int r = 0, g = 0, b = 0;
- switch (h / 256)
- {
- case 0: r = 255;
- g = x;
- break;
- case 1: g = 255;
- r = 255 - x;
- break;
- case 2: g = 255;
- b = x;
- break;
- case 3: b = 255;
- g = 255 - x;
- break;
- case 4: b = 255;
- r = x;
- break;
- case 5: r = 255;
- b = 255 - x;
- break;
- }
- return r + (g << 8) + (b << 16);
- }
- void color_spectrum(int x, int y)
- {
- int Width = 168, Height = 179;
- for (int i = 0; i < Width; i++)
- {
- int div = Width / 6;
- int phase = i / div;
- float t = (i % div) / (float)div;
- int r, g, b;
- switch (phase)
- {
- case(0):
- r = 255;
- g = 255 * t;
- b = 0;
- break;
- case(1):
- r = 255 * (1.f - t);
- g = 255;
- b = 0;
- break;
- case(2):
- r = 0;
- g = 255;
- b = 255 * t;
- break;
- case(3):
- r = 0;
- g = 255 * (1.f - t);
- b = 255;
- break;
- case(4):
- r = 255 * t;
- g = 0;
- b = 255;
- break;
- case(5):
- r = 255;
- g = 0;
- b = 255 * (1.f - t);
- break;
- }
- for (int k = 0; k < Height; k++)
- {
- float sat = k / (float)Height;
- int _r = r + sat * (128 - r);
- int _g = g + sat * (128 - g);
- int _b = b + sat * (128 - b);
- g_pSurface->DrawSetColor(_r, _g, _b, 255);
- g_pSurface->DrawFilledRect(10 + i, 10 + k, 1, 1);
- }
- }
- }
- #include <conio.h>
- #include <iostream>
- #include <windows.h>
- #include <stdlib.h>
- void Menu::EmptySpace(std::string name)
- {
- if (groupbox_bottom <= y_offset + 16)
- return;
- g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, false,
- name.c_str());
- y_offset += 16;
- }
- void Menu::color_selector(std::string name, int* red, int* green, int* blue, int* alpha)
- {
- if (groupbox_bottom <= y_offset + 16)
- return;
- bool pressed = false;
- bool open = false;
- static bool selected_opened = false;
- static bool click_rest;
- static bool rest;
- static std::string name_selected;
- int ComboSize = 127; // 163
- int ComboSizeH = 127; // 163
- static int offset = 0;
- if (name == "sadasd")
- {
- offset = 0;
- }
- else
- {
- offset = 14;
- }
- if (menuOpened)
- {
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8) && !
- click_rest)
- {
- name_selected = name;
- pressed = true;
- click_rest = true;
- }
- else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8))
- click_rest = false;
- if (pressed)
- {
- if (!rest)
- selected_opened = !selected_opened;
- rest = true;
- }
- else
- rest = false;
- if (name_selected == name)
- open = selected_opened;
- }
- static unsigned int r = 255;
- static unsigned int g = 0;
- static unsigned int b = 0;
- static unsigned int selected_r = 0;
- static unsigned int selected_g = 0;
- static unsigned int selected_b = 0;
- static Vector2D MousePos;
- COLORREF color;
- COLORREF selected_color;
- if (open)
- {
- dont_recieve_input = true;
- g_pSurface->FilledRect(x_offset + 225 - ComboSize - 5, y_offset, ComboSize, ComboSizeH,
- Color(21, 23, 27, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5, y_offset, ComboSize, ComboSizeH,
- Color(42, 46, 46, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5 - 1, y_offset - 1, ComboSize + 2, ComboSizeH + 2,
- Color(34, 38, 37, MenuAlpha_Main));
- float _pixel_value = 255 / (ComboSize - 5 - 17);
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225 - ComboSize - 5 + 5,
- y_offset + ComboSizeH - 11, (ComboSize - 5 - 17),
- 7) && menuOpened)
- {
- *alpha = abs(g_pSurface->GetMousePosition().x - (x_offset + 225 - ComboSize - 5 + 5)) * _pixel_value;
- }
- if (*alpha < 3)
- {
- *alpha = 0;
- }
- if (*alpha > 204)
- {
- *alpha = 255;
- }
- g_pSurface->FilledRect(x_offset + 225 - ComboSize - 5 + 5, y_offset + ComboSizeH - 11, ComboSize - 5 - 17, 7,
- Color(255, 255, 255, *alpha));
- g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5 + 5, y_offset + ComboSizeH - 11, ComboSize - 5 - 17, 7,
- Color(0, 0, 0, MenuAlpha_Main));
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 233 - ComboSize + 101 + 1, y_offset + 5 + 1, 7 - 2, 107 - 1))
- {
- HDC hdc = GetDC(nullptr);
- color = GetPixel(hdc, g_pSurface->GetMousePosition().x, g_pSurface->GetMousePosition().y);
- r = GetRValue(color);
- g = GetGValue(color);
- b = GetBValue(color);
- }
- GradientH(x_offset + 225 - ComboSize - 5 + 5, y_offset + 5, ComboSize - 75, ComboSizeH - 20, Color(255, 255, 255), Color(r, g, b));
- GradientVEnd(x_offset + 225 - ComboSize - 5 + 5, y_offset + 40, ComboSize - 5 - 17, ComboSizeH - 20, Color(0, 0, 0), Color(0, 0, 0));
- g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5 + 5, y_offset + 5, ComboSize - 5 - 17, ComboSizeH - 20,
- Color(0, 0, 0, MenuAlpha_Main));
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225 - ComboSize - 5 + 5 + 1, y_offset + 5 + 1, ComboSize - 5 - 17 - 2, ComboSizeH - 20 - 2))
- {
- HDC hdc = GetDC(nullptr);
- selected_color = GetPixel(hdc, g_pSurface->GetMousePosition().x, g_pSurface->GetMousePosition().y);
- selected_r = GetRValue(selected_color);
- selected_g = GetGValue(selected_color);
- selected_b = GetBValue(selected_color);
- *red = selected_r;
- *green = selected_g;
- *blue = selected_b;
- MousePos = Vector2D(g_pSurface->GetMousePosition().x, g_pSurface->GetMousePosition().y);
- }
- Color rainbow; int hue;
- for (int i = 0; i < 100; i++)
- {
- float hue = (i * .01f);
- rainbow.FromHSV(hue, 1.f, 1.f);
- g_pSurface->FilledRect(x_offset + 233 - ComboSize + 101, y_offset + 5 + i, 7, 8, rainbow);
- g_pSurface->OutlinedRect(x_offset + 233 - ComboSize + 101, y_offset + 5, 7, 107, Color(0, 0, 0, 255));
- }
- }
- else
- {
- dont_recieve_input = false;
- }
- g_pSurface->FilledRect(x_offset + 225, y_offset, 15, 7, Color(*red, *green, *blue, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 225 - 1, y_offset - 1, 15 + 2, 7 + 2, Color(0, 0, 0, MenuAlpha_Main));
- if (open)
- {
- y_offset += 0;
- }
- }
- char* KeyDigits[254] = {
- nullptr, "Left Mouse", "Right Mouse", "Control+Break", "Middle Mouse", "Mouse 4", "Mouse 5",
- nullptr, "Backspace", "TAB", nullptr, nullptr, nullptr, "ENTER", nullptr, nullptr, "SHIFT", "CTRL", "ALT", "PAUSE",
- "CAPS LOCK", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "ESC", nullptr, nullptr, nullptr, nullptr,
- "SPACEBAR",
- "PG UP", "PG DOWN", "END", "HOME", "Left", "Up", "Right", "Down", nullptr, "Print", nullptr, "Print Screen",
- "Insert",
- "Delete", nullptr, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr,
- nullptr, "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
- "V", "W", "X",
- "Y", "Z", "Left Windows", "Right Windows", nullptr, nullptr, nullptr, "0", "1", "2", "3", "4", "5", "6",
- "7", "8", "9", "*", "+", "_", "-", ".", "/", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11",
- "F12",
- "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", nullptr, nullptr, nullptr,
- nullptr, nullptr,
- nullptr, nullptr, nullptr, "NUM LOCK", "SCROLL LOCK", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, "LSHIFT", "RSHIFT", "LCONTROL", "RCONTROL", "LMENU", "RMENU", nullptr,
- nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "Next Track", "Previous Track", "Stop", "Play/Pause",
- nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, ";", "+", ",", "-", ".", "/?", "~", nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "[{", "\\|", "}]", "'\"", nullptr, nullptr, nullptr,
- nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
- };
- void Menu::TextBox(std::string name, std::string* text)
- {
- if (groupbox_bottom <= y_offset + 16)
- return;
- bool pressed = false;
- bool open = false;
- static bool selected_opened = false;
- static bool click_rest;
- static bool rest;
- static std::string name_selected;
- int ComboSize = 127; // 163
- int ComboSizeH = 127; // 163
- static int offset = 0;
- if (name == "")
- {
- offset = 0;
- }
- else
- {
- offset = 14;
- }
- std::copy(keys, keys + 255, oldKeys);
- for (int x = 0; x < 255; x++)
- {
- //oldKeys[x] = oldKeys[x] & keys[x];
- keys[x] = (GetAsyncKeyState(x));
- }
- if (menuOpened)
- {
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8) && !
- click_rest)
- {
- name_selected = name;
- pressed = true;
- click_rest = true;
- }
- else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8))
- click_rest = false;
- if (pressed)
- {
- if (!rest)
- selected_opened = !selected_opened;
- rest = true;
- }
- else
- rest = false;
- if (name_selected == name)
- open = selected_opened;
- }
- const char* strg = text->c_str();
- if (open)
- {
- for (int i = 0; i < 255; i++)
- {
- if (GetKeyPress(i))
- {
- if (i == VK_ESCAPE || i == VK_RETURN || i == VK_INSERT)
- {
- open = false;
- return;
- }
- if (i == VK_BACK && strlen(strg) != 0)
- {
- *text = text->substr(0, strlen(strg) - 1);
- }
- if (strlen(strg) < 6 && (i == 0x30 || i == 0x31 || i == 0x32 || i == 0x33 || i == 0x34 || i == 0x35 || i
- == 0x36 || i == 0x37 || i == 0x38 || i == 0x39 || i == VK_NUMPAD0 || i == VK_NUMPAD1 || i ==
- VK_NUMPAD2 || i == VK_NUMPAD3 || i == VK_NUMPAD4 || i == VK_NUMPAD5 || i == VK_NUMPAD6 || i ==
- VK_NUMPAD7 || i == VK_NUMPAD8 || i == VK_NUMPAD9))
- {
- *text = *text + KeyDigits[i];
- return;
- }
- }
- }
- }
- const char* cstr = text->c_str();
- g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(45, 46, 53, MenuAlpha_Main));
- g_pSurface->OutlinedRect(x_offset + 20, y_offset, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
- g_pSurface->DrawT(x_offset + 20 + 5, y_offset + 3, Color(200, 200, 200, MenuAlpha_Main), Globals::SmallText, false,
- cstr);
- y_offset += 29;
- }
- void Menu::button(ButtonCallback_t callback, std::string title)
- {
- if (groupbox_bottom <= y_offset + 18)
- return;
- int ComboSize = 180;
- static bool pressed = false;
- RECT text_size = g_pSurface->GetTextSizeRect(Globals::SmallText, title.c_str());
- if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset, ComboSize, 20) && menuOpened)
- {
- if (pressed)
- {
- if (callback)
- callback();
- }
- pressed = false;
- }
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset, ComboSize, 20) && !pressed)
- pressed = true;
- if (g_pSurface->MouseInRegion(x_offset + 20, y_offset, ComboSize, 20) and GetAsyncKeyState(VK_LBUTTON))
- {
- g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(28, 11, 80, MenuAlpha_Main));
- }
- else
- {
- g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(202, 45, 100, MenuAlpha_Main));
- }
- g_pSurface->OutlinedRect(x_offset + 20, y_offset, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
- g_pSurface->DrawT(x_offset + 20 + (ComboSize / 2) - (text_size.right / 2),
- y_offset + (20 / 2) - (text_size.bottom / 2) - 1, Color(200, 200, 200, MenuAlpha_Main),
- Globals::MenuSub, false, title.c_str());
- y_offset += 26;
- }
- void Menu::ListBox(int x, int y, int w, int h, int size, std::string name, std::string *itemname, int* item) {
- g_pSurface->FilledRect(_pos.x + x, _pos.y + y, w, h, Color(25, 26, 33, MenuAlpha_Main));
- g_pSurface->OutlinedRect(_pos.x + x, _pos.y + y, w, h, Color(40, 44, 53, MenuAlpha_Main));
- g_pSurface->FilledRect(_pos.x + x + 1, _pos.y + y + 1, w - 2, 15, Color(31, 31, 38, MenuAlpha_Main));
- g_pSurface->Line(_pos.x + x + 1, _pos.y + y + 15, _pos.x + x + w - 2, _pos.y + y + 15, Color(40, 44, 53, MenuAlpha_Main));
- g_pSurface->DrawT(_pos.x + x + (w / 2), _pos.y + y + 1, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, true, name.c_str());
- for (int i = 0; i < size; i++) {
- RECT Area = { _pos.x + x, _pos.y + y + 17 + (16 * i), w, 15 };
- if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(Area.left, Area.top, Area.right, Area.bottom) && menuOpened) {
- *item = i;
- }
- if (*item == i) {
- g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(28, 28, 35, MenuAlpha_Main));
- }
- else {
- g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(21, 21, 28, MenuAlpha_Main));
- }
- g_pSurface->OutlinedRect(Area.left, Area.top, Area.right, Area.bottom, Color(40, 44, 53, MenuAlpha_Main));
- g_pSurface->DrawT(Area.left + (Area.right / 2), Area.top + 1, Color(200, 200, 200, MenuAlpha_Main), Globals::MenuSub, true, itemname[i].c_str());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement