public CustomCraftTab(string path, string name, CraftScheme scheme, Atlas.Sprite sprite) { Path = path; Name = name; Scheme = scheme; Sprite = new CustomSprite(SpriteManager.Group.Category, SpriteId, sprite); LanguagePatcher.customLines[LanguageId] = name; CustomSpriteHandler.customSprites.Add(Sprite); }
public CustomCraftTab(string path, string name, CraftScheme scheme, UnityEngine.Sprite sprite) : this(path, name, scheme, new Atlas.Sprite(sprite, false)) { }
private static void PatchNodes(ref CraftNode nodes, List <CustomCraftNode> customNodes, CraftScheme scheme) { foreach (var customNode in customNodes) { if (customNode.Scheme != scheme) { continue; } var path = customNode.Path.SplitByChar('/'); var currentNode = default(TreeNode); currentNode = nodes; for (int i = 0; i < path.Length; i++) { var currentPath = path[i]; if (i == (path.Length - 1)) { break; } currentNode = currentNode[currentPath]; } currentNode.AddNode(new TreeNode[] { new CraftNode(path[path.Length - 1], TreeAction.Craft, customNode.TechType) }); } }
private static void AddCustomTabs(ref CraftNode nodes, List <CustomCraftTab> customTabs, CraftScheme scheme) { foreach (var tab in customTabs) { if (tab.Scheme != scheme) { continue; } var path = tab.Path.SplitByChar('/'); var currentNode = default(TreeNode); currentNode = nodes; for (int i = 0; i < path.Length; i++) { var currentPath = path[i]; var node = currentNode[currentPath]; if (node == null) { var newNode = new CraftNode(currentPath, TreeAction.Expand, TechType.None); currentNode.AddNode(new TreeNode[] { newNode }); node = newNode; } currentNode = node; } } }
public CraftNodeToScrub(CraftScheme scheme, string path) : this(Utility.CraftSchemeMap[scheme], path) { }
public CustomCraftNode(TechType techType, CraftScheme scheme, string path) : this(techType, Utility.CraftSchemeMap[scheme], path) { }
public CustomCraftNode(TechType techType, CraftScheme scheme, string path) { TechType = techType; Scheme = scheme; Path = path; }
public CustomCraftTab(string path, string name, CraftScheme scheme, UnityEngine.Sprite sprite) : this(path, name, Utility.CraftSchemeMap[scheme], sprite) { }