summaryrefslogtreecommitdiff
path: root/src/modalMenu.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-23 17:09:49 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-23 17:09:49 +0200
commit7e490e72139fbfe12535c71b27228dd82ef0250b (patch)
tree0ffc37e46140755192e04b88d82ae4daeb290b41 /src/modalMenu.h
parent2816d8f638de2f7f06ca1086d1c8846e8971f421 (diff)
downloadminetest-7e490e72139fbfe12535c71b27228dd82ef0250b.tar.gz
minetest-7e490e72139fbfe12535c71b27228dd82ef0250b.tar.bz2
minetest-7e490e72139fbfe12535c71b27228dd82ef0250b.zip
work-in-progress gui system updating + some settings system updating
Diffstat (limited to 'src/modalMenu.h')
-rw-r--r--src/modalMenu.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/modalMenu.h b/src/modalMenu.h
index 3706d86dc..e2e8b29f6 100644
--- a/src/modalMenu.h
+++ b/src/modalMenu.h
@@ -22,7 +22,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common_irrlicht.h"
-//TODO: Change GUIElement private
+/*
+ Remember to drop() the menu after creating, so that it can
+ remove itself when it wants to.
+*/
+
class GUIModalMenu : public gui::IGUIElement
{
public:
@@ -50,18 +54,6 @@ public:
return (e && (e == this || isMyChild(e))) || m_allow_focus_removal;
}
- void quitMenu()
- {
- m_allow_focus_removal = true;
- // This removes Environment's grab on us
- Environment->removeFocus(this);
- this->remove();
- }
-
- virtual void regenerateGui(v2u32 screensize) = 0;
-
- virtual void drawMenu() = 0;
-
void draw()
{
if(!IsVisible)
@@ -78,10 +70,25 @@ public:
drawMenu();
}
+ /*
+ This should be called when the menu wants to quit
+ */
+ void quitMenu()
+ {
+ m_allow_focus_removal = true;
+ // This removes Environment's grab on us
+ Environment->removeFocus(this);
+ this->remove();
+ }
+
+ virtual void regenerateGui(v2u32 screensize) = 0;
+ virtual void drawMenu() = 0;
virtual bool OnEvent(const SEvent& event) { return false; };
private:
int *m_active_menu_count;
+ // This might be necessary to expose to the implementation if it
+ // wants to launch other menus
bool m_allow_focus_removal;
v2u32 m_screensize_old;
};