//private void CreateIcon(uGUI_CraftingMenu.Node node, RectTransform canvas, float size, float x, float y) public static void CreateIcon_Postfix(uGUI_CraftingMenu __instance, uGUI_CraftingMenu.Node node, RectTransform canvas, float size, float x, float y) { if (node != null && node.action == TreeAction.Expand) { if (__instance != null && node.icon != null) { // If current node belongs to one of our custom fabricators if (__instance.id == "DecorationsFabricator" && DecorationNodes.Contains(node.id)) { node.icon.SetBackgroundColors(DNormal, DHover, DPressed); } else if (__instance.id == "FloraFabricator" && FloraNodes.Contains(node.id)) { node.icon.SetBackgroundColors(FNormal, FHover, FPressed); } } } }
//protected void CreateIcon() public static void CreateIcon_Postfix(uGUI_CraftNode __instance) { if (_view != null && __instance.action == TreeAction.Expand) { var cm = (uGUI_CraftingMenu)_view.GetValue(__instance); if (cm != null && __instance.icon != null) { // If current node belongs to one of our custom fabricators if (cm.id == "DecorationsFabricator" && DecorationNodes.Contains(__instance.id)) { __instance.icon.SetBackgroundColors(DNormal, DHover, DPressed); } else if (cm.id == "FloraFabricator" && FloraNodes.Contains(__instance.id)) { __instance.icon.SetBackgroundColors(FNormal, FHover, FPressed); } } } }