mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Merge branch 'container_inventory' into 'master'
[Lua] Add alias `types.Container.inventory` = `types.Container.content` for consistency with `types.Actor.inventory` See merge request OpenMW/openmw!3314
This commit is contained in:
commit
65a15ff0b1
@ -28,15 +28,9 @@ namespace MWLua
|
||||
|
||||
void addContainerBindings(sol::table container, const Context& context)
|
||||
{
|
||||
container["content"] = sol::overload(
|
||||
[](const LObject& o) {
|
||||
containerPtr(o);
|
||||
return Inventory<LObject>{ o };
|
||||
},
|
||||
[](const GObject& o) {
|
||||
containerPtr(o);
|
||||
return Inventory<GObject>{ o };
|
||||
});
|
||||
container["content"] = sol::overload([](const LObject& o) { return Inventory<LObject>{ o }; },
|
||||
[](const GObject& o) { return Inventory<GObject>{ o }; });
|
||||
container["inventory"] = container["content"];
|
||||
container["encumbrance"] = [](const Object& obj) -> float {
|
||||
const MWWorld::Ptr& ptr = containerPtr(obj);
|
||||
return ptr.getClass().getEncumbrance(ptr);
|
||||
|
@ -1446,7 +1446,9 @@
|
||||
-- @param #ActivatorRecord activator A Lua table with the fields of a ActivatorRecord.
|
||||
-- @return #ActivatorRecord A strongly typed Activator record.
|
||||
|
||||
--- @{#Container} functions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @{#Container} functions
|
||||
-- @field [parent=#types] #Container Container
|
||||
|
||||
---
|
||||
@ -1461,6 +1463,12 @@
|
||||
-- @param openmw.core#GameObject object
|
||||
-- @return openmw.core#Inventory
|
||||
|
||||
---
|
||||
-- Container content (same as `Container.content`, added for consistency with `Actor.inventory`).
|
||||
-- @function [parent=#Container] inventory
|
||||
-- @param openmw.core#GameObject object
|
||||
-- @return openmw.core#Inventory
|
||||
|
||||
---
|
||||
-- Whether the object is a Container.
|
||||
-- @function [parent=#Container] objectIsInstance
|
||||
@ -1493,7 +1501,9 @@
|
||||
-- @field #string mwscript MWScript on this container (can be empty)
|
||||
-- @field #number weight capacity of this container
|
||||
|
||||
--- @{#Door} functions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @{#Door} functions
|
||||
-- @field [parent=#types] #Door Door
|
||||
|
||||
---
|
||||
|
Loading…
x
Reference in New Issue
Block a user