Advertisement
Guest User

Untitled

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