aboutsummaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2014-09-21 02:23:55 +0200
committerBlockMen <nmuelll@web.de>2014-09-21 19:15:48 +0200
commita020d1b653f94fbcaac06c15f9dbab4521fda355 (patch)
tree81668a035756bf88a0d3b60b31488761d4b78191 /src/guiFormSpecMenu.cpp
parent2b7a1ca57245409df5b79c9629facb90746898cc (diff)
downloadminetest-a020d1b653f94fbcaac06c15f9dbab4521fda355.tar.gz
minetest-a020d1b653f94fbcaac06c15f9dbab4521fda355.tar.bz2
minetest-a020d1b653f94fbcaac06c15f9dbab4521fda355.zip
Allow taking screenshots of formspecs and move message to chat
Diffstat (limited to 'src/guiFormSpecMenu.cpp')
-rw-r--r--src/guiFormSpecMenu.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index d6ca12b70..3fdb5bd26 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -49,6 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h"
#include "main.h"
#include "settings.h"
+#include "client.h"
#define MY_CHECKPOS(a,b) \
if (v_pos.size() != 2) { \
@@ -71,7 +72,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
InventoryManager *invmgr, IGameDef *gamedef,
ISimpleTextureSource *tsrc, IFormSource* fsrc, TextDest* tdst,
- GUIFormSpecMenu** ext_ptr) :
+ GUIFormSpecMenu** ext_ptr, Client* client) :
GUIModalMenu(dev->getGUIEnvironment(), parent, id, menumgr),
m_device(dev),
m_invmgr(invmgr),
@@ -88,7 +89,8 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
m_text_dst(tdst),
m_ext_ptr(ext_ptr),
m_font(dev->getGUIEnvironment()->getSkin()->getFont()),
- m_formspec_version(0)
+ m_formspec_version(0),
+ m_client(client)
#ifdef __ANDROID__
,m_JavaDialogFieldName(L"")
#endif
@@ -2912,6 +2914,9 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
m_text_dst->gotText(narrow_to_wide("MenuQuit"));
}
return true;
+ } else if (m_client != NULL && event.KeyInput.PressedDown &&
+ (kp == getKeySetting("keymap_screenshot"))) {
+ m_client->makeScreenshot(m_device);
}
if (event.KeyInput.PressedDown &&
(event.KeyInput.Key==KEY_RETURN ||