public ExampleCraftable2(FcCraftingTab parentTab)
     : base("ExampleCraftable2", "friendlyName", "description", parentTab)
 {
 }
Exemple #2
0
        protected FcCraftable(string classId, string friendlyName, string description, FcCraftingTab parentTab)
            : base(classId, friendlyName, description)
        {
            this.ParentTab = parentTab;

            OnStartedPatching += () =>
            {
                this.ParentTab.LoadAssets(this.AssetBundlesService);
                this.AssetBundle = this.AssetBundlesService.GetAssetBundleByName(this.AssetBundleName);
            };

            OnFinishedPatching += () =>
            {
                if (!this.FabricatorService.HasCraftingTab(this.ParentTab.Id))
                {
                    string tabId       = this.ParentTab.Id;
                    string displayText = this.ParentTab.DisplayName;
                    Sprite icon        = this.ParentTab.Icon;

                    this.FabricatorService.AddTabNode(tabId, displayText, icon);
                }

                this.FabricatorService.AddCraftNode(this, this.ParentTab.Id);
            };
        }