#include "ConsoleMenu.h" #include #include #include #include #include using namespace std; //color theme static WORD titleTextTheme = BACKGROUND_BLUE|BACKGROUND_GREEN; //Cyan background with Black text static WORD highLightedTextTheme = BACKGROUND_RED|BACKGROUND_GREEN; //Yellow background with Black text static WORD normalTextTheme = FOREGROUND_INTENSITY; //Black background with White text //console handle static HANDLE handle; string menuBase::cutline = "====================================="; menuManager* menuManager::instance = nullptr; menuManager::menuManager(){ handle = GetStdHandle(STD_OUTPUT_HANDLE); //Get console handle... menus.clear(); } void menuManager::SetDefaultUI(string menuID){ for(unsigned i=0;imenuID){ defaultMenu = menuID; return; } } //Case not found... std::cout<<"invaild menuID: "<DrawMenu(); } } void menuManager::UIRegistion(menuBase* pmenu){ pmenu->numOfStatus = pmenu->options.size(); pmenu->highLightedIndex = 0; menus.push_back(pmenu); } void menuManager::UITransform(string menuID){ for(unsigned i=0;imenuID){ activeMenu = menus[i]; menus[i]->DrawMenu(); return; } } //Case not Found... cout<<"invaild menuID: "<DrawMenu(); } } void menuBase::DrawMenu(){ system("cls"); //Draw title text... SetConsoleTextAttribute(handle, titleTextTheme); cout<