Skip to content

MenuActivatorData

Merlord edited this page Apr 8, 2023 · 9 revisions
Field Type Description
id string Required Usually, this is the in-game id of the object used as this Crafting Station. If your menuActivator.type == 'event', then the id needs to be the id of the event on which this Crafting Station's crafting menu will be opened. Typically a custom event triggered by your mod.
name string The name appears on the Crafting Menu when this Crafting Station is used. If no name is given for activator Crafting Stations, the in-game name of the associated object will be used.
type MenuActivatorType Required The type controls how the Crafting Station can be interacted with.
recipes RecipeData[] A list of RecipeData for recipes that will appear (if known) when the menu is activated.
defaultFilter MenuActivatorFilter Default: "all". The filter controls which recipes will appear in the Crafting Menu.
defaultSort MenuActivatorSort Default: "name". This controls how the recipe list in the Crafting Menu is sorted.
defaultShowCategories boolean Default: true. This controls whether by default the recipes will be grouped in categories or not.
blockEvent boolean Default: true. This controls whether the event callback will be blocked or not (the event being "activate" or "equip" for those MenuActivator types, or the custom event for the "event" MenuActivator type).
closeCallback function Default: nil. This callback is called when the menu is closed.
collapseByDefault boolean Default: false. This controls whether the categories will be collapsed by default or not.
craftButtonText string Default: "Craft". This controls the text of the craft button.
recipeHeaderText string Default: "Recipes". This controls the text of the header of the recipe list.
skillsHeaderText string Default: "Skills". This controls the text of the header of the skills list.
customRequirementsHeaderText string Default: "Requirements". This controls the text of the header of the custom requirements list.
toolsHeaderText string Default: "Tools". This controls the text of the header of the tools list.
materialsHeaderText string Default: "Materials". This controls the text of the header of the materials list.
menuWidth number Default: 720. This controls the width of the crafting menu.
menuHeight number Default: 800. This controls the height of the crafting menu.
previewHeight number Default: 270. This controls the height of the preview area.
previewWidth number Default: 270. This controls the width of the preview area.
previewYOffset number Default: -200. This controls the y-offset of the preview area.
showCollapseCategoriesButton boolean Default: true. This controls whether the collapse categories button will be shown or not.
showCategoriesButton boolean Default: true. This controls whether the categories button will be shown or not.
showFilterButton boolean Default: true. This controls whether the filter button will be shown or not.
showSortButton boolean Default: true. This controls whether the sort button will be shown or not.

MenuActivatorType

Value Description
activate These Stations are objects in the game world, and their Crafting Menu is opened when they are activated.
equip These Stations are used by equipping them. Suitable for carriable Crafting Stations.
event These Stations are used when a certain event is triggered. Typically used with custom events triggered by your mod.

MenuActivatorFilter

Value Description
all This filter will make all the recipes that can possibly be crafted on this Crafting Station appear in the Crafting Menu.
canCraft This filter will make only the recipes that the player can currently craft appear in the Crafting Menu.
materials This filter will make only the recipes that the player has enough materials for, and has the required tools, appear in the Crafting Menu.
skill This filter will make only the recipes that the player's skills allow crafting appear in the Crafting Menu.

MenuActivatorSort

Value Description
name This will sort the recipe list in the Crafting Menu by name of the craftable item alphabetically.
skill This will sort the recipe list in the Crafting Menu by the average skill level required to craft the recipe (ascending).
canCraft This will sort the recipe list in the Crafting Menu by putting the recipes the player can craft at the top.

Clone this wiki locally