Module ORGM.Component

Component Functions

This file handles functions dealing with components and attachments.

Info:

  • Copyright: 2018 File: shared/2LoadOrder/ORGMComponents.lua
  • Release: 3.09
  • Author: Fenris_Wolf

Functions

register (name, compData) Registers a component/attachment type with ORGM.
deregister (name) Deregisters a component with ORGM.
random ([thisTable]) Returns the name of a random component item.
getTable () Gets the table of registered componennts.
getData (itemType[, moduleName]) Gets a value from the ComponentTable, supports module checking.
isComponent (itemType[, moduleName]) Checks if a item is a ORGM component.
getValid (item) Gets a list of all valid component names for a firearm.
getAttached (item) Gets all components attached to a firearm.
copy (item) Copies a WeaponPart item and returns a new copy with updated script item stats and current BUILD_ID.
toggleLight (player) Toggles the tactical light on a players primary hand item.


Functions

Methods
register (name, compData)
Registers a component/attachment type with ORGM.

Parameters:

  • name string name without module prefix.
  • compData table Valid table keys/value pairs are: * moduleName = nil|string, module name this item is from. If nil, ORGM is used

Returns:

    bool true on success.
deregister (name)
Deregisters a component with ORGM.

Parameters:

  • name string name of the component.

Returns:

    bool true on success
random ([thisTable])
Returns the name of a random component item.

Parameters:

  • thisTable table table to select from. (optional)

Returns:

    string the random component name.
getTable ()
Gets the table of registered componennts.

Returns:

    table all registered components setup by ORGM.Component.register
getData (itemType[, moduleName])
Gets a value from the ComponentTable, supports module checking.

Parameters:

  • itemType string or InventoryItem
  • moduleName string module to compare (optional)

Returns:

    table data of a registered component setup by ORGM.Component.register
isComponent (itemType[, moduleName])
Checks if a item is a ORGM component.

Parameters:

  • itemType string or InventoryItem
  • moduleName string module to compare (optional)

Returns:

    bool true if registered component setup by ORGM.Component.register
getValid (item)
Gets a list of all valid component names for a firearm.

Parameters:

  • item HandWeapon

Returns:

    table
getAttached (item)
Gets all components attached to a firearm.

Parameters:

  • item HandWeapon

Returns:

    table
copy (item)
Copies a WeaponPart item and returns a new copy with updated script item stats and current BUILD_ID.

This preserves existing mod data, this is used when updating components.

Parameters:

  • item WeaponPart

Returns:

    WeaponPart

See also:

toggleLight (player)
Toggles the tactical light on a players primary hand item.

Parameters:

  • player IsoPlayer , or true

Returns:

    nil or bool true if light is toggled
generated by LDoc 1.4.3 Last updated 2019-04-11 18:37:45