From 45ae2ed67f9aba4d635a7565253bd9098a87bbde Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 7 Apr 2012 19:08:30 +0400 Subject: [PATCH] Pull a few utility functions into the core and publish to lua. --- LUA_API.rst | 10 ++++- Lua API.html | 8 +++- library/LuaApi.cpp | 3 ++ library/include/modules/Translation.h | 2 + library/include/modules/Units.h | 8 ++++ library/modules/Gui.cpp | 4 ++ library/modules/Translation.cpp | 15 +++++++ library/modules/Units.cpp | 59 ++++++++++++++++++++++++++ plugins/advtools.cpp | 33 +++------------ plugins/rename.cpp | 60 +++------------------------ 10 files changed, 117 insertions(+), 85 deletions(-) diff --git a/LUA_API.rst b/LUA_API.rst index 57a3fa16c..71cb6030f 100644 --- a/LUA_API.rst +++ b/LUA_API.rst @@ -644,9 +644,17 @@ Job module Units module ------------ +* ``dfhack.units.setNickname(unit,nick)`` + + Sets the unit's nickname properly. + * ``dfhack.units.getVisibleName(unit)`` - Returns the name visible in game, accounting for false identities. + Returns the language_name object visible in game, accounting for false identities. + +* ``dfhack.units.getNemesis(unit)`` + + Returns the nemesis record of the unit if it has one, or *nil*. * ``dfhack.units.isDead(unit)`` diff --git a/Lua API.html b/Lua API.html index 19f912b72..569940f56 100644 --- a/Lua API.html +++ b/Lua API.html @@ -883,8 +883,14 @@ The is_bright boolean actually seems to invert the brightness.

Units module