1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Allow taking screenshots of formspecs and move message to chat

This commit is contained in:
BlockMen 2014-09-21 02:23:55 +02:00
parent 2b7a1ca572
commit a020d1b653
6 changed files with 53 additions and 40 deletions

View file

@ -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 ||