Class FabricatorGadget
Represents a craft tree/fabricator gadget.
public class FabricatorGadget : Gadget
- Inheritance
-
FabricatorGadget
- Inherited Members
- Extension Methods
Constructors
FabricatorGadget(ICustomPrefab)
Constructs a fabricator gadget.
public FabricatorGadget(ICustomPrefab prefab)
Parameters
prefab
ICustomPrefab- The custom prefab to operate on.
Properties
CraftTreeType
The ID value for your custom craft tree.
public CraftTree.Type CraftTreeType { get; }
Property Value
- CraftTree.Type
Root
The root node of the crafting tree.
public ModCraftTreeRoot Root { get; }
Property Value
Methods
AddCraftNode(string, string)
Safely attempts to add a new crafting node to the custom crafting tree of this fabricator.
If the modded TechType is not found, the craft node will not be added.
public FabricatorGadget AddCraftNode(string moddedTechType, string parentTabId = null)
Parameters
moddedTechType
string- The modded item to craft.
parentTabId
string- Optional. The parent tab of this craft node. When this value is null, the craft node will be added to the root of the craft tree.
Returns
AddCraftNode(TechType, string)
Adds a new crafting node to the custom crafting tree of this fabricator.
public FabricatorGadget AddCraftNode(TechType techType, string parentTabId = null)
Parameters
techType
TechType- The item to craft.
parentTabId
string- Optional. The parent tab of this craft node. When this value is null, the craft node will be added to the root of the craft tree.
Returns
AddTabNode(string, string, Sprite, string, string)
Adds a new tab node to the custom crafting tree of this fabricator.
public FabricatorGadget AddTabNode(string tabId, string displayText, Atlas.Sprite tabIcon, string language = "English", string parentTabId = null)
Parameters
tabId
string- The internal ID for the tab node.
displayText
string- The in-game text shown for the tab node. If null or empty, this will use the language line "{CraftTreeTypeName}_{
tabId
}" instead. tabIcon
Atlas.Sprite- The sprite used for the tab node.
language
string- The language for the display name. Defaults to English.
parentTabId
string- Optional. The parent tab of this tab. When this value is null, the tab will be added to the root of the craft tree.
Returns
Build()
Where the data actually gets registered to the game.
This is called after prefab register and PostRegisters in Register().
This is called after prefab register and PostRegisters in Register().
protected override void Build()