lua api: add core.take_screenshot()

This commit is contained in:
cora 2020-10-27 15:20:32 +01:00
parent f1ff05bf59
commit 4f9797b6e8
2 changed files with 13 additions and 0 deletions

View File

@ -524,6 +524,14 @@ int ModApiClient::l_get_objects_inside_radius(lua_State *L)
return 1;
}
//take_screenshot()
int ModApiClient::l_take_screenshot(lua_State *L)
{
getClient(L)->makeScreenshot();
lua_pushboolean(L, true);
return 1;
}
void ModApiClient::Initialize(lua_State *L, int top)
{
API_FCT(get_current_modname);
@ -558,4 +566,6 @@ void ModApiClient::Initialize(lua_State *L, int top)
API_FCT(set_keypress);
API_FCT(drop_selected_item);
API_FCT(get_objects_inside_radius);
API_FCT(take_screenshot);
}

View File

@ -126,6 +126,9 @@ private:
// get_objects_inside_radius(pos, radius)
static int l_get_objects_inside_radius(lua_State *L);
//take_screenshot()
static int l_take_screenshot(lua_State *L);
public:
static void Initialize(lua_State *L, int top);
};