]> git.lizzy.rs Git - minetest.git/blobdiff - src/guiPauseMenu.cpp
Allow the LUA API to set animations to meshes as well as the animation speed. Also...
[minetest.git] / src / guiPauseMenu.cpp
index 6cf364e5f6d8b3ee4ede2c9ee4ed3368f38d569f..96fd7d67676b3b10fd517f9f9928119384d53db5 100644 (file)
@@ -3,16 +3,16 @@ Minetest-c55
 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>\r
 \r
 This program is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
+it under the terms of the GNU Lesser General Public License as published by\r
+the Free Software Foundation; either version 2.1 of the License, or\r
 (at your option) any later version.\r
 \r
 This program is distributed in the hope that it will be useful,\r
 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
+GNU Lesser General Public License for more details.\r
 \r
-You should have received a copy of the GNU General Public License along\r
+You should have received a copy of the GNU Lesser General Public License along\r
 with this program; if not, write to the Free Software Foundation, Inc.,\r
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
 */\r
@@ -23,16 +23,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "porting.h"\r
 #include "config.h"\r
 #include "main.h"\r
-\r
+#include <IGUICheckBox.h>\r
+#include <IGUIEditBox.h>\r
+#include <IGUIButton.h>\r
+#include <IGUIStaticText.h>\r
+#include <IGUIFont.h>\r
 #include "gettext.h"\r
+#include "util/string.h"\r
 \r
 GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,\r
                gui::IGUIElement* parent, s32 id,\r
                IGameCallback *gamecallback,\r
-               IMenuManager *menumgr):\r
-       GUIModalMenu(env, parent, id, menumgr)\r
+               IMenuManager *menumgr,\r
+               bool simple_singleplayer_mode):\r
+       GUIModalMenu(env, parent, id, menumgr),\r
+       m_gamecallback(gamecallback),\r
+       m_simple_singleplayer_mode(simple_singleplayer_mode)\r
 {\r
-       m_gamecallback = gamecallback;\r
 }\r
 \r
 GUIPauseMenu::~GUIPauseMenu()\r
@@ -101,35 +108,38 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
        */\r
        const s32 btn_height = 30;\r
        const s32 btn_gap = 20;\r
-       const s32 btn_num = 4;\r
+       const s32 btn_num = m_simple_singleplayer_mode ? 3 : 4;\r
        s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2;\r
        changeCtype("");\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
                Environment->addButton(rect, this, 256,\r
-                       chartowchar_t(gettext("Continue")));\r
+                       wgettext("Continue"));\r
        }\r
        btn_y += btn_height + btn_gap;\r
+       if(!m_simple_singleplayer_mode)\r
        {\r
-               core::rect<s32> rect(0, 0, 140, btn_height);\r
-               rect = rect + v2s32(size.X/2-140/2, btn_y);\r
-               Environment->addButton(rect, this, 261,\r
-                       chartowchar_t(gettext("Change Password")));\r
+               {\r
+                       core::rect<s32> rect(0, 0, 140, btn_height);\r
+                       rect = rect + v2s32(size.X/2-140/2, btn_y);\r
+                       Environment->addButton(rect, this, 261,\r
+                               wgettext("Change Password"));\r
+               }\r
+               btn_y += btn_height + btn_gap;\r
        }\r
-       btn_y += btn_height + btn_gap;\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
                Environment->addButton(rect, this, 260,\r
-                       chartowchar_t(gettext("Disconnect")));\r
+                       wgettext("Exit to Menu"));\r
        }\r
        btn_y += btn_height + btn_gap;\r
        {\r
                core::rect<s32> rect(0, 0, 140, btn_height);\r
                rect = rect + v2s32(size.X/2-140/2, btn_y);\r
                Environment->addButton(rect, this, 257,\r
-                       chartowchar_t(gettext("Exit to OS")));\r
+                       wgettext("Exit to OS"));\r
        }\r
 \r
        {\r
@@ -169,15 +179,15 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
                                SWPRINTF_CHARSTRING\r
                                ,\r
                                BUILD_INFO,\r
-                               porting::path_userdata.c_str()\r
+                               porting::path_user.c_str()\r
                );*/\r
 \r
                std::ostringstream os;\r
-               os<<"Minetest-delta\n";\r
+               os<<"Minetest\n";\r
                os<<"by Perttu Ahola and contributors\n";\r
                os<<"celeron55@gmail.com\n";\r
                os<<BUILD_INFO<<"\n";\r
-               os<<"ud_path = "<<wrap_rows(porting::path_userdata, 20)<<"\n";\r
+               os<<"path_user = "<<wrap_rows(porting::path_user, 20)<<"\n";\r
        \r
                Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259);\r
        }\r