Implement map parameters for Lua paintString() and fillRect(), update docs

develop
lethosor 2017-06-01 16:17:59 -04:00
parent 2681392e27
commit d41ff4e836
2 changed files with 7 additions and 5 deletions

@ -1640,19 +1640,19 @@ Basic painting functions:
Returns *false* if coordinates out of bounds, or other error. Returns *false* if coordinates out of bounds, or other error.
* ``dfhack.screen.readTile(x,y)`` * ``dfhack.screen.readTile(x,y[,map])``
Retrieves the contents of the specified tile from the screen buffers. Retrieves the contents of the specified tile from the screen buffers.
Returns a pen object, or *nil* if invalid or TrueType. Returns a pen object, or *nil* if invalid or TrueType.
* ``dfhack.screen.paintString(pen,x,y,text)`` * ``dfhack.screen.paintString(pen,x,y,text[,map])``
Paints the string starting at *x,y*. Uses the string characters Paints the string starting at *x,y*. Uses the string characters
in sequence to override the ``ch`` field of pen. in sequence to override the ``ch`` field of pen.
Returns *true* if painting at least one character succeeded. Returns *true* if painting at least one character succeeded.
* ``dfhack.screen.fillRect(pen,x1,y1,x2,y2)`` * ``dfhack.screen.fillRect(pen,x1,y1,x2,y2[,map])``
Fills the rectangle specified by the coordinates with the given pen. Fills the rectangle specified by the coordinates with the given pen.
Returns *true* if painting at least one character succeeded. Returns *true* if painting at least one character succeeded.

@ -2087,7 +2087,8 @@ static int screen_paintString(lua_State *L)
int x = luaL_checkint(L, 2); int x = luaL_checkint(L, 2);
int y = luaL_checkint(L, 3); int y = luaL_checkint(L, 3);
const char *text = luaL_checkstring(L, 4); const char *text = luaL_checkstring(L, 4);
lua_pushboolean(L, Screen::paintString(pen, x, y, text)); bool map = lua_toboolean(L, 5);
lua_pushboolean(L, Screen::paintString(pen, x, y, text, map));
return 1; return 1;
} }
@ -2099,7 +2100,8 @@ static int screen_fillRect(lua_State *L)
int y1 = luaL_checkint(L, 3); int y1 = luaL_checkint(L, 3);
int x2 = luaL_checkint(L, 4); int x2 = luaL_checkint(L, 4);
int y2 = luaL_checkint(L, 5); int y2 = luaL_checkint(L, 5);
lua_pushboolean(L, Screen::fillRect(pen, x1, y1, x2, y2)); bool map = lua_toboolean(L, 6);
lua_pushboolean(L, Screen::fillRect(pen, x1, y1, x2, y2, map));
return 1; return 1;
} }