aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_client.cpp10
-rw-r--r--src/script/lua_api/l_client.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp
index 9961471ff..05bfcca52 100644
--- a/src/script/lua_api/l_client.cpp
+++ b/src/script/lua_api/l_client.cpp
@@ -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);
+
}
diff --git a/src/script/lua_api/l_client.h b/src/script/lua_api/l_client.h
index 5863e5717..04cc23041 100644
--- a/src/script/lua_api/l_client.h
+++ b/src/script/lua_api/l_client.h
@@ -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);
};