client::makeScreenshot: add ability to screenshot without chatspam
This commit is contained in:
parent
c13deff8de
commit
60b3eeae8b
@ -1822,7 +1822,7 @@ float Client::getCurRate()
|
||||
m_con->getLocalStat(con::CUR_DL_RATE));
|
||||
}
|
||||
|
||||
void Client::makeScreenshot()
|
||||
void Client::makeScreenshot(bool hide_msg)
|
||||
{
|
||||
irr::video::IVideoDriver *driver = RenderingEngine::get_video_driver();
|
||||
irr::video::IImage* const raw_image = driver->createScreenShot();
|
||||
@ -1883,7 +1883,7 @@ void Client::makeScreenshot()
|
||||
} else {
|
||||
sstr << "Failed to save screenshot '" << filename << "'";
|
||||
}
|
||||
pushToChatQueue(new ChatMessage(CHATMESSAGE_TYPE_SYSTEM,
|
||||
if(!hide_msg) pushToChatQueue(new ChatMessage(CHATMESSAGE_TYPE_SYSTEM,
|
||||
narrow_to_wide(sstr.str())));
|
||||
infostream << sstr.str() << std::endl;
|
||||
image->drop();
|
||||
|
@ -386,7 +386,7 @@ public:
|
||||
|
||||
LocalClientState getState() { return m_state; }
|
||||
|
||||
void makeScreenshot();
|
||||
void makeScreenshot(bool hide_msg=false);
|
||||
|
||||
inline void pushToChatQueue(ChatMessage *cec)
|
||||
{
|
||||
|
@ -512,7 +512,7 @@ int ModApiClient::l_drop_selected_item(lua_State *L)
|
||||
//take_screenshot()
|
||||
int ModApiClient::l_take_screenshot(lua_State *L)
|
||||
{
|
||||
getClient(L)->makeScreenshot();
|
||||
getClient(L)->makeScreenshot(true);
|
||||
lua_pushboolean(L, true);
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user