Naev

Module outfit

Lua bindings to interact with outfits.

This will allow you to create and manipulate outfits in-game.

An example would be:

 o = outfit.get( "Heavy Laser" ) -- Gets the outfit by name
 cpu_usage = o:cpu() -- Gets the cpu usage of the outfit
 slot_name, slot_size = o:slot() -- Gets slot information about the outfit
 

Functions

__eq (o1, o2) Checks to see if two outfits are the same.
get (s) Gets a outfit.
name (s) Gets the translated name of the outfit.
nameRaw (s) Gets the raw (untranslated) name of the outfit.
type (o) Gets the type of an outfit.
typeBroad (o) Gets the broad type of an outfit.
cpu (o) Gets the cpu usage of an outfit.
slot (o) Gets the slot name, size and property of an outfit.
icon (o) Gets the store icon for an outfit.
price (o) Gets the price of an outfit.


Functions

__eq (o1, o2)
Checks to see if two outfits are the same. ( o1, o2 )

Parameters:

  • o1 Outfit First outfit to compare.
  • o2 Outfit Second outfit to compare.

Returns:

    boolean true if both outfits are the same.

Usage:

    if o1 == o2 then -- Checks to see if outfit o1 and o2 are the same
get (s)
Gets a outfit. ( s )

Parameters:

  • s string Raw (untranslated) name of the outfit to get.

Returns:

    Outfit or nil The outfit matching name or nil if error.

Usage:

    s = outfit.get( "Heavy Laser" ) -- Gets the heavy laser
name (s)
Gets the translated name of the outfit.

This translated name should be used for display purposes (e.g. messages). It cannot be used as an identifier for the outfit; for that, use outfit.nameRaw() instead. ( s )

Parameters:

  • s Outfit Outfit to get the translated name of.

Returns:

    string The translated name of the outfit.

Usage:

    outfitname = s:name() -- Equivalent to `_(s:nameRaw())`
nameRaw (s)
Gets the raw (untranslated) name of the outfit.

This untranslated name should be used for identification purposes (e.g. can be passed to outfit.get()). It should not be used directly for display purposes without manually translating it with _(). ( s )

Parameters:

  • s Outfit Outfit to get the raw name of.

Returns:

    string The raw name of the outfit.

Usage:

    outfitrawname = s:nameRaw()
type (o)
Gets the type of an outfit. ( o )

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The name of the outfit type (in English).

Usage:

    print( o:type() ) -- Prints the type of the outfit
typeBroad (o)
Gets the broad type of an outfit.

This name is more generic and vague than type(). ( o )

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The name of the outfit broad type (in English).

Usage:

    print( o:typeBroad() ) -- Prints the broad type of the outfit
cpu (o)
Gets the cpu usage of an outfit. ( o )

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    string The amount of cpu the outfit uses.

Usage:

    print( o:cpu() ) -- Prints the cpu usage of an outfit
slot (o)
Gets the slot name, size and property of an outfit. ( o )

Parameters:

  • o Outfit Outfit to get information of.

Returns:

  1. string Human readable name (in English).
  2. string Human readable size.
  3. string Human readable property.

Usage:

    slot_name, slot_size, slot_prop = o:slot() -- Gets an outfit's slot info
icon (o)
Gets the store icon for an outfit. ( o )

Parameters:

  • o Outfit Outfit to get information of.

Returns:

    Tex The texture containing the icon of the outfit.

Usage:

    ico = o:icon() -- Gets the shop icon for an outfit
price (o)
Gets the price of an outfit. ( o )

Parameters:

  • o String Outfit to get the price of.

Returns:

    number The price, in credits.

Usage:

    price = o:price()
generated by LDoc 1.4.6 Last updated 2020-11-29 21:27:05