aboutsummaryrefslogtreecommitdiff
path: root/src/guiPauseMenu.cpp
diff options
context:
space:
mode:
authorRealBadAngel <mk@realbadangel.pl>2013-02-23 16:01:35 +0100
committerRealBadAngel <mk@realbadangel.pl>2013-02-23 16:01:35 +0100
commit4d73d99ebc848e2065b38672e882f994a1d561f4 (patch)
tree01b1c002022ed1c5af7671206e84faece309d792 /src/guiPauseMenu.cpp
parentf9a8efb99235c86eb61b6deb2bc034d5618e45ea (diff)
downloadminetest-4d73d99ebc848e2065b38672e882f994a1d561f4.tar.gz
minetest-4d73d99ebc848e2065b38672e882f994a1d561f4.tar.bz2
minetest-4d73d99ebc848e2065b38672e882f994a1d561f4.zip
Add sound volume controls to ingame menu
Diffstat (limited to 'src/guiPauseMenu.cpp')
-rw-r--r--src/guiPauseMenu.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp
index f6cbf248f..9d44b2e82 100644
--- a/src/guiPauseMenu.cpp
+++ b/src/guiPauseMenu.cpp
@@ -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();