From a020d1b653f94fbcaac06c15f9dbab4521fda355 Mon Sep 17 00:00:00 2001 From: BlockMen Date: Sun, 21 Sep 2014 02:23:55 +0200 Subject: Allow taking screenshots of formspecs and move message to chat --- src/guiFormSpecMenu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/guiFormSpecMenu.cpp') 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 || -- cgit v1.2.3