diff options
author | Nipun Garg | 2019-06-30 04:37:42 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:06 +0200 |
commit | 6b5fd8a95ff3713a0e199f2757ddde8d1ad8a9c8 (patch) | |
tree | 16c12cdf329ffa9d0aa8e96d3b8b19ba986d649a | |
parent | 428af6c972725a980f0a9fe4a15bb724ed46af18 (diff) | |
download | scummvm-rg350-6b5fd8a95ff3713a0e199f2757ddde8d1ad8a9c8.tar.gz scummvm-rg350-6b5fd8a95ff3713a0e199f2757ddde8d1ad8a9c8.tar.bz2 scummvm-rg350-6b5fd8a95ff3713a0e199f2757ddde8d1ad8a9c8.zip |
HDB: Add lua functions for dialog and getEntityXY
-rw-r--r-- | engines/hdb/lua-script.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index aeb629b69c..2a3b032ec6 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -443,8 +443,18 @@ static int deliveriesLeft(lua_State *L) { } static int getEntityXY(lua_State *L) { - warning("STUB: GET ENTITYXY"); - return 0; + int x, y; + const char *initName = lua_tostring(L, 1); + + g_hdb->_lua->checkParameters("getEntityXY", 1); + + lua_pop(L, 1); + + g_hdb->_ai->getEntityXY(initName, &x, &y); + + lua_pushnumber(L, x); + lua_pushnumber(L, y); + return 2; } static int setEntity(lua_State *L) { @@ -546,7 +556,22 @@ static int setBackground(lua_State *L) { } static int dialog(lua_State *L) { - warning("STUB: DIALOG"); + const char *title, *string, *more; + double tileIndex; + + title = lua_tostring(L, 1); + tileIndex = lua_tonumber(L, 2); + string = lua_tostring(L, 3); + more = lua_tostring(L, 4); + + if (!more || more[0] == '0') + more = NULL; + + g_hdb->_lua->checkParameters("dialog", 4); + + lua_pop(L, 4); + if (string) + g_hdb->_window->openDialog(title, (int)tileIndex, string, (int)more, more); return 0; } |