mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-12 22:43:07 +00:00
Localize cell names in the Lua API (feature 8725)
This commit is contained in:
parent
8b2be21eea
commit
d6cc205b86
2 changed files with 11 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "cellbindings.hpp"
|
||||
|
||||
#include <MyGUI_LanguageManager.h>
|
||||
|
||||
#include <components/esm3/loadacti.hpp>
|
||||
#include <components/esm3/loadalch.hpp>
|
||||
#include <components/esm3/loadappa.hpp>
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue