Finish docs(for now), remove C++ changes

This commit is contained in:
Zackhasacat 2023-08-30 22:17:31 -05:00
parent 5827f1c250
commit c73e95063d
6 changed files with 26 additions and 27 deletions

View File

@ -12,10 +12,6 @@ namespace MWLua
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
item["setEnchantmentCharge"]
= [](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"]
= [](const Object& object) -> bool { return object.ptr().getRefData().getCount(false) < 0; };
}

View File

@ -28,6 +28,7 @@ Lua API reference
openmw_aux_util
openmw_aux_time
openmw_aux_ui
openmw_aux_core
interface_activation
interface_ai
interface_camera

View File

@ -0,0 +1,5 @@
Package openmw_aux.core
=======================
.. raw:: html
:file: generated_html/openmw_aux_core.html

View File

@ -9,3 +9,5 @@
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+
|: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 |
+---------------------------------------------------------+--------------------+---------------------------------------------------------------+

View File

@ -8,14 +8,21 @@ local core = require('openmw.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
-- @param openmw.core#GameObject armor
-- @return #string
function aux_core.getArmorType(item)
if item.type ~= types.Armor then
-- @param openmw.core#GameObject armor Either a gameObject or a armor record.
-- @return #string Heavy, Medium, or Light
function aux_core.getArmorType(armor)
if armor.type ~= types.Armor and not armor.baseArmor then
error("Not Armor")
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 lightMultiplier = core.getGMST("fLightMaxMod") + epsilon
local medMultiplier = core.getGMST("fMedMaxMod") + epsilon
@ -32,8 +39,8 @@ function aux_core.getArmorType(item)
[types.Armor.TYPE.LGauntlet] = "iGauntletWeight",
[types.Armor.TYPE.RGauntlet] = "iGauntletWeight",
}
local armorType = types.Armor.record(item).type
local weight = item.type.record(item).weight
local armorType = record.type
local weight = record.weight
local armorTypeWeight = math.floor(core.getGMST(armorGMSTs[armorType]))
if weight <= armorTypeWeight * lightMultiplier then
@ -95,8 +102,8 @@ end
-- @function [parent=#core] getDropSound
-- @param openmw.core#GameObject item
-- @return #string
function aux_core.getDropSound(obj)
local soundName = getItemSound(obj)
function aux_core.getDropSound(item)
local soundName = getItemSound(item)
return string.format("Item %s Down", soundName)
end
@ -105,8 +112,8 @@ end
-- @function [parent=#core] getPickupSound
-- @param openmw.core#GameObject item
-- @return #string
function aux_core.getPickupSound(obj)
local soundName = getItemSound(obj)
function aux_core.getPickupSound(item)
local soundName = getItemSound(item)
return string.format("Item %s Up", soundName)
end

View File

@ -626,18 +626,6 @@
-- @param openmw.core#GameObject object
-- @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.
-- @function [parent=#Item] getEnchantmentCharge