diff --git a/CMakeLists.txt b/CMakeLists.txt index fa621617f0..a8241350ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MINOR 51) set(OPENMW_VERSION_RELEASE 0) -set(OPENMW_LUA_API_REVISION 97) +set(OPENMW_LUA_API_REVISION 98) set(OPENMW_POSTPROCESSING_API_REVISION 3) set(OPENMW_VERSION_COMMITHASH "") diff --git a/apps/openmw/mwlua/cellbindings.cpp b/apps/openmw/mwlua/cellbindings.cpp index 4e4542d89f..2f279e0c1a 100644 --- a/apps/openmw/mwlua/cellbindings.cpp +++ b/apps/openmw/mwlua/cellbindings.cpp @@ -40,7 +40,10 @@ #include #include +#include + #include "../mwbase/environment.hpp" +#include "../mwbase/windowmanager.hpp" #include "../mwbase/world.hpp" #include "../mwworld/cellstore.hpp" #include "../mwworld/worldmodel.hpp" @@ -85,6 +88,10 @@ 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_view { + const auto& storage = MWBase::Environment::get().getWindowManager()->getTranslationDataStorage(); + return storage.translateCellName(c.mStore->getCell()->getNameId()); + }); 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.