mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-10 12:59:58 -04:00
Finish docs(for now), remove C++ changes
This commit is contained in:
parent
5827f1c250
commit
c73e95063d
@ -12,10 +12,6 @@ namespace MWLua
|
|||||||
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
|
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
|
||||||
item["setEnchantmentCharge"]
|
item["setEnchantmentCharge"]
|
||||||
= [](const GObject& object, float charge) { object.ptr().getCellRef().setEnchantmentCharge(charge); };
|
= [](const GObject& object, float charge) { object.ptr().getCellRef().setEnchantmentCharge(charge); };
|
||||||
item["getPickUpSound"]
|
|
||||||
= [](const Object& object) { return object.ptr().getClass().getUpSoundId(object.ptr()).serializeText(); };
|
|
||||||
item["getDropSound"]
|
|
||||||
= [](const Object& object) { return object.ptr().getClass().getDownSoundId(object.ptr()).serializeText(); };
|
|
||||||
item["isRestocking"]
|
item["isRestocking"]
|
||||||
= [](const Object& object) -> bool { return object.ptr().getRefData().getCount(false) < 0; };
|
= [](const Object& object) -> bool { return object.ptr().getRefData().getCount(false) < 0; };
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ Lua API reference
|
|||||||
openmw_aux_util
|
openmw_aux_util
|
||||||
openmw_aux_time
|
openmw_aux_time
|
||||||
openmw_aux_ui
|
openmw_aux_ui
|
||||||
|
openmw_aux_core
|
||||||
interface_activation
|
interface_activation
|
||||||
interface_ai
|
interface_ai
|
||||||
interface_camera
|
interface_camera
|
||||||
|
5
docs/source/reference/lua-scripting/openmw_aux_core.rst
Normal file
5
docs/source/reference/lua-scripting/openmw_aux_core.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Package openmw_aux.core
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. raw:: html
|
||||||
|
:file: generated_html/openmw_aux_core.html
|
@ -9,3 +9,5 @@
|
|||||||
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+
|
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+
|
||||||
|:ref:`openmw_aux.ui <Package openmw_aux.ui>` | by player scripts | | User interface utils |
|
|:ref:`openmw_aux.ui <Package openmw_aux.ui>` | by player scripts | | User interface utils |
|
||||||
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+
|
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+
|
||||||
|
|:ref:`openmw_aux.core <Package openmw_aux.core>` | everywhere | | GameObject Utils |
|
||||||
|
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+
|
||||||
|
@ -8,14 +8,21 @@ local core = require('openmw.core')
|
|||||||
local aux_core = {}
|
local aux_core = {}
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Checks if the provided armor is Heavy, Medium, or Light
|
-- Checks if the provided armor is Heavy, Medium, or Light. Errors if invaid object supplied.
|
||||||
-- @function [parent=#core] getArmorType
|
-- @function [parent=#core] getArmorType
|
||||||
-- @param openmw.core#GameObject armor
|
-- @param openmw.core#GameObject armor Either a gameObject or a armor record.
|
||||||
-- @return #string
|
-- @return #string Heavy, Medium, or Light
|
||||||
function aux_core.getArmorType(item)
|
function aux_core.getArmorType(armor)
|
||||||
if item.type ~= types.Armor then
|
|
||||||
|
if armor.type ~= types.Armor and not armor.baseArmor then
|
||||||
error("Not Armor")
|
error("Not Armor")
|
||||||
end
|
end
|
||||||
|
local record = nil
|
||||||
|
if armor.baseArmor then--A record was supplied, not a gameObject
|
||||||
|
record = armor
|
||||||
|
else
|
||||||
|
record = types.Armor.record(armor)
|
||||||
|
end
|
||||||
local epsilon = 0.0005;
|
local epsilon = 0.0005;
|
||||||
local lightMultiplier = core.getGMST("fLightMaxMod") + epsilon
|
local lightMultiplier = core.getGMST("fLightMaxMod") + epsilon
|
||||||
local medMultiplier = core.getGMST("fMedMaxMod") + epsilon
|
local medMultiplier = core.getGMST("fMedMaxMod") + epsilon
|
||||||
@ -32,8 +39,8 @@ function aux_core.getArmorType(item)
|
|||||||
[types.Armor.TYPE.LGauntlet] = "iGauntletWeight",
|
[types.Armor.TYPE.LGauntlet] = "iGauntletWeight",
|
||||||
[types.Armor.TYPE.RGauntlet] = "iGauntletWeight",
|
[types.Armor.TYPE.RGauntlet] = "iGauntletWeight",
|
||||||
}
|
}
|
||||||
local armorType = types.Armor.record(item).type
|
local armorType = record.type
|
||||||
local weight = item.type.record(item).weight
|
local weight = record.weight
|
||||||
local armorTypeWeight = math.floor(core.getGMST(armorGMSTs[armorType]))
|
local armorTypeWeight = math.floor(core.getGMST(armorGMSTs[armorType]))
|
||||||
|
|
||||||
if weight <= armorTypeWeight * lightMultiplier then
|
if weight <= armorTypeWeight * lightMultiplier then
|
||||||
@ -95,8 +102,8 @@ end
|
|||||||
-- @function [parent=#core] getDropSound
|
-- @function [parent=#core] getDropSound
|
||||||
-- @param openmw.core#GameObject item
|
-- @param openmw.core#GameObject item
|
||||||
-- @return #string
|
-- @return #string
|
||||||
function aux_core.getDropSound(obj)
|
function aux_core.getDropSound(item)
|
||||||
local soundName = getItemSound(obj)
|
local soundName = getItemSound(item)
|
||||||
return string.format("Item %s Down", soundName)
|
return string.format("Item %s Down", soundName)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -105,8 +112,8 @@ end
|
|||||||
-- @function [parent=#core] getPickupSound
|
-- @function [parent=#core] getPickupSound
|
||||||
-- @param openmw.core#GameObject item
|
-- @param openmw.core#GameObject item
|
||||||
-- @return #string
|
-- @return #string
|
||||||
function aux_core.getPickupSound(obj)
|
function aux_core.getPickupSound(item)
|
||||||
local soundName = getItemSound(obj)
|
local soundName = getItemSound(item)
|
||||||
return string.format("Item %s Up", soundName)
|
return string.format("Item %s Up", soundName)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -626,18 +626,6 @@
|
|||||||
-- @param openmw.core#GameObject object
|
-- @param openmw.core#GameObject object
|
||||||
-- @return #boolean
|
-- @return #boolean
|
||||||
|
|
||||||
---
|
|
||||||
-- Get this item's pick up sound
|
|
||||||
-- @function [parent=#Item] getPickupSound
|
|
||||||
-- @param openmw.core#GameObject item
|
|
||||||
-- @return #string The String ID of the pick up sound for this item.
|
|
||||||
|
|
||||||
---
|
|
||||||
-- Get this item's drop sound
|
|
||||||
-- @function [parent=#Item] getDropSound
|
|
||||||
-- @param openmw.core#GameObject item
|
|
||||||
-- @return #string The String ID of the drop sound for this item.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Get this item's current enchantment charge.
|
-- Get this item's current enchantment charge.
|
||||||
-- @function [parent=#Item] getEnchantmentCharge
|
-- @function [parent=#Item] getEnchantmentCharge
|
||||||
|
Loading…
x
Reference in New Issue
Block a user