diff options
author | Nipun Garg | 2019-07-02 03:38:54 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:07 +0200 |
commit | 8d7446406516f29ee7ebfcf463bdbfeaf65b2958 (patch) | |
tree | 2ca04e89990e82f40174f939b8e0d4530db2eec4 /engines | |
parent | 0aacd2d29adfe63f70399592e7f44f3654b53577 (diff) | |
download | scummvm-rg350-8d7446406516f29ee7ebfcf463bdbfeaf65b2958.tar.gz scummvm-rg350-8d7446406516f29ee7ebfcf463bdbfeaf65b2958.tar.bz2 scummvm-rg350-8d7446406516f29ee7ebfcf463bdbfeaf65b2958.zip |
HDB: Add Lua functions for message() and dialog()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/lua-script.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 72214b0233..94fcf9e1ba 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -656,12 +656,37 @@ static int dialog(lua_State *L) { } static int dialogChoice(lua_State *L) { - warning("STUB: DIALOG CHOICE"); + const char *title = lua_tostring(L, 1); + const char *text = lua_tostring(L, 2); + const char *func = lua_tostring(L, 3); + const char *choice[10] = {0,0,0,0,0,0,0,0,0,0}; + + int i, amount = lua_gettop(L) - 3; + if (amount > 9) + amount = 9; + + for (i = 0; i < amount; i++) + choice[i] = lua_tostring(L, 4 + i); + + lua_pop(L, amount + 3); + + g_hdb->_window->openDialogChoice(title, text, func, amount, &choice[0]); return 0; } static int message(lua_State *L) { - warning("STUB: MESSAGE"); + const char *title; + double delay; + + title = lua_tostring(L, 1); + delay = lua_tonumber(L, 2); + + + g_hdb->_lua->checkParameters("message", 2); + + lua_pop(L, 2); + + g_hdb->_window->openMessageBar(title, (int)delay); return 0; } |