Exemple #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);
        }
        public CustomCraftTab(string path, string name, CraftTree.Type scheme, Atlas.Sprite sprite)
        {
            Path   = path;
            Name   = name;
            Scheme = scheme;
            Sprite = new CustomSprite(SpriteManager.Group.Category, SpriteId, sprite);

            string modName = ReflectionHelper.CallingAssemblyNameByStackTrace();

            LanguagePatcher.AddCustomLanguageLine(modName, LanguageId, name);
            CustomSpriteHandler.customSprites.Add(Sprite);
        }
Exemple #3
0
        internal override void LinkToParent(CustomCraftTreeLinkingNode parent)
        {
            base.LinkToParent(parent);

            string tabLanguageID = $"{SchemeAsString}Menu_{Name}";

            // Legacy Support
            LanguagePatcher.AddCustomLanguageLine("SMLHelper", tabLanguageID, DisplayText);

            string spriteID = $"{SchemeAsString}_{Name}";

            CustomSprite custSprite;

            if (Asprite != null)
            {
                custSprite = new CustomSprite(SpriteManager.Group.Category, spriteID, Asprite);
            }
            else
            {
                custSprite = new CustomSprite(SpriteManager.Group.Category, spriteID, Usprite);
            }

            CustomSpriteHandler.customSprites.Add(custSprite);
        }