예제 #1
0
        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);
        }
예제 #2
0
 public CustomCraftTab(string path, string name, CraftScheme scheme, UnityEngine.Sprite sprite) : this(path, name, scheme, new Atlas.Sprite(sprite, false))
 {
 }
예제 #3
0
        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)
                });
            }
        }
예제 #4
0
        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;
                }
            }
        }
예제 #5
0
 public CraftNodeToScrub(CraftScheme scheme, string path)
     : this(Utility.CraftSchemeMap[scheme], path)
 {
 }
예제 #6
0
 public CustomCraftNode(TechType techType, CraftScheme scheme, string path)
     : this(techType, Utility.CraftSchemeMap[scheme], path)
 {
 }
예제 #7
0
 public CustomCraftNode(TechType techType, CraftScheme scheme, string path)
 {
     TechType = techType;
     Scheme   = scheme;
     Path     = path;
 }
예제 #8
0
 public CustomCraftTab(string path, string name, CraftScheme scheme, UnityEngine.Sprite sprite)
     : this(path, name, Utility.CraftSchemeMap[scheme], sprite)
 {
 }