From 8f047530c49094545f580d250587c0b6cae5ba5a Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 8 Aug 2020 14:28:17 -0400 Subject: [PATCH] Make Units::getRaceNameById and other ID-related functions available to Lua --- docs/changelog.txt | 1 + library/LuaApi.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 00c7fafcb..f1c423da2 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -68,6 +68,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - Added a ``ref_target`` field to primitive field references, corresponding to the ``ref-target`` XML attribute +- Made ``dfhack.units.getRaceNameById()``, ``dfhack.units.getRaceBabyNameById()``, and ``dfhack.units.getRaceChildNameById()`` available to Lua ## Ruby - Updated ``item_find`` and ``building_find`` to use centralized logic that works on more screens diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 13c9386ff..78364083f 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -1617,8 +1617,11 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = { WRAPM(Units, getPhysicalDescription), WRAPM(Units, getRaceName), WRAPM(Units, getRaceNamePlural), + WRAPM(Units, getRaceNameById), WRAPM(Units, getRaceBabyName), + WRAPM(Units, getRaceBabyNameById), WRAPM(Units, getRaceChildName), + WRAPM(Units, getRaceChildNameById), WRAPM(Units, isBaby), WRAPM(Units, isChild), WRAPM(Units, isAdult),