diff options
Diffstat (limited to 'src/guiPauseMenu.cpp')
-rw-r--r-- | src/guiPauseMenu.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index f6cbf248f..dc95eef5b 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -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 @@ -79,6 +79,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,7 +113,7 @@ 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(""); { @@ -131,6 +136,13 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) { core::rect<s32> rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); + Environment->addButton(rect, this, 262, + wgettext("Sound Volume")); + } + 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); Environment->addButton(rect, this, 260, wgettext("Exit to Menu")); } @@ -236,6 +248,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(); |