]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/guiTextInputMenu.cpp
Faster lighting at map generation time
[dragonfireclient.git] / src / guiTextInputMenu.cpp
index 0668aa7b33ac1916d993adf2eafff76f9e9aae6d..38985cfa04e916a697df37dd0336e60d3c871085 100644 (file)
@@ -24,11 +24,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 GUITextInputMenu::GUITextInputMenu(gui::IGUIEnvironment* env,
                gui::IGUIElement* parent, s32 id,
-               int *active_menu_count,
+               IMenuManager *menumgr,
                TextDest *dest,
                std::wstring initial_text
 ):
-       GUIModalMenu(env, parent, id, active_menu_count),
+       GUIModalMenu(env, parent, id, menumgr),
        m_dest(dest),
        m_initial_text(initial_text)
 {
@@ -37,6 +37,8 @@ GUITextInputMenu::GUITextInputMenu(gui::IGUIEnvironment* env,
 GUITextInputMenu::~GUITextInputMenu()
 {
        removeChildren();
+       if(m_dest)
+               delete m_dest;
 }
 
 void GUITextInputMenu::removeChildren()
@@ -173,6 +175,16 @@ bool GUITextInputMenu::OnEvent(const SEvent& event)
                                break;
                        }
                }
+               if(event.GUIEvent.EventType==gui::EGET_EDITBOX_ENTER)
+               {
+                       switch(event.GUIEvent.Caller->getID())
+                       {
+                       case 256:
+                               acceptInput();
+                               quitMenu();
+                               break;
+                       }
+               }
        }
 
        return Parent ? Parent->OnEvent(event) : false;