aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2014-03-13 14:06:18 +0100
committerBlockMen <nmuelll@web.de>2014-03-13 14:06:18 +0100
commite4d1970abfd6206aa8780cb6cafd2efc46a2666f (patch)
treebb3931829b8ab59665493aeba7e1b5ea7d8d265b
parent03297acbf4efba9a19a7f31950cb6f2bc3c65ec8 (diff)
downloadminetest-e4d1970abfd6206aa8780cb6cafd2efc46a2666f.tar.gz
minetest-e4d1970abfd6206aa8780cb6cafd2efc46a2666f.tar.bz2
minetest-e4d1970abfd6206aa8780cb6cafd2efc46a2666f.zip
Fix game pause in singleplayer
-rw-r--r--src/game.cpp5
-rw-r--r--src/guiFormSpecMenu.cpp1
-rw-r--r--src/guiFormSpecMenu.h2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a3c162457..2b14b2c8e 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -988,6 +988,7 @@ static void show_chat_menu(FormspecFormSource* current_formspec,
new GUIFormSpecMenu(device, guiroot, -1,
&g_menumgr,
NULL, NULL, tsrc);
+ menu->doPause = false;
menu->setFormSource(current_formspec);
menu->setTextDest(current_textdest);
menu->drop();
@@ -1034,6 +1035,7 @@ static void show_pause_menu(FormspecFormSource* current_formspec,
current_textdest = new LocalFormspecHandler("MT_PAUSE_MENU");
GUIFormSpecMenu *menu =
new GUIFormSpecMenu(device, guiroot, -1, &g_menumgr, NULL, NULL, tsrc);
+ menu->doPause = true;
menu->setFormSource(current_formspec);
menu->setTextDest(current_textdest);
menu->drop();
@@ -1881,6 +1883,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
PlayerInventoryFormSource *src = new PlayerInventoryFormSource(&client);
assert(src);
+ menu->doPause = false;
menu->setFormSpec(src->getForm(), inventoryloc);
menu->setFormSource(src);
menu->setTextDest(new TextDestPlayerInventory(&client));
@@ -2399,6 +2402,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
new GUIFormSpecMenu(device, guiroot, -1,
&g_menumgr,
&client, gamedef, tsrc);
+ menu->doPause = false;
menu->setFormSource(current_formspec);
menu->setTextDest(current_textdest);
menu->drop();
@@ -2953,6 +2957,7 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
new GUIFormSpecMenu(device, guiroot, -1,
&g_menumgr,
&client, gamedef, tsrc);
+ menu->doPause = false;
menu->setFormSpec(meta->getString("formspec"),
inventoryloc);
menu->setFormSource(new NodeMetadataFormSource(
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 95a090c6f..4751978d7 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -2320,6 +2320,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
kp == getKeySetting("keymap_inventory")))
{
if (m_allowclose){
+ doPause = false;
acceptInput(quit_mode_cancel);
quitMenu();
} else {
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h
index 3fc1b5746..6f7de158b 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/guiFormSpecMenu.h
@@ -242,6 +242,8 @@ public:
void acceptInput(FormspecQuitMode quitmode);
bool preprocessEvent(const SEvent& event);
bool OnEvent(const SEvent& event);
+ bool doPause;
+ bool pausesGame() { return doPause; }
GUITable* getTable(std::wstring tablename);