mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 11:41:33 +00:00
Merge branch 'lua_water_level' into 'master'
Lua: Add water level to Core.Cell See merge request OpenMW/openmw!3766
This commit is contained in:
commit
30d637f5f6
2 changed files with 8 additions and 0 deletions
|
@ -115,6 +115,13 @@ namespace MWLua
|
||||||
return cell == c.mStore || (cell->getCell()->getWorldSpace() == c.mStore->getCell()->getWorldSpace());
|
return cell == c.mStore || (cell->getCell()->getWorldSpace() == c.mStore->getCell()->getWorldSpace());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cellT["waterLevel"] = sol::readonly_property([](const CellT& c) -> sol::optional<float> {
|
||||||
|
if (c.mStore->getCell()->hasWater())
|
||||||
|
return c.mStore->getWaterLevel();
|
||||||
|
else
|
||||||
|
return sol::nullopt;
|
||||||
|
});
|
||||||
|
|
||||||
if constexpr (std::is_same_v<CellT, GCell>)
|
if constexpr (std::is_same_v<CellT, GCell>)
|
||||||
{ // only for global scripts
|
{ // only for global scripts
|
||||||
cellT["getAll"] = [ids = getPackageToTypeTable(context.mLua->sol())](
|
cellT["getAll"] = [ids = getPackageToTypeTable(context.mLua->sol())](
|
||||||
|
|
|
@ -297,6 +297,7 @@
|
||||||
-- @field #number gridY Index of the cell by Y (only for exteriors).
|
-- @field #number gridY Index of the cell by Y (only for exteriors).
|
||||||
-- @field #string worldSpaceId Id of the world space.
|
-- @field #string worldSpaceId Id of the world space.
|
||||||
-- @field #boolean hasWater True if the cell contains water.
|
-- @field #boolean hasWater True if the cell contains water.
|
||||||
|
-- @field #number waterLevel The water level of the cell. (nil if cell has no water).
|
||||||
-- @field #boolean hasSky True if in this cell sky should be rendered.
|
-- @field #boolean hasSky True if in this cell sky should be rendered.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in a new issue