Module crafting
[action-main] Adds functionality for player-facing crafting menus.
By default, adds a menu named "Build..." that fetches entries from ship.buildable
.
Functions
crafting.addMenu(menuName, actionName, getEntries) | Add a crafting menu to the main menu. |
crafting.buildMenu(menuName, actionName, getEntries) | Builds a crafting menu for the main menu. |
Recipe format
recipe | Recipe table format. |
Functions
- crafting.addMenu(menuName, actionName, getEntries)
-
Add a crafting menu to the main menu.
Parameters:
- menuName The name of the menu.
- actionName The default action for the menu.
- getEntries
A
function(ship)
that returns a list of entries to use for the menu.
See also:
- crafting.buildMenu(menuName, actionName, getEntries)
-
Builds a crafting menu for the main menu.
Parameters:
- menuName The name of the menu.
- actionName The default action for the menu.
- getEntries
A
function(ship)
that returns a list of entries to use for the menu.
See also:
Recipe format
- recipe
-
Recipe table format.
- stations A list of stations that can build the recipe. If not present, all stations can build the recipe. (optional)
- action The displayed action to build the recipe. If not present, the default action for the menu is used. (optional)
- name The name of the recipe.
- take An exchange resource list containing the resources required to build the recipe. (optional)
- add An exchange resource list containing the resources resulting from building the recipe. (optional)
- time The time required to build the recipe. (optional)
- multi Whether more than one of this recipe can be built at once. (optional)