From 6e1f6ad0d426b46ea23d975ea9d2e956db180c68 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 9 Sep 2017 13:40:47 +1000 Subject: [PATCH] Add pause to lua ansi display --- lua_glue.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lua_glue.c b/lua_glue.c index 51f9f3a..1b40996 100644 --- a/lua_glue.c +++ b/lua_glue.c @@ -41,6 +41,17 @@ int l_bbsRChar(lua_State *L) { return 1; } +int l_bbsDisplayAnsiPause(lua_State *L) { + char *str = (char *)lua_tostring(L, -1); + char buffer[256]; + + sprintf(buffer, "%s/%s.ans", conf.ansi_path, str); + + s_displayansi_pause(buffer, 1); + + return 0; +} + int l_bbsDisplayAnsi(lua_State *L) { char *str = (char *)lua_tostring(L, -1); @@ -153,6 +164,8 @@ void lua_push_cfunctions(lua_State *L) { lua_setglobal(L, "bbs_write_string"); lua_pushcfunction(L, l_bbsRString); lua_setglobal(L, "bbs_read_string"); + lua_pushcfunction(L, l_bbsDisplayAnsiPause); + lua_setglobal(L, "bbs_display_ansi_pause"); lua_pushcfunction(L, l_bbsDisplayAnsi); lua_setglobal(L, "bbs_display_ansi"); lua_pushcfunction(L, l_bbsRChar); @@ -200,4 +213,4 @@ void do_lua_script(char *script) { lua_push_cfunctions(L); luaL_dofile(L, buffer); lua_close(L); -} \ No newline at end of file +}