]> git.lizzy.rs Git - minetest.git/blobdiff - src/mainmenumanager.h
Add formspec api versioning
[minetest.git] / src / mainmenumanager.h
index a3133686bb69e32735f6d336288785f45a0710cc..78ae1fcfa514623368bf63cb12204c63651ab662 100644 (file)
@@ -25,9 +25,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 #include "debug.h" // assert
 #include "modalMenu.h"
-#include "guiPauseMenu.h" //For IGameCallback
 #include <list>
 
+class IGameCallback
+{
+public:
+       virtual void exitToOS() = 0;
+       virtual void disconnect() = 0;
+       virtual void changePassword() = 0;
+       virtual void changeVolume() = 0;
+};
+
 extern gui::IGUIEnvironment* guienv;
 extern gui::IGUIStaticText *guiroot;
 
@@ -77,11 +85,31 @@ class MainMenuManager : public IMenuManager
                        m_stack.back()->setVisible(true);
        }
 
+       // Returns true to prevent further processing
+       virtual bool preprocessEvent(const SEvent& event)
+       {
+               if(m_stack.size() != 0)
+                       return m_stack.back()->preprocessEvent(event);
+               else
+                       return false;
+       }
+
        u32 menuCount()
        {
                return m_stack.size();
        }
 
+       bool pausesGame()
+       {
+               for(std::list<GUIModalMenu*>::iterator
+                               i = m_stack.begin(); i != m_stack.end(); ++i)
+               {
+                       if((*i)->pausesGame())
+                               return true;
+               }
+               return false;
+       }
+
        std::list<GUIModalMenu*> m_stack;
 };