X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2FguiPauseMenu.cpp;h=e542a28e90ce63e1baed8637a483933715718b73;hb=13159c1a48690d4ede3dbabc7699ea3d49072860;hp=61485518c0d3dcdadbb94be03c854c53b6bdbe4d;hpb=7985d746f97ce1b37b6ca48a8a3e7ed70d02e4b0;p=dragonfireclient.git diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 61485518c..e542a28e9 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -23,16 +23,23 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "porting.h" #include "config.h" #include "main.h" +#include +#include +#include +#include +#include #include "gettext.h" GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, IGameCallback *gamecallback, - IMenuManager *menumgr): - GUIModalMenu(env, parent, id, menumgr) + IMenuManager *menumgr, + bool simple_singleplayer_mode): + GUIModalMenu(env, parent, id, menumgr), + m_gamecallback(gamecallback), + m_simple_singleplayer_mode(simple_singleplayer_mode) { - m_gamecallback = gamecallback; } GUIPauseMenu::~GUIPauseMenu() @@ -101,44 +108,48 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) */ const s32 btn_height = 30; const s32 btn_gap = 20; - const s32 btn_num = 4; + const s32 btn_num = m_simple_singleplayer_mode ? 3 : 4; s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2; + changeCtype(""); { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 256, - chartowchar_t(gettext("Continue"))); + wgettext("Continue")); } btn_y += btn_height + btn_gap; + if(!m_simple_singleplayer_mode) { - core::rect rect(0, 0, 140, btn_height); - rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 261, - chartowchar_t(gettext("Change Password"))); + { + core::rect rect(0, 0, 140, btn_height); + rect = rect + v2s32(size.X/2-140/2, btn_y); + Environment->addButton(rect, this, 261, + wgettext("Change Password")); + } + btn_y += btn_height + btn_gap; } - btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 260, - chartowchar_t(gettext("Disconnect"))); + wgettext("Exit to Menu")); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 257, - chartowchar_t(gettext("Exit to OS"))); + wgettext("Exit to OS")); } { core::rect rect(0, 0, 180, 240); rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2); Environment->addStaticText(chartowchar_t(gettext( - "Keys:\n" + "Default Controls:\n" "- WASD: Walk\n" - "- Mouse left: dig blocks\n" - "- Mouse right: place blocks\n" + "- Mouse left: dig/hit\n" + "- Mouse right: place/use\n" "- Mouse wheel: select item\n" "- 0...9: select item\n" "- Shift: sneak\n" @@ -168,18 +179,19 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) SWPRINTF_CHARSTRING , BUILD_INFO, - porting::path_userdata.c_str() + porting::path_user.c_str() );*/ std::ostringstream os; - os<<"Minetest-delta\n"; + os<<"Minetest\n"; os<<"by Perttu Ahola and contributors\n"; os<<"celeron55@gmail.com\n"; os<addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259); } + changeCtype("C"); } void GUIPauseMenu::drawMenu()