1 /* 2 * This file is part of Dune Legacy. 3 * 4 * Dune Legacy is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * Dune Legacy is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with Dune Legacy. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef MENUBASE_H 19 #define MENUBASE_H 20 21 #include <GUI/Window.h> 22 #include <SDL.h> 23 24 #define MENU_QUIT_DEFAULT (-1) 25 26 class MenuBase: public Window 27 { 28 public: 29 30 MenuBase(); 31 virtual ~MenuBase(); 32 33 virtual int showMenu(); 34 virtual void quit(int returnVal = MENU_QUIT_DEFAULT); isQuiting()35 virtual bool isQuiting() { return quiting; }; disableQuiting(bool disable)36 void disableQuiting(bool disable) { bAllowQuiting = !disable; }; 37 update()38 virtual void update() { }; 39 40 virtual void drawSpecificStuff(); 41 42 virtual void draw(); 43 virtual bool doInput(SDL_Event &event); 44 setClearScreen(bool bClearScreen)45 void setClearScreen(bool bClearScreen) { 46 this->bClearScreen = bClearScreen; 47 }; 48 49 private: 50 bool bClearScreen; 51 bool bAllowQuiting; 52 bool quiting; 53 int retVal; 54 }; 55 56 #endif // MENUBASE_H 57