diff --git a/apps/openmw/mwlua/cellbindings.cpp b/apps/openmw/mwlua/cellbindings.cpp index 4e4542d89f..e32617ec0c 100644 --- a/apps/openmw/mwlua/cellbindings.cpp +++ b/apps/openmw/mwlua/cellbindings.cpp @@ -1,5 +1,7 @@ #include "cellbindings.hpp" +#include + #include #include #include @@ -85,6 +87,14 @@ namespace MWLua }; cellT["name"] = sol::readonly_property([](const CellT& c) { return c.mStore->getCell()->getNameId(); }); + cellT["displayName"] = sol::readonly_property([](const CellT& c) { + std::string str(c.mStore->getCell()->getNameId()); + if (!str.empty()) + { + str = MyGUI::LanguageManager::getInstance().replaceTags(MyGUI::UString("#{sCell=" + str + "}")); + } + return str; + }); cellT["id"] = sol::readonly_property([](const CellT& c) { return c.mStore->getCell()->getId().serializeText(); }); cellT["region"] = sol::readonly_property( diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index d392fc8451..7909c1ce21 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -297,6 +297,7 @@ -- A cell of the game world. -- @type Cell -- @field #string name Name of the cell (can be empty string). +-- @field #string displayName Human-readable cell name (takes into account *.cel file localizations). Can be empty string. -- @field #string id Unique record ID of the cell, based on cell name for interiors and the worldspace for exteriors, or the formID of the cell for ESM4 cells. -- @field #string region Region of the cell. -- @field #boolean isExterior Whether the cell is an exterior cell. "Exterior" means grid of cells where the player can seamless walk from one cell to another without teleports. QuasiExterior (interior with sky) is not an exterior.