diff options
author | RealBadAngel <mk@realbadangel.pl> | 2013-02-23 16:01:35 +0100 |
---|---|---|
committer | RealBadAngel <mk@realbadangel.pl> | 2013-02-23 16:01:35 +0100 |
commit | 4d73d99ebc848e2065b38672e882f994a1d561f4 (patch) | |
tree | 01b1c002022ed1c5af7671206e84faece309d792 /src/guiPauseMenu.cpp | |
parent | f9a8efb99235c86eb61b6deb2bc034d5618e45ea (diff) | |
download | minetest-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.cpp | 18 |
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(); |