]> git.lizzy.rs Git - minetest.git/blobdiff - src/guiPauseMenu.cpp
Don't use msvc libs for mingw build
[minetest.git] / src / guiPauseMenu.cpp
index f6cbf248fc2240bb121f9a545dee51c857826fa1..d7a51488ec54b1242c078bcc03dae7bde62aafea 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "serialization.h"
 #include "porting.h"
 #include "config.h"
+#include "version.h"
 #include "main.h"
 #include <IGUICheckBox.h>
 #include <IGUIEditBox.h>
@@ -79,6 +80,11 @@ void GUIPauseMenu::removeChildren()
                if(e != NULL)
                        e->remove();
        }
+       {
+               gui::IGUIElement *e = getElementFromId(262);
+               if(e != NULL)
+                       e->remove();
+       }
 }
 
 void GUIPauseMenu::regenerateGui(v2u32 screensize)
@@ -108,14 +114,15 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
        */
        const s32 btn_height = 30;
        const s32 btn_gap = 20;
-       const s32 btn_num = m_simple_singleplayer_mode ? 3 : 4;
+       const s32 btn_num = m_simple_singleplayer_mode ? 4 : 5;
        s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2;
-       changeCtype("");
        {
                core::rect<s32> rect(0, 0, 140, btn_height);
                rect = rect + v2s32(size.X/2-140/2, btn_y);
+               wchar_t* text = wgettext("Continue");
                Environment->addButton(rect, this, 256,
-                       wgettext("Continue"));
+                       text);
+               delete[] text;
        }
        btn_y += btn_height + btn_gap;
        if(!m_simple_singleplayer_mode)
@@ -123,41 +130,58 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
                {
                        core::rect<s32> rect(0, 0, 140, btn_height);
                        rect = rect + v2s32(size.X/2-140/2, btn_y);
+                       wchar_t* text = wgettext("Change Password");
                        Environment->addButton(rect, this, 261,
-                               wgettext("Change Password"));
+                               text);
+                       delete[] text;
                }
                btn_y += btn_height + btn_gap;
        }
        {
                core::rect<s32> rect(0, 0, 140, btn_height);
                rect = rect + v2s32(size.X/2-140/2, btn_y);
+               wchar_t* text = wgettext("Sound Volume");
+               Environment->addButton(rect, this, 262,
+                       text);
+               delete[] text;
+       }
+       btn_y += btn_height + btn_gap;
+       {
+               core::rect<s32> rect(0, 0, 140, btn_height);
+               rect = rect + v2s32(size.X/2-140/2, btn_y);
+               wchar_t* text = wgettext("Exit to Menu");
                Environment->addButton(rect, this, 260,
-                       wgettext("Exit to Menu"));
+                       text);
+               delete[] text;
        }
        btn_y += btn_height + btn_gap;
        {
                core::rect<s32> rect(0, 0, 140, btn_height);
                rect = rect + v2s32(size.X/2-140/2, btn_y);
+               wchar_t* text = wgettext("Exit to OS");
                Environment->addButton(rect, this, 257,
-                       wgettext("Exit to OS"));
+                       text);
+               delete[] text;
        }
 
        {
                core::rect<s32> rect(0, 0, 180, 240);
                rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2);
-               Environment->addStaticText(chartowchar_t(gettext(
-               "Default Controls:\n"
-               "- WASD: Walk\n"
-               "- Mouse left: dig/hit\n"
-               "- Mouse right: place/use\n"
-               "- Mouse wheel: select item\n"
-               "- 0...9: select item\n"
-               "- Shift: sneak\n"
-               "- R: Toggle viewing all loaded chunks\n"
-               "- I: Inventory menu\n"
-               "- ESC: This menu\n"
-               "- T: Chat\n"
-               )), rect, false, true, this, 258);
+               wchar_t* text = wgettext("Default Controls:\n"
+                               "- WASD: move\n"
+                               "- Space: jump/climb\n"
+                               "- Shift: sneak/go down\n"
+                               "- Q: drop item\n"
+                               "- I: inventory\n"
+                               "- Mouse: turn/look\n"
+                               "- Mouse left: dig/punch\n"
+                               "- Mouse right: place/use\n"
+                               "- Mouse wheel: select item\n"
+                               "- T: chat\n"
+                               );
+               Environment->addStaticText(text, rect, false, true, this, 258);
+               delete[] text;
+
        }
        {
                core::rect<s32> rect(0, 0, 180, 220);
@@ -171,12 +195,11 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
 
                std::ostringstream os;
                os<<"Minetest\n";
-               os<<BUILD_INFO<<"\n";
+               os<<minetest_build_info<<"\n";
                os<<"path_user = "<<wrap_rows(porting::path_user, 20)<<"\n";
        
                Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259);
        }
-       changeCtype("C");
 }
 
 void GUIPauseMenu::drawMenu()
@@ -236,6 +259,10 @@ bool GUIPauseMenu::OnEvent(const SEvent& event)
                                quitMenu();
                                m_gamecallback->changePassword();
                                return true;
+                       case 262:
+                               quitMenu();
+                               m_gamecallback->changeVolume();
+                               return true;
                        case 260: // disconnect
                                m_gamecallback->disconnect();
                                quitMenu();