├── .gitignore ├── LICENSE ├── README.md └── menu ├── items ├── D3DMenuBoolItem.hpp ├── D3DMenuFlagItem.hpp ├── D3DMenuFloatItem.hpp ├── D3DMenuIntItem.hpp ├── D3DMenuSubFolderItem.hpp └── ID3DMenuItem.hpp ├── menu.cpp ├── menu.hpp ├── settings.cpp └── settings.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | /menu/.vs 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Requi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # text_menu 2 | Simple text menu written in C++ 3 | 4 | # Image 5 | ![Example Image](https://i.imgur.com/RSHeZSd.png) 6 | -------------------------------------------------------------------------------- /menu/items/D3DMenuBoolItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ID3DMenuItem.hpp" 3 | 4 | class D3DMenuBoolItem : public ID3DMenuItem 5 | { 6 | public: 7 | D3DMenuBoolItem(const std::string& _name, bool& value_ptr, const bool is_sub_item = false) : 8 | ID3DMenuItem(_name, is_sub_item), value(value_ptr) { } 9 | 10 | std::string get_value_text() const override 11 | { 12 | return value ? "" : ""; 13 | } 14 | 15 | void handle_left() override 16 | { 17 | value = !value; 18 | } 19 | 20 | void handle_right() override 21 | { 22 | value = !value; 23 | } 24 | 25 | private: 26 | bool& value; 27 | }; 28 | -------------------------------------------------------------------------------- /menu/items/D3DMenuFlagItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ID3DMenuItem.hpp" 3 | 4 | class D3DMenuFlagItem : public ID3DMenuItem 5 | { 6 | public: 7 | D3DMenuFlagItem(const std::string& _name, int& value_ptr, const int _flag, const bool is_sub_item = false) : 8 | ID3DMenuItem(_name, is_sub_item), flag(_flag), value(value_ptr) { } 9 | 10 | std::string get_value_text() const override 11 | { 12 | return (value & flag) == flag ? "" : ""; 13 | } 14 | 15 | void handle_left() override 16 | { 17 | if ((value & flag) == flag) 18 | value &= ~flag; 19 | else 20 | value |= flag; 21 | 22 | } 23 | 24 | void handle_right() override 25 | { 26 | if ((value & flag) == flag) 27 | value &= ~flag; 28 | else 29 | value |= flag; 30 | } 31 | 32 | private: 33 | int flag; 34 | int& value; 35 | }; 36 | -------------------------------------------------------------------------------- /menu/items/D3DMenuFloatItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ID3DMenuItem.hpp" 3 | #include 4 | #include 5 | 6 | class D3DMenuFloatItem : public ID3DMenuItem 7 | { 8 | public: 9 | D3DMenuFloatItem(const std::string& _name, float& value_ptr, const float _min, const float _max, const float _steps, const bool is_sub_item = false): 10 | ID3DMenuItem(_name, is_sub_item), value(value_ptr), min_value(_min), max_value(_max), step_value(_steps) {} 11 | 12 | std::string get_value_text() const override 13 | { 14 | std::ostringstream out; 15 | out << "<" << std::setprecision(2) << value << ">"; 16 | return out.str(); 17 | } 18 | 19 | void handle_left() override 20 | { 21 | value -= step_value; 22 | if (value < min_value) 23 | value = min_value; 24 | } 25 | 26 | void handle_right() override 27 | { 28 | value += step_value; 29 | if (value > max_value) 30 | value = max_value; 31 | } 32 | 33 | private: 34 | float& value; 35 | float min_value; 36 | float max_value; 37 | float step_value; 38 | }; 39 | -------------------------------------------------------------------------------- /menu/items/D3DMenuIntItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ID3DMenuItem.hpp" 3 | 4 | class D3DMenuIntItem : public ID3DMenuItem 5 | { 6 | public: 7 | D3DMenuIntItem(const std::string& _name, int& value_ptr, const int _min, const int _max, const int _steps, const bool is_sub_item = false) : 8 | ID3DMenuItem(_name, is_sub_item), value(value_ptr), min_value(_min), max_value(_max), step_value(_steps) {} 9 | 10 | std::string get_value_text() const override 11 | { 12 | return "<" + std::to_string(value) + ">"; 13 | } 14 | 15 | void handle_left() override 16 | { 17 | value -= step_value; 18 | if (value < min_value) 19 | value = min_value; 20 | } 21 | 22 | void handle_right() override 23 | { 24 | value += step_value; 25 | if (value > max_value) 26 | value = max_value; 27 | } 28 | 29 | private: 30 | int& value; 31 | int min_value; 32 | int max_value; 33 | int step_value; 34 | }; -------------------------------------------------------------------------------- /menu/items/D3DMenuSubFolderItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ID3DMenuItem.hpp" 3 | #include 4 | 5 | class D3DMenuSubFolderItem : public ID3DMenuItem 6 | { 7 | public: 8 | D3DMenuSubFolderItem(const std::string& _name, const bool is_sub_item = false) : 9 | ID3DMenuItem(_name, is_sub_item, true) {} 10 | 11 | std::string get_value_text() const override 12 | { 13 | return ""; 14 | } 15 | 16 | void handle_left() override 17 | { 18 | opened = !opened; 19 | } 20 | 21 | void handle_right() override 22 | { 23 | opened = !opened; 24 | } 25 | 26 | void add_sub_item(std::shared_ptr item) 27 | { 28 | sub_items.emplace_back(item); 29 | } 30 | 31 | std::vector> get_sub_items() const 32 | { 33 | return this->sub_items; 34 | } 35 | 36 | bool is_opened() const 37 | { 38 | return this->opened; 39 | } 40 | 41 | private: 42 | std::vector> sub_items; 43 | bool opened = false; 44 | }; 45 | -------------------------------------------------------------------------------- /menu/items/ID3DMenuItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class ID3DMenuItem 5 | { 6 | public: 7 | ID3DMenuItem(const std::string& _name, const bool is_sub_item = false, const bool is_subfolder = false) : 8 | name(_name), sub_folder(is_subfolder), selected(false), sub_item(is_sub_item) {} 9 | 10 | virtual ~ID3DMenuItem() {} 11 | virtual std::string get_value_text() const = 0; 12 | virtual void handle_left() = 0; 13 | virtual void handle_right() = 0; 14 | 15 | virtual std::string get_name() const 16 | { 17 | return this->name; 18 | } 19 | 20 | virtual bool is_subfolder() const 21 | { 22 | return this->sub_folder; 23 | } 24 | 25 | virtual bool& is_selected() 26 | { 27 | return this->selected; 28 | } 29 | 30 | virtual bool is_sub_item() const 31 | { 32 | return this->sub_item; 33 | } 34 | 35 | protected: 36 | std::string name; 37 | bool sub_folder = false; 38 | bool selected = false; 39 | bool sub_item = false; 40 | }; -------------------------------------------------------------------------------- /menu/menu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RequiDev/text_menu/HEAD/menu/menu.cpp -------------------------------------------------------------------------------- /menu/menu.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class ID3DMenuItem; 6 | 7 | class text_menu 8 | { 9 | public: 10 | text_menu(); 11 | private: 12 | void render(); 13 | void draw_menu_item(std::shared_ptr item, float padding = 0.f); 14 | std::vector> get_all_visible_items(); 15 | std::shared_ptr get_current_selected(); 16 | 17 | void handle_left(); 18 | void handle_right(); 19 | void handle_up(); 20 | void handle_down(); 21 | 22 | int font_height; 23 | int menu_height = 5; 24 | 25 | std::vector> menu_items; 26 | }; -------------------------------------------------------------------------------- /menu/settings.cpp: -------------------------------------------------------------------------------- 1 | #include "settings.hpp" 2 | 3 | namespace settings 4 | { 5 | namespace esp 6 | { 7 | bool player = false; 8 | bool boxes = true; 9 | bool skeleton = true; 10 | int distance = 400; 11 | bool loot = true; 12 | int loot_mode = WEAPONS; 13 | bool vehicle = false; 14 | } 15 | 16 | namespace aimbot 17 | { 18 | int fov = 2; 19 | bool draw_fov = true; 20 | bool on_mouse4 = false; 21 | float smooth = 1.f; 22 | bool norecoil = true; 23 | bool nospread = true; 24 | bool fullauto = true; 25 | bool nosway = true; 26 | } 27 | 28 | float player_speed = 1.f; 29 | } 30 | -------------------------------------------------------------------------------- /menu/settings.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum LootMode : int 4 | { 5 | WEAPONS = 1 << 0, 6 | AMMO = 1 << 1, 7 | MEDIC = 1 << 2, 8 | EQUIPMENT = 1 << 3, 9 | ATTACHMENTS = 1 << 4, 10 | ALL = WEAPONS | AMMO | MEDIC | EQUIPMENT | ATTACHMENTS 11 | }; 12 | 13 | 14 | namespace settings 15 | { 16 | namespace esp 17 | { 18 | extern bool player; 19 | extern bool boxes; 20 | extern bool skeleton; 21 | extern int distance; 22 | extern bool loot; 23 | extern int loot_mode; 24 | extern bool vehicle; 25 | } 26 | 27 | namespace aimbot 28 | { 29 | extern int fov; 30 | extern bool draw_fov; 31 | extern bool on_mouse4; 32 | extern float smooth; 33 | extern bool norecoil; 34 | extern bool nospread; 35 | extern bool fullauto; 36 | extern bool nosway; 37 | } 38 | 39 | extern float player_speed; 40 | } 41 | --------------------------------------------------------------------------------