Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.15 KB | None | 0 0
  1. #include "Menu.h"
  2. #include "TGFCfg.h"
  3. #include "../SDK/Vector.h"
  4. #include "../SDK/ISurface.h"
  5. #include "../Utils/Color.h"
  6. #include "../Utils/GlobalVars.h"
  7. #include "config.h"
  8. Menu g_Menu;
  9.  
  10. bool manually_set_key = false;
  11.  
  12. /*
  13. *
  14. * CREDITS TO : stickrpg
  15. *
  16. * BEST MENU FRAMEWORK IN EXISTENCE
  17. *
  18. */
  19. enum TABS
  20. {
  21. Aimbot = 0,
  22. Visuals = 1,
  23. Misc = 2
  24. };
  25.  
  26. #define or ||
  27. #define and &&
  28. int TopLeftGroupBox_X = 5;
  29. int TopLeftGroupBox_Y = 52 + (309 / 1.5) + 5;
  30.  
  31. int GroupBoxSize_Width = 375 / 1.5;
  32. int GroupBoxSize_Height = 309 / 1.5;
  33.  
  34. std::string GetTimeString()
  35. {
  36. time_t current_time;
  37. struct tm* time_info;
  38. static char timeString[10];
  39. time(&current_time);
  40. time_info = localtime(&current_time);
  41. strftime(timeString, sizeof(timeString), "%X", time_info);
  42. return timeString;
  43. }
  44. void GradientV(int x, int y, int w, int h, Color c1, Color c2)
  45. {
  46. g_pSurface->FilledRect(x, y, w, h, c1);
  47. BYTE first = c2.red;
  48. BYTE second = c2.green;
  49. BYTE third = c2.blue;
  50. for (int i = 0; i < h; i++)
  51. {
  52. float fi = i, fh = h;
  53. float a = fi / fh;
  54. DWORD ia = a * 255;
  55. g_pSurface->FilledRect(x, y + i, w, 1, Color(first, second, third, ia));
  56. }
  57. }
  58.  
  59. void GradientVEnd(int x, int y, int w, int h, Color c1, Color c2)
  60. {
  61. //g_pSurface->FilledRect(x, y, w, h, c1);
  62. BYTE first = c2.red;
  63. BYTE second = c2.green;
  64. BYTE third = c2.blue;
  65. for (float i = 0; i < h / 1.5; i++)
  66. {
  67. float fi = i, fh = h / 1.5;
  68. float a = fi / fh;
  69. DWORD ia = a * 255;
  70. g_pSurface->FilledRect(x, y + i, w, 2, Color(first, second, third, ia));
  71. }
  72. }
  73.  
  74.  
  75. void DrawESPPlayersSubTab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
  76. {
  77. int in_sizew_esp_player_subtabs = (375 / 1.5) - 8;
  78. static std::string ESP_Player_SubTabs_Names[3] = {"Main", "Main PT 2", "Model"};
  79.  
  80. for (int i = 0; i < tab_amount; i++)
  81. {
  82. RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
  83.  
  84. int tab_area[4] = {
  85. _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + 52 + 5,
  86. (in_sizew_esp_player_subtabs / tab_amount), 20
  87. };
  88.  
  89. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
  90. tab_area[3]))
  91. current_players_esp_subtab = i;
  92.  
  93. if (current_players_esp_subtab == i)
  94. {
  95. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(37, 37, 45, MenuAlpha_Main));
  96.  
  97. 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));
  98.  
  99. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  100. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  101. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  102. ESP_Player_SubTabs_Names[i].c_str());
  103. }
  104. else
  105. {
  106. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
  107. g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
  108.  
  109. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  110. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  111. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  112. ESP_Player_SubTabs_Names[i].c_str());
  113. }
  114. }
  115. }
  116.  
  117. void DrawAimbotTargetSubTab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
  118. {
  119. int in_sizew_esp_player_subtabs = (375 / 1.5) - 8;
  120. static std::string ESP_Player_SubTabs_Names[2] = {"Target", "Body-Aim"};
  121.  
  122. for (int i = 0; i < tab_amount; i++)
  123. {
  124. RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
  125.  
  126. int tab_area[4] = {
  127. _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + TopLeftGroupBox_Y + 5,
  128. (in_sizew_esp_player_subtabs / tab_amount), 20
  129. };
  130.  
  131. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
  132. tab_area[3]))
  133. current_players_esp_subtab = i;
  134.  
  135.  
  136. // g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(23, 23, 25, MenuAlpha_Main));
  137.  
  138. if (current_players_esp_subtab == i)
  139. {
  140. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(37, 37, 45, MenuAlpha_Main));
  141.  
  142. 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));
  143.  
  144. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  145. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  146. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  147. ESP_Player_SubTabs_Names[i].c_str());
  148. }
  149. else
  150. {
  151. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
  152. g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
  153.  
  154. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  155. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  156. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  157. ESP_Player_SubTabs_Names[i].c_str());
  158. }
  159.  
  160. }
  161. } //
  162.  
  163. void DrawAimbotAccuracy_Subtab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
  164. {
  165. int in_sizew_esp_player_subtabs = GroupBoxSize_Width - 8;
  166. static std::string ESP_Player_SubTabs_Names[5] = {"Auto", "Scout", "Awp", "H. Pistol", "Other"};
  167.  
  168. for (int i = 0; i < tab_amount; i++)
  169. {
  170. RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
  171.  
  172. int tab_area[4] = {
  173. _pos.x + TopLeftGroupBox_X + GroupBoxSize_Width + 5 + 4 + (i * (in_sizew_esp_player_subtabs / tab_amount)),
  174. _pos.y + 52 + 5, (in_sizew_esp_player_subtabs / tab_amount), 20
  175. };
  176.  
  177. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
  178. tab_area[3]))
  179. current_players_esp_subtab = i;
  180.  
  181. if (current_players_esp_subtab == i)
  182. {
  183. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(37, 37, 45, MenuAlpha_Main));
  184.  
  185. 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));
  186.  
  187. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  188. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  189. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  190. ESP_Player_SubTabs_Names[i].c_str());
  191. }
  192. else
  193. {
  194. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
  195. g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
  196.  
  197. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  198. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  199. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  200. ESP_Player_SubTabs_Names[i].c_str());
  201. }
  202. }
  203. }
  204.  
  205. void DrawAntiAim_Subtab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
  206. {
  207. int in_sizew_esp_player_subtabs = GroupBoxSize_Width - 8;
  208. static std::string ESP_Player_SubTabs_Names[4] = {"Standing", "Moving", "Air", "Misc"};
  209.  
  210. for (int i = 0; i < tab_amount; i++)
  211. {
  212. RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
  213.  
  214. int tab_area[4] = {
  215. _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + 52 + 5,
  216. (in_sizew_esp_player_subtabs / tab_amount), 20
  217. };
  218.  
  219. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
  220. tab_area[3]))
  221. current_players_esp_subtab = i;
  222.  
  223. if (current_players_esp_subtab == i)
  224. {
  225. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(37, 37, 45, MenuAlpha_Main));
  226.  
  227. 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));
  228.  
  229. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  230. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  231. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  232. ESP_Player_SubTabs_Names[i].c_str());
  233. }
  234. else
  235. {
  236. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
  237. g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
  238.  
  239. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  240. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  241. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  242. ESP_Player_SubTabs_Names[i].c_str());
  243. }
  244. }
  245. } //
  246. #include <tuple>
  247.  
  248. class vars : public singleton< vars > {
  249. private:
  250.  
  251. public:
  252. bool visuals_box = false;
  253. };
  254.  
  255. void DrawAimbotMain_Subtab(int& current_players_esp_subtab, int tab_amount, Vector _pos, int MenuAlpha_Main)
  256. {
  257. int in_sizew_esp_player_subtabs = GroupBoxSize_Width - 8;
  258. static std::string ESP_Player_SubTabs_Names[2] = {"Main", "Resolver"};
  259.  
  260. for (int i = 0; i < tab_amount; i++)
  261. {
  262. RECT text_size2 = g_pSurface->GetTextSizeRect(Globals::SmallText, ESP_Player_SubTabs_Names[i].c_str());
  263.  
  264. int tab_area[4] = {
  265. _pos.x + 9 + (i * (in_sizew_esp_player_subtabs / tab_amount)), _pos.y + 52 + 5,
  266. (in_sizew_esp_player_subtabs / tab_amount), 20
  267. };
  268.  
  269. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
  270. tab_area[3]))
  271. current_players_esp_subtab = i;
  272.  
  273.  
  274.  
  275. if (current_players_esp_subtab == i)
  276. {
  277. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(37, 37, 45, MenuAlpha_Main));
  278.  
  279. 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));
  280.  
  281. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  282. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  283. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  284. ESP_Player_SubTabs_Names[i].c_str());
  285. }
  286. else
  287. {
  288. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
  289. g_pSurface->FilledRect(tab_area[0], tab_area[1] + tab_area[3], tab_area[2], 3, Color(39, 39, 47, MenuAlpha_Main));
  290.  
  291. g_pSurface->DrawT(tab_area[0] + (((in_sizew_esp_player_subtabs / tab_amount) / 2) - (text_size2.right / 2)),
  292. tab_area[1] + (tab_area[3] / 2) - (text_size2.bottom / 2),
  293. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  294. ESP_Player_SubTabs_Names[i].c_str());
  295. }
  296.  
  297. // g_pSurface->OutlinedRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(40, 44, 53, MenuAlpha_Main));
  298. }
  299. } //
  300.  
  301. std::ptrdiff_t ExtraOffsets::deadflag = NULL;
  302. std::string config_slots[14] = {
  303. "Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juilett", "Kilo", "Lima",
  304. "Mike", "November"
  305. };
  306.  
  307. static int save_slot = 0;
  308. #include "../Features/Visuals/EventLogging.h"
  309. void Save_Config()
  310. {
  311. Config2->Save(config_slots[save_slot]);
  312.  
  313. std::string string_to_add;
  314. string_to_add += "saved '";
  315. string_to_add += config_slots[save_slot];
  316. string_to_add += "'.";
  317.  
  318. c_event_logs::get().add(string_to_add, Color(255, 255, 255, 255));
  319. }
  320.  
  321. void Load_Config()
  322. {
  323. Config2->Load(config_slots[save_slot]);
  324.  
  325. std::string string_to_add;
  326. string_to_add += "loaded '";
  327. string_to_add += config_slots[save_slot];
  328. string_to_add += "'.";
  329.  
  330. c_event_logs::get().add(string_to_add, Color(255, 255, 255, 255));
  331. }
  332.  
  333. void Export_Config()
  334. {
  335. Config2->export_to_clipboard("export");
  336. }
  337.  
  338. void Import_Config()
  339. {
  340. Config2->import_from_clipboard("import");
  341. }
  342.  
  343. void Save()
  344. {
  345. std::string ConfigName;
  346.  
  347. switch (2)
  348. {
  349. case 0: ConfigName = "1";
  350. break;
  351. case 1: ConfigName = "2";
  352. break;
  353. case 2: ConfigName = "3";
  354. break;
  355. case 3: ConfigName = "4";
  356. break;
  357. case 4: ConfigName = "5";
  358. break;
  359. }
  360. Config2->Save(ConfigName);
  361. }
  362.  
  363. void GradientH(int x, int y, int w, int h, Color c1, Color c2)
  364. {
  365. g_pSurface->FilledRect(x, y, w, h, c1);
  366. BYTE first = c2.red;
  367. BYTE second = c2.green;
  368. BYTE third = c2.blue;
  369. for (int i = 0; i < w; i++)
  370. {
  371. float fi = i, fw = w;
  372. float a = fi / fw;
  373. DWORD ia = a * 255;
  374. g_pSurface->FilledRect(x + i, y, 1, h, Color(first, second, third, ia));
  375. }
  376. }
  377.  
  378. #include <experimental/filesystem>
  379. #include <filesystem>
  380. #include <iostream>
  381.  
  382. #include <iostream>
  383. #include <iomanip>
  384. #include <fstream>
  385. using namespace std;
  386. #include "../SDK/ClientClass.h"
  387. #include "../SDK/IBaseClientDll.h"
  388.  
  389.  
  390. DWORD FindSig(DWORD dwAddress, DWORD dwLength, const char* szPattern)
  391. {
  392. if (!dwAddress || !dwLength || !szPattern)
  393. return 0;
  394.  
  395. const char* pat = szPattern;
  396. DWORD firstMatch = NULL;
  397.  
  398. for (DWORD pCur = dwAddress; pCur < dwLength; pCur++)
  399. {
  400. if (!*pat)
  401. return firstMatch;
  402.  
  403. if (*(PBYTE)pat == '\?' || *(BYTE*)pCur == GET_BYTE(pat))
  404. {
  405. if (!firstMatch)
  406. firstMatch = pCur;
  407.  
  408. if (!pat[2])
  409. return firstMatch;
  410.  
  411. if (*(PWORD)pat == '\?\?' || *(PBYTE)pat != '\?')
  412. pat += 3;
  413.  
  414. else pat += 2;
  415. }
  416. else
  417. {
  418. pat = szPattern;
  419. firstMatch = 0;
  420. }
  421. }
  422.  
  423. return 0;
  424. }
  425. DWORD FindSignaturenew(const char* szModuleName, const char* PatternName, char* szPattern)
  426. {
  427. HMODULE hModule = GetModuleHandleA(szModuleName);
  428. PIMAGE_DOS_HEADER pDOSHeader = (PIMAGE_DOS_HEADER)hModule;
  429. PIMAGE_NT_HEADERS pNTHeaders = (PIMAGE_NT_HEADERS)(((DWORD)hModule) + pDOSHeader->e_lfanew);
  430.  
  431. DWORD ret = FindSig(((DWORD)hModule) + pNTHeaders->OptionalHeader.BaseOfCode, ((DWORD)hModule) + pNTHeaders->OptionalHeader.SizeOfCode, szPattern);;
  432.  
  433. return ret;
  434. }
  435.  
  436. void ForceDaUpdate() {
  437.  
  438. }
  439.  
  440. std::string text_uwu;
  441. bool dont_recieve_input = false;
  442.  
  443. void Menu::Render()
  444. {
  445. static bool _pressed = true;
  446.  
  447. if (!_pressed && GetAsyncKeyState(VK_INSERT))
  448. _pressed = true;
  449. else if (_pressed && !GetAsyncKeyState(VK_INSERT))
  450. {
  451. _pressed = false;
  452. menuOpened = !menuOpened;
  453. }
  454. g_pEngine->GetScreenSize(screen_width, screen_width);
  455. static Vector2D _mouse_pos;
  456. static int groupbox_bottom;
  457. static int _drag_x = 300;
  458. static int _drag_y = 300;
  459. int _width = 514;
  460. int _height = 473; //
  461. static Vector2D oldPos;
  462. static Vector2D mousePos;
  463. static bool _dragging = false;
  464. bool _click = false;
  465. static bool _resizing = false;
  466.  
  467. g_InputSystem->EnableInput(!menuOpened);
  468. if (menuOpened)
  469. {
  470. MenuAlpha_Main = min(MenuAlpha_Main + 15, 255);
  471. MenuAlpha_Text = min(MenuAlpha_Text + 5, 255);
  472.  
  473. //MenuAlpha_Main = 255;
  474. //MenuAlpha_Text = 255;
  475.  
  476. if (GetAsyncKeyState(VK_LBUTTON))
  477. _click = true;
  478.  
  479. Vector2D _mouse_pos = g_pSurface->GetMousePosition();
  480.  
  481. if (_dragging and !_click)
  482. _dragging = false;
  483.  
  484. if (_resizing and !_click)
  485. _resizing = false;
  486.  
  487. if (_dragging and _click)
  488. {
  489. _pos.x = _mouse_pos.x - _drag_x;
  490. _pos.y = _mouse_pos.y - _drag_y;
  491. }
  492.  
  493.  
  494. //if (_resizing && _click) {
  495. // _width = _mouse_pos.x - _pos.x;
  496. // _height = _mouse_pos.y - _pos.y;
  497.  
  498. // if (_width < 480) _width = 480;
  499. // if (_height < 340) _height = 340;
  500.  
  501. // if (_width > 960) _width = 960;
  502. // if (_height > 680) _height = 680;
  503. //}
  504.  
  505.  
  506. if (g_pSurface->MouseInRegion(_pos.x, _pos.y, _width, _height) && !(g_pSurface->MouseInRegion(
  507. _pos.x + 10, _pos.y + 20, _width - 10, _height - 10)))
  508. {
  509. _dragging = true;
  510. _drag_x = _mouse_pos.x - _pos.x;
  511. _drag_y = _mouse_pos.y - _pos.y;
  512. }
  513.  
  514. // if (mouse_in_params(_pos.x + 20, _pos.y + 20, _width - 10, _height - 10))
  515. // {
  516. // _resizing = true;
  517. // }
  518. }
  519. else
  520. {
  521. MenuAlpha_Main = max(MenuAlpha_Main - 15, 0);
  522. MenuAlpha_Text = max(MenuAlpha_Text - 25, 0);
  523. //MenuAlpha_Main = 0;
  524. //MenuAlpha_Text = 0;
  525. }
  526.  
  527. //if (!menuOpened)
  528. // return;
  529.  
  530.  
  531. if (menuOpened) {
  532. GradientH(_pos.x, _pos.y, _width, _height, Color(29, 29, 37, MenuAlpha_Main), Color(49, 49, 57, MenuAlpha_Main));
  533. }
  534. else {
  535. g_pSurface->FilledRect(_pos.x, _pos.y, _width, _height, Color(29, 29, 37, MenuAlpha_Main));
  536. }
  537.  
  538. int sum = 0;
  539. int x;
  540. ifstream inFile;
  541.  
  542. string path;
  543. static string username;
  544. static string rent;
  545.  
  546. static bool GrabName = true;
  547.  
  548. if (GrabName) {
  549. path = getenv("appdata");
  550. //cout << "appdata=" << path << endl;
  551. path += "\\xy0_login";
  552.  
  553. inFile.open(path);
  554.  
  555. inFile >> username >> rent;
  556. cout << username << rent << endl;
  557.  
  558. GrabName = false;
  559. }
  560.  
  561. //cout << name << rent << endl;
  562. //cout << "path=" << path << endl;
  563.  
  564. g_pSurface->FilledRect(_pos.x + 1, _pos.y + 20, _width - 2, _height - 20, Color(23, 23, 30, MenuAlpha_Main));
  565.  
  566.  
  567.  
  568.  
  569. for (int i = 0; i < _width / 2; i++) {
  570. g_pSurface->Line(_pos.x + (i * 2), _pos.y + 22, _pos.x + (i * 2), _pos.y + _height, Color(10, 10, 18, MenuAlpha_Main));
  571. }
  572.  
  573. for (int i = 0; i < _height / 2.1; i++) {
  574. g_pSurface->Line(_pos.x, _pos.y + 22 + (i * 2), _pos.x + _width, _pos.y + 22 + (i * 2), Color(10, 10, 18, MenuAlpha_Main));
  575. }
  576.  
  577. g_pSurface->FilledRect(_pos.x, _pos.y + 40, _width, 3, Color(39, 39, 47, MenuAlpha_Main));
  578.  
  579. g_pSurface->OutlinedRect(_pos.x, _pos.y, _width, _height, Color(65, 63, 79, MenuAlpha_Main));
  580. g_pSurface->OutlinedRect(_pos.x, _pos.y + 19, _width, 1, Color(65, 63, 79, MenuAlpha_Main));
  581.  
  582. RECT TitleText_Size = g_pSurface->GetTextSizeRect(Globals::CourierNew, "alqaeda.club");
  583.  
  584. g_pSurface->DrawT(_pos.x + 3, _pos.y + (20 / 2) - (TitleText_Size.bottom / 2), Color(255, 255, 255, MenuAlpha_Text), Globals::CourierNew, false, "alqaeda.club");
  585.  
  586.  
  587. std::string MenuWatermark;
  588.  
  589. MenuWatermark += username;
  590. #if _BETA
  591. MenuWatermark += " - ";
  592. MenuWatermark += "premium";
  593. #endif
  594.  
  595. RECT WatermarkMenuText_Size = g_pSurface->GetTextSizeRect(Globals::CourierNew, MenuWatermark.c_str());
  596.  
  597. g_pSurface->DrawT(_pos.x + _width - WatermarkMenuText_Size.right - 5, _pos.y + (20 / 2) - (TitleText_Size.bottom / 2), Color(255, 255, 255, MenuAlpha_Text), Globals::CourierNew, false, MenuWatermark.c_str());
  598.  
  599.  
  600. int in_sizew = _width - 1;
  601.  
  602. static int tab_selected = 0;
  603. static const int tab_amount = 6;
  604. static std::string tab_names[tab_amount] = { "Legit", "Rage", "AA", "Visuals", "Misc", "Skins" };
  605.  
  606. for (int i = 0; i < tab_amount; i++)
  607. {
  608. RECT text_size = g_pSurface->GetTextSizeRect(Globals::TabFont, tab_names[i].c_str());
  609.  
  610. int tab_area[4] = { _pos.x + 1 + (i * (in_sizew / tab_amount)), _pos.y + 20, (in_sizew / tab_amount), 20 };
  611.  
  612. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(tab_area[0], tab_area[1], tab_area[2],
  613. tab_area[3]))
  614. tab_selected = i;
  615.  
  616. if (tab_selected == i)
  617. {
  618. /*
  619.  
  620. g_pSurface->FilledRect(tab_area[0], tab_area[1], 1, tab_area[3], Color(40, 44, 53, 255));
  621.  
  622.  
  623. g_pSurface->FilledRect(tab_area[0] + tab_area[2], tab_area[1], 1, tab_area[3], Color(40, 44, 53, 255));
  624.  
  625. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], 1, Color(40, 44, 53, 255));
  626.  
  627.  
  628. */
  629.  
  630. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(37, 37, 45, MenuAlpha_Main));
  631.  
  632. 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));
  633.  
  634. g_pSurface->DrawT(tab_area[0] + (((in_sizew / tab_amount) / 2) - (text_size.right / 2)),
  635. tab_area[1] + (tab_area[3] / 2) - (text_size.bottom / 2), Color(255, 255, 255, MenuAlpha_Text),
  636. Globals::TabFont, false, tab_names[i].c_str());
  637. }
  638. else
  639. {
  640. //g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(33, 33, 35, MenuAlpha_Main));
  641. g_pSurface->FilledRect(tab_area[0], tab_area[1], tab_area[2], tab_area[3], Color(27, 27, 35, MenuAlpha_Main));
  642. g_pSurface->DrawT(tab_area[0] + (((in_sizew / tab_amount) / 2) - (text_size.right / 2)),
  643. tab_area[1] + (tab_area[3] / 2) - (text_size.bottom / 2), Color(255, 255, 255, MenuAlpha_Text),
  644. Globals::TabFont, false, tab_names[i].c_str());
  645. }
  646.  
  647.  
  648. //g_pSurface->Line(tab_area[0] - 10, tab_area[1] + 5, tab_area[0] - 13, tab_area[1] + tab_area[3] - 10, Color(91, 95, 97, MenuAlpha_Main));
  649. }
  650. static int aimbot_main_subtab = 0;
  651. std::string pitch[5] = { "Disabled", "Down", "Up", "Origin", "Offset" };
  652.  
  653. std::string BodyAimOptions[5] = { "In Air", "Slow Walk", "High Inaccuracy", "Vulnerable", "Lethal" };
  654.  
  655. std::string AutoStopOptions[4] = { "Minimum Speed", "Full Stop" };
  656.  
  657. std::string BodyAimModeOptions[2] = { "Prefer", "Force" };
  658.  
  659. if (tab_selected == 0)
  660. {
  661. groupbox(5, 52, GroupBoxSize_Width, GroupBoxSize_Height, "test");
  662. checkbox("Enabled", &c_config::get().legit_aimbot_enabled);
  663. checkbox("Position Adjustment", &c_config::get().legit_aimbot_backtrack);
  664. slider(180, "FOV", &c_config::get().legit_aimbot_fov, "", 1);
  665. slider(100, "Linear Progression Threshold", &c_config::get().linear_progression_threshold, "", 1);
  666. checkbox("RCS", &c_config::get().rcs);
  667. slider(100, "RCS X", &c_config::get().rcs_x, "", 1);
  668. slider(100, "RCS Y", &c_config::get().rcs_y, "", 1);
  669. }
  670. else if (tab_selected == 1)
  671. {
  672. groupbox(5, 52, GroupBoxSize_Width, GroupBoxSize_Height, "test", false, true);
  673. DrawAimbotMain_Subtab(aimbot_main_subtab, 2, _pos, MenuAlpha_Main);
  674.  
  675. if (aimbot_main_subtab == 0)
  676. {
  677. checkbox("Enabled", &c_config::get().aimbot_enabled);
  678. checkbox("Silent Aim", &c_config::get().aimbot_silentaim);
  679. checkbox("Remove Recoil", &c_config::get().aimbot_norecoil);
  680. checkbox("Fakelag Prediction", &c_config::get().fakelag_prediction);
  681. checkbox("Auto Stop", &c_config::get().autostop);
  682. if (c_config::get().autostop) combobox(2, "", AutoStopOptions, &c_config::get().autostop_mode);
  683. if (c_config::get().autostop) checkbox("Stop Between Shots", &c_config::get().stop_inbetween_shots);
  684. checkbox("Auto Scope", &c_config::get().auto_scope);
  685. checkbox("Auto Revolver", &c_config::get().autorevolver);
  686. checkbox("Accuracy Boost", &c_config::get().accuracy_boost);
  687. }
  688. else if (aimbot_main_subtab == 1)
  689. {
  690. checkbox("Resolver", &c_config::get().aimbot_resolver);
  691. }
  692.  
  693. groupbox(TopLeftGroupBox_X, TopLeftGroupBox_Y, GroupBoxSize_Width, GroupBoxSize_Height, "test", false, true);
  694. static int current_target_selection_aimbots = 0;
  695. DrawAimbotTargetSubTab(current_target_selection_aimbots, 2, _pos, MenuAlpha_Main);
  696.  
  697. switch (current_target_selection_aimbots)
  698. {
  699. case 0: /*target*/
  700. {
  701. slider(100, "Head Scale", &c_config::get().aimbot_headpointscale, "%", 1);
  702. slider(100, "Body Scale", &c_config::get().aimbot_bodypointscale, "%", 1);
  703. }
  704. break;
  705. case 1: /*hitscan*/
  706. {
  707. MultiComboBox(5, "Body-Aim", BodyAimOptions, c_config::get().prefer_bodyaim);
  708. combobox(2, "Body-Aim Mode", BodyAimModeOptions, &c_config::get().bodyaim_mode);
  709. }
  710. break;
  711. }
  712.  
  713. static int current_subtab_selection_accuracy = 0;
  714. groupbox(TopLeftGroupBox_X + GroupBoxSize_Width + 5, 52, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, "test", false,
  715. true);
  716. DrawAimbotAccuracy_Subtab(current_subtab_selection_accuracy, 5, _pos, MenuAlpha_Main);
  717.  
  718. switch (current_subtab_selection_accuracy)
  719. {
  720. case 0:
  721. {
  722. slider(100, "Hitchance", &c_config::get().auto_hitchance, "%", 1);
  723. slider(100, "Minimum Damage", &c_config::get().auto_mindamage, "HP", 1);
  724. }
  725. break;
  726. case 1:
  727. {
  728. slider(100, "Hitchance", &c_config::get().scout_hitchance, "%", 1);
  729. slider(100, "Minimum Damage", &c_config::get().scout_mindamage, "HP", 1);
  730. }
  731. break;
  732. case 2:
  733. {
  734. slider(100, "Hitchance", &c_config::get().awp_hitchance, "%", 1);
  735. slider(100, "Minimum Damage", &c_config::get().awp_mindamage, "HP", 1);
  736. }
  737. break;
  738. case 3:
  739. {
  740. slider(100, "Hitchance", &c_config::get().heavy_pistol_hitchance, "%", 1);
  741. slider(100, "Minimum Damage", &c_config::get().heavy_pistol_mindamage, "HP", 1);
  742. }
  743. break;
  744. case 4:
  745. {
  746. slider(100, "Hitchance", &c_config::get().other_hitchance, "%", 1);
  747. slider(100, "Minimum Damage", &c_config::get().other_mindamage, "HP", 1);
  748. }
  749. break;
  750. }
  751.  
  752.  
  753. }
  754. else if (tab_selected == 2) {
  755.  
  756.  
  757. static int current_subtab_antiaim_selection = 0;
  758. groupbox(5, 52, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5,
  759. "test", false, true);
  760. DrawAntiAim_Subtab(current_subtab_antiaim_selection, 4, _pos, MenuAlpha_Main);
  761. std::string pitch[5] = { "Disabled", "Down", "Up", "Origin", "Offset" };
  762. std::string yaw[5] = { "Disabled", "Backwards", "test;)", "Spin", "Manual" };
  763. std::string on_shot[2] = { "Stable", "Experimental" };
  764. std::string desync[5] = { "Disabled", "Ephemeral", "Cromulent", "Ornery", "Jitter" };
  765. std::string freestand_mode[3] = { "Threat", "Crosshair", "Distance" };
  766. switch (current_subtab_antiaim_selection)
  767. {
  768. case 0:
  769. {
  770. combobox(5, "X", pitch, &c_config::get().pitch_standing);
  771. combobox(5, "Y", yaw, &c_config::get().yaw_standing);
  772. }
  773. break;
  774. case 1:
  775. {
  776. combobox(5, "X", pitch, &c_config::get().pitch_moving);
  777. combobox(5, "Y", yaw, &c_config::get().yaw_moving);
  778. }
  779. break;
  780. case 2:
  781. {
  782. combobox(5, "X", pitch, &c_config::get().pitch_air);
  783. combobox(5, "Y", yaw, &c_config::get().yaw_air);
  784. }
  785. break;
  786. case 3:
  787. {
  788. checkbox("Enabled", &c_config::get().antiaim_enabled);
  789. checkbox("Auto Direction", &c_config::get().antiaim_freestanding);
  790. if (c_config::get().antiaim_freestanding) {
  791. combobox(3, "", freestand_mode, &c_config::get().antiaim_freestanding_mode);
  792. }
  793. checkbox("Extrapolated", &c_config::get().extrapolated);
  794. combobox(5, "Desync", desync, &c_config::get().desync);
  795. checkbox("On Shot Anti-Aim", &c_config::get().on_shot_aa);
  796. if (c_config::get().on_shot_aa)
  797. {
  798. combobox(2, "On Shot AA Type", on_shot, &c_config::get().on_shot_aa_type);
  799. }
  800.  
  801. slider(180, "Angle Jitter", &c_config::get().aa_jitter, "°", 1);
  802. }
  803. break;
  804. }
  805.  
  806. groupbox(TopLeftGroupBox_X + GroupBoxSize_Width + 5, 52, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, "test");
  807.  
  808. slider(14, "Fakelag", &c_config::get().fakelag, "t", 1);
  809.  
  810. slider(100, "Fakelag Randomization", &c_config::get().variance, "%", 1);
  811. slider(14, "Fake Duck", &c_config::get().fakeduck_test, "t", 1);
  812. }
  813. else if (tab_selected == 3)
  814. {
  815. static int current_players_esp_subtab = 0;
  816.  
  817. std::string WireFrameHands[3] = { "Disabled", "Invisible", "Chams"};
  818. std::string EventLogsOptions[5] = { "Weapon Purchase", "Player Hurt", "Player Killed" };
  819. groupbox(TopLeftGroupBox_X, TopLeftGroupBox_Y, GroupBoxSize_Width, GroupBoxSize_Height, "test");
  820. MultiComboBox(3, "Event Logger", EventLogsOptions, c_config::get().event_logger);
  821.  
  822. groupbox(5, 52, GroupBoxSize_Width, GroupBoxSize_Height, "test", false, true);
  823. DrawESPPlayersSubTab(current_players_esp_subtab, 3, _pos, MenuAlpha_Main);
  824.  
  825. std::string Health_Type[3] = { "Disabled", "Normal", "Battery" };
  826. std::string Hitmarker_Type[3] = { "Disabled", "Arena Switch", "Custom" };
  827. if (current_players_esp_subtab == 0)
  828. {
  829. checkbox("Enabled", &c_config::get().visuals_enabled);
  830. color_selector("name_col", &c_config::get().name_esp_color_r, &c_config::get().name_esp_color_g,
  831. &c_config::get().name_esp_color_b, &c_config::get().name_esp_color_a);
  832. checkbox("Name", &c_config::get().name_enemies);
  833. color_selector("box_col", &c_config::get().box_esp_color_r, &c_config::get().box_esp_color_g,
  834. &c_config::get().box_esp_color_b, &c_config::get().box_esp_color_a);
  835. checkbox("Bounding Box", &c_config::get().box_enemies);
  836. combobox(3, "Health", Health_Type, &c_config::get().health_enemies);
  837. color_selector("weapon_col", &c_config::get().weapon_esp_color_r, &c_config::get().weapon_esp_color_g,
  838. &c_config::get().weapon_esp_color_b, &c_config::get().weapon_esp_color_a);
  839. checkbox("Weapon", &c_config::get().weapon_enemies);
  840. if (c_config::get().weapon_enemies)
  841. {
  842. checkbox("Show Icon When Possible", &c_config::get().show_icon_when_possible_enemies);
  843. }
  844. checkbox("Flags", &c_config::get().flags_enemy);
  845. checkbox("Ammo", &c_config::get().ammo_enemy);
  846. }
  847. else if (current_players_esp_subtab == 1)
  848. {
  849. color_selector("player_indicator_col", &c_config::get().fov_arrows_esp_color_r,
  850. &c_config::get().fov_arrows_esp_color_g, &c_config::get().fov_arrows_esp_color_b,
  851. &c_config::get().fov_arrows_esp_color_a);
  852. checkbox("Player Indicator", &c_config::get().fov_arrows_enemy);
  853. if (c_config::get().fov_arrows_enemy)
  854. {
  855. slider(30, "Size", &c_config::get().fov_arrows_enemy_size, "px", 1);
  856. slider(100, "Distance", &c_config::get().fov_arrows_enemy_distance, "%", 1);
  857. checkbox("Always indicate player", &c_config::get().fov_arrows_always_indicate);
  858. }
  859. }
  860. else if (current_players_esp_subtab == 2)
  861. {
  862. color_selector("glow_col", &c_config::get().glow_esp_color_r, &c_config::get().glow_esp_color_g,
  863. &c_config::get().glow_esp_color_b, &c_config::get().glow_esp_color_a);
  864. checkbox("Glow", &c_config::get().glow_enemies);
  865. color_selector("chams_col", &c_config::get().chams_esp_color_r, &c_config::get().chams_esp_color_g,
  866. &c_config::get().chams_esp_color_b, &c_config::get().chams_esp_color_a);
  867. checkbox("Chams", &c_config::get().chams_enemies);
  868. color_selector("chams_xqz_col", &c_config::get().chams_xqz_esp_color_r,
  869. &c_config::get().chams_xqz_esp_color_g, &c_config::get().chams_xqz_esp_color_b,
  870. &c_config::get().chams_xqz_esp_color_a);
  871. checkbox("Chams XQZ", &c_config::get().chams_xqz_enemies);
  872. color_selector("hand_cham_col", &c_config::get().hand_chams_color_r, &c_config::get().hand_chams_color_g,
  873. &c_config::get().hand_chams_color_b, &c_config::get().hand_chams_color_a);
  874. combobox(3, "Hands", WireFrameHands, &c_config::get().hand_chams);
  875. color_selector("local_cham_col", &c_config::get().local_chams_color_r, &c_config::get().local_chams_color_g,
  876. &c_config::get().local_chams_color_b, &c_config::get().local_chams_color_a);
  877. checkbox("Local Chams", &c_config::get().local_chams);
  878. color_selector("local_glow_col", &c_config::get().local_glow_color_r, &c_config::get().local_glow_color_g,
  879. &c_config::get().local_glow_color_b, &c_config::get().local_glow_color_a);
  880. checkbox("Local Glow", &c_config::get().local_glow);
  881. }
  882.  
  883.  
  884. groupbox(TopLeftGroupBox_X + GroupBoxSize_Width + 5, 52, GroupBoxSize_Width, GroupBoxSize_Height, "test");
  885.  
  886. checkbox("Remove Scope", &c_config::get().remove_scope);
  887. if (c_config::get().remove_scope)
  888. {
  889. checkbox("Display spread with scope", &c_config::get().dynamic_scope);
  890. }
  891. checkbox("Hit Marker", &c_config::get().hitmarker);
  892. combobox(3, "Hit Marker Sound", Hitmarker_Type, &c_config::get().hitmarker_sound);
  893.  
  894. checkbox("Force Crosshair", &c_config::get().force_crosshair);
  895. checkbox("Preserve Killfeed", &c_config::get().visual_preserve_killfeed);
  896. checkbox("Penetration Crosshair", &c_config::get().penetration_crosshair);
  897. checkbox("Radar", &c_config::get().visuals_radar);
  898. checkbox("Grenade Prediction", &c_config::get().grenade_prediction);
  899. groupbox(TopLeftGroupBox_X + GroupBoxSize_Width + 5, TopLeftGroupBox_Y, GroupBoxSize_Width, GroupBoxSize_Height,
  900. "test");
  901. slider(135, "Field Of View", &c_config::get().fov, "°", 1);
  902. checkbox("Retain FOV When Scoped", &c_config::get().fov_while_zoomed);
  903. slider(135, "Viewmodel Field Of View", &c_config::get().viewmodel_fov, "°", 1);
  904.  
  905. checkbox("Nightmode", &c_config::get().nightmode);
  906. checkbox("Transparent Props", &c_config::get().transparent_props);
  907. slider(135, "Thirdperson Distance", &c_config::get().thirdperson_distance, "°", 1);
  908. checkbox("Remove Visual Recoil", &c_config::get().remove_visual_recoil);
  909. std::string nosmoke_type[3] = { "Disabled", "No Draw", "Wireframe" };
  910. checkbox("No Smoke", &c_config::get().no_smoke);
  911. checkbox("No Flash", &c_config::get().remove_flash);
  912. }
  913.  
  914. else if (tab_selected == 4)
  915. {
  916. groupbox(5, 52, GroupBoxSize_Width, GroupBoxSize_Height, "test");
  917. checkbox("Auto Bunnyhop", &c_config::get().misc_bhop);
  918. checkbox("Auto Strafe", &c_config::get().misc_autostrafe);
  919. checkbox("Unlimited Crouch Stamina", &c_config::get().misc_fastcrouch);
  920. slider(100, "Slow Walk", &c_config::get().slowwalk_speed, "%", 1);
  921. checkbox("Animated Clantag", &c_config::get().misc_clantag);
  922.  
  923. groupbox(TopLeftGroupBox_X, TopLeftGroupBox_Y, GroupBoxSize_Width, GroupBoxSize_Height, "test");
  924. std::string KeyBindList[4] = { "Thirdperson", "Slow Walk", "Swap Manual", "Fake duck" };
  925. static int CurrentKeybind = 0;
  926.  
  927.  
  928. combobox(3, "Keybind", KeyBindList, &CurrentKeybind);
  929.  
  930. static int gay23 = 0;
  931.  
  932. switch (CurrentKeybind)
  933. {
  934. case 0: keybind(&c_config::get().thirdperson_bind, "a");
  935. break;
  936. case 1: keybind(&c_config::get().slowwalk_bind, "b");
  937. break;
  938. case 2: keybind(&c_config::get().manual_swap_bind, "c");
  939. break;
  940. case 3: keybind(&c_config::get().fakeduck_bind, "d");
  941. break;
  942. }
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949. groupbox(TopLeftGroupBox_X + GroupBoxSize_Width + 5, TopLeftGroupBox_Y, GroupBoxSize_Width, GroupBoxSize_Height,
  950. "test");
  951. //combobox(11, "Knife Model", knife_options, &c_config::get().knife_model);
  952. //combobox(16, "Knife", knife_skins, &c_config::get().knife_skin);
  953. color_selector("Menu theme", &c_config::get().menu_color_r, &c_config::get().menu_color_g,
  954. &c_config::get().menu_color_b, &c_config::get().menu_color_a);
  955. EmptySpace("Menu Theme");
  956. checkbox("Anti Untrusted", &c_config::get().misc_antiuntrusted);
  957. combobox(14, "Configuration", config_slots, &save_slot);
  958. button(Save_Config, "Save");
  959. button(Load_Config, "Load");
  960. //button(Import_Config, "Import");
  961. //button(Export_Config, "Export");
  962.  
  963. groupbox(TopLeftGroupBox_X + GroupBoxSize_Width + 5, 52, GroupBoxSize_Width, GroupBoxSize_Height, "test");
  964.  
  965.  
  966.  
  967. //
  968.  
  969. }
  970. else if (tab_selected == 5)
  971. {
  972. std::string knife_options[15] = {
  973. "Default",
  974. "M9 Bayonet",
  975. "Bayonet",
  976. "Flip",
  977. "Gut",
  978. "Karambit",
  979. "Huntsman",
  980. "Falchion",
  981. "Bowie",
  982. "Butterfly",
  983. "Shadow Daggers",
  984. "Navaja",
  985. "Stiletto",
  986. "Ursus",
  987. "Talon"
  988. };
  989.  
  990. std::string skin_list[17] = {
  991. "None",
  992. "Candy Apple",
  993. "Skulls",
  994. "Gunsmoke",
  995. "Bulldozer",
  996. "Carbon Fiber",
  997. "Ultraviolet",
  998. "Death By Kitty",
  999. "Emerald",
  1000. "Dragon King",
  1001. "Doppler",
  1002. "Monkey Business",
  1003. "Sun In Leo",
  1004. "Gamma Doppler",
  1005. "Aloha",
  1006. "White Out",
  1007. "Cyrex"
  1008. };
  1009.  
  1010. std::string weapon_options[10] = {
  1011. "Knife",
  1012. "Scar20",
  1013. "G3SG1",
  1014. "SSG08",
  1015. "AK47",
  1016. "M4A4",
  1017. "M4A1-S",
  1018. "DEAGLE",
  1019. "REVOLVER",
  1020. "CZ75"
  1021. };
  1022. static int SelectedWeapon;
  1023.  
  1024. if (SelectedWeapon == 0) {
  1025. this->ListBox(5, 50, GroupBoxSize_Width / 1.5, (GroupBoxSize_Height * 2) + 5, 10, "Weapon", weapon_options, &SelectedWeapon);
  1026. 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);
  1027. 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);
  1028. }
  1029. else {
  1030. this->ListBox(5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5, 10, "Weapon", weapon_options, &SelectedWeapon);
  1031.  
  1032. switch (SelectedWeapon) {
  1033. 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;
  1034. 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;
  1035. 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;
  1036. 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;
  1037. 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;
  1038. 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;
  1039. 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;
  1040. 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;
  1041. 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;
  1042. }
  1043.  
  1044. }
  1045. }
  1046. else if (tab_selected == 6)
  1047. {
  1048. DoPlayerList(5, 50, GroupBoxSize_Width, (GroupBoxSize_Height * 2) + 5);
  1049. }
  1050. }
  1051.  
  1052. void Menu::DoPlayerList(int x, int y, int w, int h) {
  1053. g_pSurface->FilledRect(_pos.x + x, _pos.y + y, w, h, Color(25, 26, 33, MenuAlpha_Main));
  1054. g_pSurface->OutlinedRect(_pos.x + x, _pos.y + y, w, h, Color(40, 44, 53, MenuAlpha_Main));
  1055.  
  1056. g_pSurface->FilledRect(_pos.x + x + 1, _pos.y + y + 1, w - 2, 15, Color(31, 31, 38, MenuAlpha_Main));
  1057. 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));
  1058.  
  1059. g_pSurface->DrawT(_pos.x + x + (w / 2), _pos.y + y + 1, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, true, "Players");
  1060.  
  1061. if (g_pEngine->IsInGame() && g_pEngine->IsConnected()) {
  1062. for (int i = 0; i < g_pGlobalVars->maxClients; i++) {
  1063. auto Entity = g_pEntityList->GetClientEntity(i);
  1064.  
  1065. if (!Globals::LocalPlayer || !Entity)
  1066. continue;
  1067.  
  1068. if (Entity->GetTeam() == Globals::LocalPlayer->GetTeam())
  1069. continue;
  1070.  
  1071. PlayerInfo_s EntityInfo;
  1072.  
  1073. if (g_pEngine->GetPlayerInfo(i, &EntityInfo)) {
  1074. auto SteamID = EntityInfo.iSteamID;
  1075.  
  1076. PlayerList_Player[i] = SteamID;
  1077. static int selected_player;
  1078.  
  1079. RECT Area = { _pos.x + x, _pos.y + y + 17 + (16 * i), w, 15 };
  1080.  
  1081. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(Area.left, Area.top, Area.right, Area.bottom) && menuOpened) {
  1082. selected_player = SteamID;
  1083. }
  1084.  
  1085. if (selected_player == SteamID) {
  1086. g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(28, 28, 35, MenuAlpha_Main));
  1087. }
  1088. else {
  1089. g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(21, 21, 28, MenuAlpha_Main));
  1090. }
  1091.  
  1092. g_pSurface->OutlinedRect(Area.left, Area.top, Area.right, Area.bottom, Color(40, 44, 53, MenuAlpha_Main));
  1093.  
  1094. g_pSurface->DrawT(Area.left + (Area.right / 2), Area.top + 1, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, true, EntityInfo.szName);
  1095.  
  1096. }
  1097.  
  1098. }
  1099. }
  1100.  
  1101. }
  1102. void Menu::groupbox(int x, int y, int w, int h, std::string name, bool dont_draw, bool has_subtabs)
  1103. {
  1104. if (!dont_draw)
  1105. {
  1106. // g_pSurface->OutlinedRect(_pos.x + x - 1, _pos.y + y - 1, w + 2, h + 2, Color(0, 0, 0, 185));
  1107. g_pSurface->FilledRect(_pos.x + x, _pos.y + y, w, h, Color(25, 26, 33, MenuAlpha_Main));
  1108. g_pSurface->OutlinedRect(_pos.x + x, _pos.y + y, w, h, Color(40, 44, 53, MenuAlpha_Main));
  1109. // g_pSurface->DrawT(_pos.x + x + 15, _pos.y + y - (text_size.bottom / 2), Color(181, 181, 181, MenuAlpha_Main), g::GroupboxFont, false, name.c_str());
  1110. auto a = _pos;
  1111. }
  1112.  
  1113.  
  1114. int ItemsToDraw = h / 24;
  1115. Vector2D a = g_pSurface->GetMousePosition();
  1116. // x left 2 right (im braindead)
  1117.  
  1118. groupbox_top = _pos.y + y;
  1119.  
  1120. if (has_subtabs)
  1121. {
  1122. y_offset = (_pos.y + (y + 34));
  1123. }
  1124. else
  1125. {
  1126. y_offset = (_pos.y + (y + 12));
  1127. }
  1128.  
  1129.  
  1130. x_offset = _pos.x + x;
  1131. groupbox_bottom = (_pos.y + (y + h));
  1132. groupbox_width = (_pos.x + (x + w));
  1133. }
  1134.  
  1135. void Menu::ScrollableGroupBox(int x, int y, int w, int h)
  1136. {
  1137. static bool pressed = false;
  1138. static int add;
  1139. if (GetAsyncKeyState(VK_DOWN) & 1)
  1140. {
  1141. add += 16;
  1142. }
  1143.  
  1144. if (GetAsyncKeyState(VK_UP) & 1)
  1145. {
  1146. add -= 16;
  1147. }
  1148.  
  1149.  
  1150. y_offset = y_offset + add;
  1151. }
  1152.  
  1153. void Menu::checkbox(std::string name, bool* item)
  1154. {
  1155. if (groupbox_bottom <= y_offset + 16)
  1156. return;
  1157.  
  1158.  
  1159. int size = 8;
  1160.  
  1161. static bool pressed = false;
  1162.  
  1163. RECT text_size = g_pSurface->GetTextSizeRect(Globals::SmallText, name.c_str());
  1164.  
  1165. if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 6, y_offset, size + 17 + text_size.right,
  1166. size) && !dont_recieve_input && menuOpened)
  1167. {
  1168. if (pressed)
  1169. *item = !*item;
  1170. pressed = false;
  1171. }
  1172.  
  1173. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 6, y_offset, size + 17 + text_size.right,
  1174. size) && !pressed)
  1175. pressed = true;
  1176.  
  1177.  
  1178. if (*item == true)
  1179. {
  1180. g_pSurface->FilledRect(x_offset + 6, y_offset, size, size,
  1181. Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b,
  1182. MenuAlpha_Main));
  1183.  
  1184. g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1185. name.c_str());
  1186. }
  1187. else
  1188. {
  1189. g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1190. name.c_str());
  1191.  
  1192. g_pSurface->FilledRect(x_offset + 6, y_offset, size, size, Color(75, 74, 85, MenuAlpha_Main));
  1193. }
  1194.  
  1195.  
  1196. g_pSurface->OutlinedRect(x_offset + 6, y_offset, size, size, Color(0, 0, 0, MenuAlpha_Main / 1.05));
  1197.  
  1198. // g_pSurface->DrawT(x_offset + 40, y_offset - 4, Color(0, 0, 0, MenuAlpha_Main), g::SmallText, false, name.c_str());
  1199.  
  1200.  
  1201. y_offset += 16;
  1202. }
  1203.  
  1204. void Menu::combobox(int size, std::string name, std::string* itemname, int* item)
  1205. {
  1206. if (groupbox_bottom <= y_offset + 25)
  1207. return;
  1208.  
  1209. bool pressed = false;
  1210. bool open = false;
  1211. static bool selected_opened = false;
  1212. static bool click_rest;
  1213. static bool rest;
  1214. static std::string name_selected;
  1215.  
  1216. int ComboSize = 180; // 163
  1217. static int offset = 0;
  1218. if (name == "")
  1219. {
  1220. offset = -3;
  1221. }
  1222. else
  1223. {
  1224. offset = 14;
  1225. }
  1226.  
  1227. if (menuOpened)
  1228. {
  1229. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset + offset, ComboSize, 20)
  1230. && !click_rest && !dont_recieve_input)
  1231. {
  1232. name_selected = name;
  1233. pressed = true;
  1234. click_rest = true;
  1235. }
  1236. else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
  1237. x_offset + 20, y_offset + offset, ComboSize, 20))
  1238. click_rest = false;
  1239.  
  1240. if (pressed)
  1241. {
  1242. if (!rest)
  1243. selected_opened = !selected_opened;
  1244. rest = true;
  1245. }
  1246. else
  1247. rest = false;
  1248.  
  1249. if (name_selected == name)
  1250. open = selected_opened;
  1251. }
  1252.  
  1253.  
  1254. g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1255. name.c_str());
  1256.  
  1257. g_pSurface->FilledRect(x_offset + 20, y_offset + offset, ComboSize, 20, Color(45, 46, 53, MenuAlpha_Main));
  1258.  
  1259.  
  1260. g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
  1261. //
  1262. if (open)
  1263. {
  1264. g_pSurface->FilledRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (size * 19),
  1265. Color(45, 46, 53, MenuAlpha_Main));
  1266. g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (size * 19),
  1267. Color(0, 0, 0, MenuAlpha_Main));
  1268.  
  1269. for (int i = 0; i < size; i++)
  1270. {
  1271. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
  1272. x_offset + 20, y_offset + offset + 4 + 4 + 15 + i * 19, ComboSize, 19))
  1273. {
  1274. *item = i;
  1275. }
  1276.  
  1277.  
  1278. if (i == *item)
  1279. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19,
  1280. Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false, itemname[i].c_str());
  1281. else
  1282. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19,
  1283. Color(123, 123, 123, MenuAlpha_Main), Globals::SmallText, false, itemname[i].c_str());
  1284. }
  1285. }
  1286.  
  1287.  
  1288. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 3, Color(255, 255, 255, MenuAlpha_Main),
  1289. Globals::SmallText, false, itemname[*item].c_str());
  1290.  
  1291. if (open) // i added 1 more to 42 bec the space between the main box and the drop down
  1292. {
  1293. if (name == "")
  1294. {
  1295. y_offset += 47 - 26 + (size * 19);
  1296. }
  1297. else
  1298. {
  1299. y_offset += 47 + (size * 19);
  1300. }
  1301. }
  1302. else
  1303. {
  1304. if (name == "")
  1305. {
  1306. y_offset += 47 - 26;
  1307. }
  1308. else
  1309. {
  1310. y_offset += 41;
  1311. }
  1312. }
  1313. }
  1314.  
  1315. void Menu::slider(int max, std::string name, int* item, std::string suffix, int step)
  1316. {
  1317. if (groupbox_bottom <= y_offset + 30)
  1318. return;
  1319.  
  1320. float SliderSize = 180; // 163
  1321.  
  1322. float _pixel_value = max / SliderSize;
  1323. static bool opened = false;
  1324. if (menuOpened)
  1325. {
  1326. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20 - 3, y_offset + 14,
  1327. SliderSize + (3 * 2), 8) && !dont_recieve_input && menuOpened)
  1328. {
  1329. *item = abs(g_pSurface->GetMousePosition().x - (x_offset + 20)) * _pixel_value;
  1330. }
  1331.  
  1332.  
  1333. static bool pressed_subtract = false;
  1334. static bool pressed_add = false;
  1335. }
  1336.  
  1337. std::string namedisplay;
  1338.  
  1339. namedisplay += name.c_str();
  1340.  
  1341. //namedisplay += " - ";
  1342.  
  1343. //namedisplay += std::to_string(*item).c_str();
  1344.  
  1345. if (*item > max)
  1346. {
  1347. *item = max;
  1348. }
  1349.  
  1350. if (*item < 0)
  1351. {
  1352. *item = 0;
  1353. }
  1354.  
  1355. g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1356. namedisplay.c_str());
  1357.  
  1358. g_pSurface->FilledRect(x_offset + 20, y_offset + 14, SliderSize, 8, Color(45, 46, 53, MenuAlpha_Main));
  1359. UINT hp = SliderSize - *item / max;
  1360.  
  1361. int Red = 255 - ((SliderSize * (*item / _pixel_value) * 2.55));
  1362. int Green = (SliderSize * (*item / _pixel_value) * 2.55);
  1363.  
  1364. if (*item)
  1365. {
  1366. if (*item == max) //to fix dumb math stufffff bec pixel size
  1367. g_pSurface->FilledRect(x_offset + 20, y_offset + 14, SliderSize, 8,
  1368. Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b,
  1369. MenuAlpha_Main));
  1370. else
  1371. g_pSurface->FilledRect(x_offset + 20, y_offset + 14, (*item / _pixel_value), 8,
  1372. Color(c_config::get().menu_color_r, c_config::get().menu_color_g, c_config::get().menu_color_b,
  1373. MenuAlpha_Main));
  1374. }
  1375.  
  1376. g_pSurface->OutlinedRect(x_offset + 20, y_offset + 14, SliderSize, 8, Color(0, 0, 0, MenuAlpha_Main));
  1377.  
  1378. std::string gay2;
  1379. gay2 += std::to_string(*item);
  1380. gay2 += suffix.c_str();
  1381.  
  1382. RECT Text_Size_Meme = g_pSurface->GetTextSizeRect(Globals::SmallText, gay2.c_str());
  1383.  
  1384. g_pSurface->DrawT(x_offset + (SliderSize) - Text_Size_Meme.right + 30, y_offset, Color(255, 255, 255, MenuAlpha_Main),
  1385. Globals::SmallText, true, "%s%s", std::to_string(*item).c_str(), suffix.c_str());
  1386.  
  1387. //g_pSurface->DrawT(x_offset + 18, y_offset + 11, Color(100, 100, 100, MenuAlpha_Main), g::SmallText, false, "-");
  1388.  
  1389. //g_pSurface->DrawT(x_offset + 21 + SliderSize+ 20, y_offset + 11, Color(100, 100, 100, MenuAlpha_Main), g::SmallText, false, "+");
  1390. //
  1391. y_offset += 30;
  1392. }
  1393.  
  1394. void Menu::MultiComboBox(float indexes, std::string name, std::string* itemname, bool* item)
  1395. {
  1396. static bool multiPressed = false;
  1397. bool pressed = false;
  1398. bool open = false;
  1399. static bool selectedOpened = false;
  1400. static bool clickRest;
  1401. static bool rest;
  1402. static std::string nameSelected;
  1403. std::string itemsSelected = "";
  1404. int lastItem = 0;
  1405. int ComboSize = 180;
  1406.  
  1407. int offset = 0;
  1408. if (name == "")
  1409. {
  1410. offset = 0;
  1411. }
  1412. else
  1413. {
  1414. offset = 14;
  1415. }
  1416.  
  1417. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset + offset, ComboSize, 17) && !clickRest
  1418. )
  1419. {
  1420. nameSelected = name;
  1421. pressed = true;
  1422. clickRest = true;
  1423. }
  1424. else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset + offset, ComboSize, 20))
  1425. clickRest = false;
  1426.  
  1427. if (pressed)
  1428. {
  1429. if (!rest)
  1430. selectedOpened = !selectedOpened;
  1431.  
  1432. rest = true;
  1433. }
  1434. else
  1435. rest = false;
  1436.  
  1437. if (nameSelected == name)
  1438. open = selectedOpened;
  1439.  
  1440. g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1441. name.c_str());
  1442.  
  1443. g_pSurface->FilledRect(x_offset + 20, y_offset + offset - 2, ComboSize, 20, Color(45, 46, 53, MenuAlpha_Main));
  1444. g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset - 2, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
  1445.  
  1446. if (open)
  1447. {
  1448. g_pSurface->FilledRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (indexes * 19),
  1449. Color(45, 46, 53, MenuAlpha_Main));
  1450. g_pSurface->OutlinedRect(x_offset + 20, y_offset + offset + 2 + 19, ComboSize, (indexes * 19),
  1451. Color(0, 0, 0, MenuAlpha_Main));
  1452.  
  1453. for (int i = 0; i < indexes; i++)
  1454. {
  1455. if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
  1456. x_offset + 20, y_offset + offset + 4 + 4 + 15 + i * 19, ComboSize, 20))
  1457. {
  1458. if (multiPressed)
  1459. item[i] = !item[i];
  1460. multiPressed = false;
  1461. }
  1462.  
  1463. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(
  1464. x_offset + 20, y_offset + offset + 16 + (i * 19), ComboSize, 20) && !multiPressed)
  1465. multiPressed = true;
  1466.  
  1467. if (item[i])
  1468. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19, Color(255, 255, 255, MenuAlpha_Main),
  1469. Globals::SmallText, false, itemname[i].c_str());
  1470. else
  1471. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 4 + 4 + 15 + i * 19, Color(185, 185, 185, MenuAlpha_Main),
  1472. Globals::SmallText, false, itemname[i].c_str());
  1473. }
  1474. }
  1475.  
  1476. bool items = false;
  1477.  
  1478. for (int i = 0; i < indexes; i++)
  1479. {
  1480. if (item[i])
  1481. {
  1482. if (lastItem < i)
  1483. lastItem = i;
  1484. }
  1485. }
  1486.  
  1487. for (int i = 0; i < indexes; i++)
  1488. {
  1489. if (item[i])
  1490. {
  1491. items = true;
  1492. RECT TextSize = g_pSurface->GetTextSizeRect(Globals::SmallText, itemsSelected.c_str());
  1493. RECT TextSizeGonaAdd = g_pSurface->GetTextSizeRect(Globals::SmallText, itemname[i].c_str());
  1494. if (TextSize.right + TextSizeGonaAdd.right < ComboSize)
  1495. itemsSelected += std::to_string(i) + ((lastItem == i) ? "" : ", ");
  1496. }
  1497. }
  1498.  
  1499. if (!items)
  1500. itemsSelected = "Disabled";
  1501.  
  1502. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + offset + 1, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1503. itemsSelected.c_str());
  1504.  
  1505. if (open) // i added 1 more to 42 bec the space between the main box and the drop down
  1506. y_offset += 52 + (indexes * 16);
  1507. else
  1508. y_offset += 41;
  1509. }
  1510.  
  1511. char* KeyStringsStick[254] = {
  1512. "INVLD", "M1", "M2", "BRK", "M3", "M4", "M5",
  1513. "INVLD", "BSPC", "TAB", "INVLD", "INVLD", "INVLD", "ENTER", "INVLD", "INVLD", "SHI",
  1514. "CTRL", "ALT", "PAU", "CAPS", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1515. "ESC", "INVLD", "INVLD", "INVLD", "INVLD", "SPACE", "PGUP", "PGDOWN", "END", "HOME", "LEFT",
  1516. "UP", "RIGHT", "DOWN", "INVLD", "PRNT", "INVLD", "PRTSCR", "INS", "DEL", "INVLD", "0", "1",
  1517. "2", "3", "4", "5", "6", "7", "8", "9", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1518. "INVLD", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
  1519. "V", "W", "X", "Y", "Z", "LFTWIN", "RGHTWIN", "INVLD", "INVLD", "INVLD", "NUM0", "NUM1",
  1520. "NUM2", "NUM3", "NUM4", "NUM5", "NUM6", "NUM7", "NUM8", "NUM9", "*", "+", "_", "-", ".", "/", "F1", "F2", "F3",
  1521. "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20",
  1522. "F21",
  1523. "F22", "F23", "F24", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1524. "NUM LOCK", "SCROLL LOCK", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1525. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "LSHFT", "RSHFT", "LCTRL",
  1526. "RCTRL", "LMENU", "RMENU", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1527. "INVLD", "INVLD", "INVLD", "NTRK", "PTRK", "STOP", "PLAY", "INVLD", "INVLD",
  1528. "INVLD", "INVLD", "INVLD", "INVLD", ";", "+", ",", "-", ".", "/?", "~", "INVLD", "INVLD",
  1529. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1530. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1531. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "{", "\\|", "}", "'\"", "INVLD",
  1532. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1533. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1534. "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD", "INVLD",
  1535. "INVLD", "INVLD"
  1536. };
  1537.  
  1538. bool keys[256];
  1539. bool oldKeys[256];
  1540.  
  1541. bool GetKeyPress(unsigned int key)
  1542. {
  1543. if (keys[key] == true && oldKeys[key] == false)
  1544. return true;
  1545. return false;
  1546. }
  1547.  
  1548. void Menu::keybind(int* item, std::string name)
  1549. {
  1550. if (groupbox_bottom <= y_offset + 41)
  1551. return;
  1552.  
  1553. int ComboSize = 180; // 163
  1554. static std::string nameSelected;
  1555.  
  1556.  
  1557. static bool IsGettingKey = false;
  1558. static int Key = 0;
  1559. static bool GoodKeyName = false;
  1560. Color text_color = Color(120, 120, 120, 255);
  1561. std::copy(keys, keys + 255, oldKeys);
  1562. for (int x = 0; x < 255; x++)
  1563. {
  1564. //oldKeys[x] = oldKeys[x] & keys[x];
  1565. keys[x] = (GetAsyncKeyState(x));
  1566. }
  1567.  
  1568. char NameBuffer[128];
  1569. char* KeyName = "Unbinded";
  1570. RECT text_size = g_pSurface->GetTextSizeRect(Globals::SmallText, KeyName);
  1571. static bool LetsBindy0 = false;
  1572. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset, 157, 20) && menuOpened)
  1573. {
  1574. if (!IsGettingKey)
  1575. {
  1576. IsGettingKey = true;
  1577. }
  1578. }
  1579.  
  1580. if (IsGettingKey)
  1581. {
  1582. for (int i = 0; i < 255; i++)
  1583. {
  1584. if (GetKeyPress(i))
  1585. {
  1586. if (i == VK_ESCAPE)
  1587. {
  1588. Key = -1;
  1589. *item = Key;
  1590. IsGettingKey = false;
  1591. return;
  1592. }
  1593.  
  1594. Key = i;
  1595. *item = Key;
  1596. IsGettingKey = false;
  1597. return;
  1598. }
  1599. }
  1600. }
  1601.  
  1602.  
  1603. if (IsGettingKey)
  1604. {
  1605. KeyName = "~~~~~";
  1606. text_color = Color(255, 255, 255, 255);
  1607. }
  1608. else
  1609. {
  1610. if (*item >= 0)
  1611. {
  1612. KeyName = KeyStringsStick[*item];
  1613. if (KeyName)
  1614. {
  1615. GoodKeyName = true;
  1616. }
  1617. else
  1618. {
  1619. if (GetKeyNameText(*item << 16, NameBuffer, 127))
  1620. {
  1621. KeyName = NameBuffer;
  1622. GoodKeyName = true;
  1623. }
  1624. }
  1625. }
  1626.  
  1627. if (!GoodKeyName)
  1628. {
  1629. KeyName = "Unbinded";
  1630. }
  1631. }
  1632.  
  1633. if (manually_set_key)
  1634. {
  1635. Key = *item;
  1636. manually_set_key = false;
  1637. }
  1638.  
  1639.  
  1640. g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(45, 46, 53, MenuAlpha_Main));
  1641. g_pSurface->OutlinedRect(x_offset + 20, y_offset, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
  1642. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1643. KeyName);
  1644.  
  1645. y_offset += 29;
  1646. }
  1647.  
  1648. unsigned int rgb(double hue)
  1649. {
  1650. int h = int(hue * 256 * 6);
  1651. int x = h % 0x100;
  1652.  
  1653. int r = 0, g = 0, b = 0;
  1654. switch (h / 256)
  1655. {
  1656. case 0: r = 255;
  1657. g = x;
  1658. break;
  1659. case 1: g = 255;
  1660. r = 255 - x;
  1661. break;
  1662. case 2: g = 255;
  1663. b = x;
  1664. break;
  1665. case 3: b = 255;
  1666. g = 255 - x;
  1667. break;
  1668. case 4: b = 255;
  1669. r = x;
  1670. break;
  1671. case 5: r = 255;
  1672. b = 255 - x;
  1673. break;
  1674. }
  1675.  
  1676. return r + (g << 8) + (b << 16);
  1677. }
  1678.  
  1679. void color_spectrum(int x, int y)
  1680. {
  1681. int Width = 168, Height = 179;
  1682.  
  1683. for (int i = 0; i < Width; i++)
  1684. {
  1685. int div = Width / 6;
  1686. int phase = i / div;
  1687. float t = (i % div) / (float)div;
  1688. int r, g, b;
  1689.  
  1690. switch (phase)
  1691. {
  1692. case(0):
  1693. r = 255;
  1694. g = 255 * t;
  1695. b = 0;
  1696. break;
  1697. case(1):
  1698. r = 255 * (1.f - t);
  1699. g = 255;
  1700. b = 0;
  1701. break;
  1702. case(2):
  1703. r = 0;
  1704. g = 255;
  1705. b = 255 * t;
  1706. break;
  1707. case(3):
  1708. r = 0;
  1709. g = 255 * (1.f - t);
  1710. b = 255;
  1711. break;
  1712. case(4):
  1713. r = 255 * t;
  1714. g = 0;
  1715. b = 255;
  1716. break;
  1717. case(5):
  1718. r = 255;
  1719. g = 0;
  1720. b = 255 * (1.f - t);
  1721. break;
  1722. }
  1723.  
  1724. for (int k = 0; k < Height; k++)
  1725. {
  1726. float sat = k / (float)Height;
  1727. int _r = r + sat * (128 - r);
  1728. int _g = g + sat * (128 - g);
  1729. int _b = b + sat * (128 - b);
  1730. g_pSurface->DrawSetColor(_r, _g, _b, 255);
  1731. g_pSurface->DrawFilledRect(10 + i, 10 + k, 1, 1);
  1732. }
  1733. }
  1734. }
  1735.  
  1736. #include <conio.h>
  1737. #include <iostream>
  1738. #include <windows.h>
  1739. #include <stdlib.h>
  1740.  
  1741. void Menu::EmptySpace(std::string name)
  1742. {
  1743. if (groupbox_bottom <= y_offset + 16)
  1744. return;
  1745.  
  1746. g_pSurface->DrawT(x_offset + 20, y_offset - 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  1747. name.c_str());
  1748.  
  1749. y_offset += 16;
  1750. }
  1751.  
  1752. void Menu::color_selector(std::string name, int* red, int* green, int* blue, int* alpha)
  1753. {
  1754. if (groupbox_bottom <= y_offset + 16)
  1755. return;
  1756.  
  1757. bool pressed = false;
  1758. bool open = false;
  1759. static bool selected_opened = false;
  1760. static bool click_rest;
  1761. static bool rest;
  1762. static std::string name_selected;
  1763.  
  1764. int ComboSize = 127; // 163
  1765. int ComboSizeH = 127; // 163
  1766. static int offset = 0;
  1767. if (name == "sadasd")
  1768. {
  1769. offset = 0;
  1770. }
  1771. else
  1772. {
  1773. offset = 14;
  1774. }
  1775.  
  1776. if (menuOpened)
  1777. {
  1778. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8) && !
  1779. click_rest)
  1780. {
  1781. name_selected = name;
  1782. pressed = true;
  1783. click_rest = true;
  1784. }
  1785. else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8))
  1786. click_rest = false;
  1787.  
  1788. if (pressed)
  1789. {
  1790. if (!rest)
  1791. selected_opened = !selected_opened;
  1792. rest = true;
  1793. }
  1794. else
  1795. rest = false;
  1796.  
  1797. if (name_selected == name)
  1798. open = selected_opened;
  1799. }
  1800.  
  1801.  
  1802. static unsigned int r = 255;
  1803. static unsigned int g = 0;
  1804. static unsigned int b = 0;
  1805.  
  1806.  
  1807. static unsigned int selected_r = 0;
  1808. static unsigned int selected_g = 0;
  1809. static unsigned int selected_b = 0;
  1810.  
  1811. static Vector2D MousePos;
  1812. COLORREF color;
  1813. COLORREF selected_color;
  1814.  
  1815. if (open)
  1816. {
  1817. dont_recieve_input = true;
  1818. g_pSurface->FilledRect(x_offset + 225 - ComboSize - 5, y_offset, ComboSize, ComboSizeH,
  1819. Color(21, 23, 27, MenuAlpha_Main));
  1820.  
  1821. g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5, y_offset, ComboSize, ComboSizeH,
  1822. Color(42, 46, 46, MenuAlpha_Main));
  1823. g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5 - 1, y_offset - 1, ComboSize + 2, ComboSizeH + 2,
  1824. Color(34, 38, 37, MenuAlpha_Main));
  1825.  
  1826. float _pixel_value = 255 / (ComboSize - 5 - 17);
  1827.  
  1828. //if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20 - 3, y_offset + 14, SliderSize + (3 * 2), 8)) {
  1829. // *item = abs(g_pSurface->GetMousePosition().x - (x_offset + 20)) * _pixel_value;
  1830. //}
  1831.  
  1832. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225 - ComboSize - 5 + 5,
  1833. y_offset + ComboSizeH - 11, (ComboSize - 5 - 17),
  1834. 7) && menuOpened)
  1835. {
  1836. *alpha = abs(g_pSurface->GetMousePosition().x - (x_offset + 225 - ComboSize - 5 + 5)) * _pixel_value;
  1837. }
  1838.  
  1839.  
  1840. if (*alpha < 3)
  1841. {
  1842. *alpha = 0;
  1843. }
  1844.  
  1845. if (*alpha > 204)
  1846. {
  1847. *alpha = 255;
  1848. }
  1849.  
  1850. g_pSurface->FilledRect(x_offset + 225 - ComboSize - 5 + 5, y_offset + ComboSizeH - 11, ComboSize - 5 - 17, 7,
  1851. Color(255, 255, 255, *alpha));
  1852. g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5 + 5, y_offset + ComboSizeH - 11, ComboSize - 5 - 17, 7,
  1853. Color(0, 0, 0, MenuAlpha_Main));
  1854.  
  1855.  
  1856. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 233 - ComboSize + 101 + 1,
  1857. y_offset + 5 + 1, 7 - 2, 107 - 1))
  1858. {
  1859. HDC hdc = GetDC(nullptr);
  1860. color = GetPixel(hdc, g_pSurface->GetMousePosition().x, g_pSurface->GetMousePosition().y);
  1861.  
  1862. r = GetRValue(color);
  1863. g = GetGValue(color);
  1864. b = GetBValue(color);
  1865. }
  1866.  
  1867.  
  1868. GradientH(x_offset + 225 - ComboSize - 5 + 5, y_offset + 5, ComboSize - 5 - 17, ComboSizeH - 20,
  1869. Color(255, 255, 255), Color(r, g, b));
  1870. GradientVEnd(x_offset + 225 - ComboSize - 5 + 5, y_offset + 40, ComboSize - 5 - 17, ComboSizeH - 20,
  1871. Color(0, 0, 0), Color(0, 0, 0));
  1872.  
  1873.  
  1874. //g_pSurface->OutlinedRect(MousePos.x - 4, MousePos.y - 4, 8, 8, Color(0, 0, 0, MenuAlpha_Main));
  1875. g_pSurface->OutlinedRect(x_offset + 225 - ComboSize - 5 + 5, y_offset + 5, ComboSize - 5 - 17, ComboSizeH - 20,
  1876. Color(0, 0, 0, MenuAlpha_Main));
  1877.  
  1878. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225 - ComboSize - 5 + 5 + 1,
  1879. y_offset + 5 + 1, ComboSize - 5 - 17 - 2,
  1880. ComboSizeH - 20 - 2))
  1881. {
  1882. HDC hdc = GetDC(nullptr);
  1883. selected_color = GetPixel(hdc, g_pSurface->GetMousePosition().x, g_pSurface->GetMousePosition().y);
  1884.  
  1885. selected_r = GetRValue(selected_color);
  1886. selected_g = GetGValue(selected_color);
  1887. selected_b = GetBValue(selected_color);
  1888.  
  1889. *red = selected_r;
  1890. *green = selected_g;
  1891. *blue = selected_b;
  1892.  
  1893. MousePos = Vector2D(g_pSurface->GetMousePosition().x, g_pSurface->GetMousePosition().y);
  1894. }
  1895.  
  1896. Color rainbow; int hue;
  1897. for (int i = 0; i < 100; i++)
  1898. {
  1899. float hue = (i * .01f);
  1900. rainbow.FromHSV(hue, 1.f, 1.f);
  1901. g_pSurface->FilledRect(x_offset + 233 - ComboSize + 101, y_offset + 5 + i, 7, 8, rainbow);
  1902. g_pSurface->OutlinedRect(x_offset + 233 - ComboSize + 101, y_offset + 5, 7, 107, Color(0, 0, 0, 255));
  1903. }
  1904. }
  1905. else
  1906. {
  1907. dont_recieve_input = false;
  1908. }
  1909.  
  1910.  
  1911. if (*red > 20 && *green > 20 && *blue > 20)
  1912. {
  1913. g_pSurface->FilledRect(x_offset + 225, y_offset, 15, 7, Color(*red, *green, *blue, MenuAlpha_Main));
  1914. }
  1915. else
  1916. {
  1917. g_pSurface->FilledRect(x_offset + 225, y_offset, 15, 7, Color(*red, *green, *blue, MenuAlpha_Main));
  1918. }
  1919.  
  1920.  
  1921. g_pSurface->OutlinedRect(x_offset + 225 - 1, y_offset - 1, 15 + 2, 7 + 2, Color(0, 0, 0, MenuAlpha_Main));
  1922.  
  1923. if (open)
  1924. {
  1925. y_offset += ComboSizeH;
  1926. }
  1927.  
  1928.  
  1929. //Color rainbow;
  1930.  
  1931. //Color Test2;
  1932.  
  1933. //static float test;
  1934.  
  1935. ////static DWORD color;
  1936. //static DWORD store_color;
  1937. //if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225 - 93, y_offset + 1, 108, 8)) {
  1938.  
  1939.  
  1940. //}
  1941. //else {
  1942. // unsigned int r = GetRValue(color);
  1943. // unsigned int g = GetGValue(color);
  1944. // unsigned int b = GetBValue(color);
  1945.  
  1946. // *red = r;
  1947. // *green = g;
  1948. // *blue = b;
  1949.  
  1950. // GradientV(x_offset + 225, y_offset, 16, 9, Color(*red, *green, *blue), Color(*red, *green, *blue));
  1951. // g_pSurface->OutlinedRect(x_offset + 225, y_offset, 16, 9, Color(0, 0, 0, MenuAlpha_Main));
  1952. //}
  1953.  
  1954. }
  1955.  
  1956. char* KeyDigits[254] = {
  1957. nullptr, "Left Mouse", "Right Mouse", "Control+Break", "Middle Mouse", "Mouse 4", "Mouse 5",
  1958. nullptr, "Backspace", "TAB", nullptr, nullptr, nullptr, "ENTER", nullptr, nullptr, "SHIFT", "CTRL", "ALT", "PAUSE",
  1959. "CAPS LOCK", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "ESC", nullptr, nullptr, nullptr, nullptr,
  1960. "SPACEBAR",
  1961. "PG UP", "PG DOWN", "END", "HOME", "Left", "Up", "Right", "Down", nullptr, "Print", nullptr, "Print Screen",
  1962. "Insert",
  1963. "Delete", nullptr, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", nullptr, nullptr, nullptr, nullptr, nullptr,
  1964. nullptr,
  1965. nullptr, "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
  1966. "V", "W", "X",
  1967. "Y", "Z", "Left Windows", "Right Windows", nullptr, nullptr, nullptr, "0", "1", "2", "3", "4", "5", "6",
  1968. "7", "8", "9", "*", "+", "_", "-", ".", "/", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11",
  1969. "F12",
  1970. "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", nullptr, nullptr, nullptr,
  1971. nullptr, nullptr,
  1972. nullptr, nullptr, nullptr, "NUM LOCK", "SCROLL LOCK", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
  1973. nullptr, nullptr,
  1974. nullptr, nullptr, nullptr, nullptr, nullptr, "LSHIFT", "RSHIFT", "LCONTROL", "RCONTROL", "LMENU", "RMENU", nullptr,
  1975. nullptr, nullptr,
  1976. nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "Next Track", "Previous Track", "Stop", "Play/Pause",
  1977. nullptr, nullptr,
  1978. nullptr, nullptr, nullptr, nullptr, ";", "+", ",", "-", ".", "/?", "~", nullptr, nullptr, nullptr, nullptr,
  1979. nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
  1980. nullptr, nullptr,
  1981. nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, "[{", "\\|", "}]", "'\"", nullptr, nullptr, nullptr,
  1982. nullptr,
  1983. nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
  1984. nullptr, nullptr,
  1985. nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
  1986. };
  1987.  
  1988. void Menu::TextBox(std::string name, std::string* text)
  1989. {
  1990. if (groupbox_bottom <= y_offset + 16)
  1991. return;
  1992.  
  1993. bool pressed = false;
  1994. bool open = false;
  1995. static bool selected_opened = false;
  1996. static bool click_rest;
  1997. static bool rest;
  1998. static std::string name_selected;
  1999.  
  2000. int ComboSize = 127; // 163
  2001. int ComboSizeH = 127; // 163
  2002. static int offset = 0;
  2003. if (name == "")
  2004. {
  2005. offset = 0;
  2006. }
  2007. else
  2008. {
  2009. offset = 14;
  2010. }
  2011.  
  2012. std::copy(keys, keys + 255, oldKeys);
  2013. for (int x = 0; x < 255; x++)
  2014. {
  2015. //oldKeys[x] = oldKeys[x] & keys[x];
  2016. keys[x] = (GetAsyncKeyState(x));
  2017. }
  2018.  
  2019.  
  2020. if (menuOpened)
  2021. {
  2022. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8) && !
  2023. click_rest)
  2024. {
  2025. name_selected = name;
  2026. pressed = true;
  2027. click_rest = true;
  2028. }
  2029. else if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 225, y_offset + 1, 15, 8))
  2030. click_rest = false;
  2031.  
  2032. if (pressed)
  2033. {
  2034. if (!rest)
  2035. selected_opened = !selected_opened;
  2036. rest = true;
  2037. }
  2038. else
  2039. rest = false;
  2040.  
  2041. if (name_selected == name)
  2042. open = selected_opened;
  2043. }
  2044.  
  2045. const char* strg = text->c_str();
  2046. if (open)
  2047. {
  2048. for (int i = 0; i < 255; i++)
  2049. {
  2050. if (GetKeyPress(i))
  2051. {
  2052. if (i == VK_ESCAPE || i == VK_RETURN || i == VK_INSERT)
  2053. {
  2054. open = false;
  2055. return;
  2056. }
  2057.  
  2058. if (i == VK_BACK && strlen(strg) != 0)
  2059. {
  2060. *text = text->substr(0, strlen(strg) - 1);
  2061. }
  2062.  
  2063. if (strlen(strg) < 6 && (i == 0x30 || i == 0x31 || i == 0x32 || i == 0x33 || i == 0x34 || i == 0x35 || i
  2064. == 0x36 || i == 0x37 || i == 0x38 || i == 0x39 || i == VK_NUMPAD0 || i == VK_NUMPAD1 || i ==
  2065. VK_NUMPAD2 || i == VK_NUMPAD3 || i == VK_NUMPAD4 || i == VK_NUMPAD5 || i == VK_NUMPAD6 || i ==
  2066. VK_NUMPAD7 || i == VK_NUMPAD8 || i == VK_NUMPAD9))
  2067. {
  2068. *text = *text + KeyDigits[i];
  2069. return;
  2070. }
  2071. }
  2072. }
  2073. }
  2074.  
  2075. const char* cstr = text->c_str();
  2076. g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(45, 46, 53, MenuAlpha_Main));
  2077. g_pSurface->OutlinedRect(x_offset + 20, y_offset, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
  2078. g_pSurface->DrawT(x_offset + 20 + 5, y_offset + 3, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, false,
  2079. cstr);
  2080.  
  2081. y_offset += 29;
  2082. }
  2083.  
  2084. void Menu::button(ButtonCallback_t callback, std::string title)
  2085. {
  2086. if (groupbox_bottom <= y_offset + 18)
  2087. return;
  2088.  
  2089. int ComboSize = 180;
  2090.  
  2091. static bool pressed = false;
  2092.  
  2093. RECT text_size = g_pSurface->GetTextSizeRect(Globals::SmallText, title.c_str());
  2094.  
  2095. if (!GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset, ComboSize, 20) && menuOpened)
  2096. {
  2097. if (pressed)
  2098. {
  2099. if (callback)
  2100. callback();
  2101. }
  2102. pressed = false;
  2103. }
  2104.  
  2105. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(x_offset + 20, y_offset, ComboSize, 20) && !pressed)
  2106. pressed = true;
  2107.  
  2108. if (g_pSurface->MouseInRegion(x_offset + 20, y_offset, ComboSize, 20) and GetAsyncKeyState(VK_LBUTTON))
  2109. {
  2110. g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(35, 36, 43, MenuAlpha_Main));
  2111. }
  2112. else
  2113. {
  2114. g_pSurface->FilledRect(x_offset + 20, y_offset, ComboSize, 20, Color(45, 46, 53, MenuAlpha_Main));
  2115. }
  2116.  
  2117. g_pSurface->OutlinedRect(x_offset + 20, y_offset, ComboSize, 20, Color(0, 0, 0, MenuAlpha_Main));
  2118.  
  2119. g_pSurface->DrawT(x_offset + 20 + (ComboSize / 2) - (text_size.right / 2),
  2120. y_offset + (20 / 2) - (text_size.bottom / 2) - 1, Color(204, 204, 204, MenuAlpha_Main),
  2121. Globals::SmallText, false, title.c_str());
  2122. y_offset += 26;
  2123. }
  2124.  
  2125.  
  2126. void Menu::ListBox(int x, int y, int w, int h, int size, std::string name, std::string *itemname, int* item) {
  2127. g_pSurface->FilledRect(_pos.x + x, _pos.y + y, w, h, Color(25, 26, 33, MenuAlpha_Main));
  2128. g_pSurface->OutlinedRect(_pos.x + x, _pos.y + y, w, h, Color(40, 44, 53, MenuAlpha_Main));
  2129.  
  2130. g_pSurface->FilledRect(_pos.x + x + 1, _pos.y + y + 1, w - 2, 15, Color(31, 31, 38, MenuAlpha_Main));
  2131. 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));
  2132.  
  2133. g_pSurface->DrawT(_pos.x + x + (w / 2), _pos.y + y + 1, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, true, name.c_str());
  2134.  
  2135. for (int i = 0; i < size; i++) {
  2136. RECT Area = { _pos.x + x, _pos.y + y + 17 + (16 * i), w, 15 };
  2137.  
  2138. if (GetAsyncKeyState(VK_LBUTTON) && g_pSurface->MouseInRegion(Area.left, Area.top, Area.right, Area.bottom) && menuOpened) {
  2139. *item = i;
  2140. }
  2141.  
  2142. if (*item == i) {
  2143. g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(28, 28, 35, MenuAlpha_Main));
  2144. }
  2145. else {
  2146. g_pSurface->FilledRect(Area.left, Area.top, Area.right, Area.bottom, Color(21, 21, 28, MenuAlpha_Main));
  2147. }
  2148.  
  2149. g_pSurface->OutlinedRect(Area.left, Area.top, Area.right, Area.bottom, Color(40, 44, 53, MenuAlpha_Main));
  2150.  
  2151. g_pSurface->DrawT(Area.left + (Area.right / 2), Area.top + 1, Color(255, 255, 255, MenuAlpha_Main), Globals::SmallText, true, itemname[i].c_str());
  2152. }
  2153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement