Пример #1
0
 internal static void AddBossBarStyle(ModBossBarStyle bossBarStyle)
 {
     lock (bossBarStyles) {
         bossBarStyles.Add(bossBarStyle);
         ModTypeLookup <ModBossBarStyle> .Register(bossBarStyle);
     }
 }
Пример #2
0
 internal static void Add(ModMenu modMenu)
 {
     lock (menus) {
         menus.Add(modMenu);
         ModTypeLookup <ModMenu> .Register(modMenu);
     }
 }
Пример #3
0
        protected override void Register()
        {
            InfoName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.InfoDisplayName.{Name}");

            ModTypeLookup <InfoDisplay> .Register(this);

            Type = InfoDisplayLoader.Add(this);
        }
Пример #4
0
        protected override sealed void Register()
        {
            Type = (ushort)WallLoader.ReserveWallID();

            ModTypeLookup <ModWall> .Register(this);

            WallLoader.walls.Add(this);
        }
Пример #5
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModTile> .Register(this);

            Type = (ushort)TileLoader.ReserveTileID();

            TileLoader.tiles.Add(this);
        }
Пример #6
0
        protected override sealed void Register()
        {
            Slot = UgBgStyleLoader.ReserveBackgroundSlot();

            ModTypeLookup <ModUgBgStyle> .Register(this);

            UgBgStyleLoader.ugBgStyles.Add(this);
        }
Пример #7
0
        protected override sealed void Register()
        {
            Slot = SurfaceBgStyleLoader.ReserveBackgroundSlot();

            ModTypeLookup <ModSurfaceBgStyle> .Register(this);

            SurfaceBgStyleLoader.surfaceBgStyles.Add(this);
        }
        protected override void Register()
        {
            index = DamageClassLoader.Add(this);

            ClassName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.DamageClassName.{Name}");

            ModTypeLookup <DamageClass> .Register(this);
        }
Пример #9
0
        protected sealed override void Register()
        {
            Type = WaterfallStyleLoader.ReserveStyle();

            ModTypeLookup <ModWaterfallStyle> .Register(this);

            WaterfallStyleLoader.waterfallStyles.Add(this);
        }
Пример #10
0
        protected sealed override void Register()
        {
            if (Mount.mounts == null || Mount.mounts.Length == MountID.Count)
            {
                Mount.Initialize();
            }

            Type = MountLoader.ReserveMountID();

            ModTypeLookup <ModMount> .Register(this);

            MountLoader.mountDatas[Type] = this;

            foreach (MountTextureType textureType in Enum.GetValues(typeof(MountTextureType)))
            {
                string extraTexture = GetExtraTexture(textureType);

                if (string.IsNullOrEmpty(extraTexture) || !ModContent.TryGetTexture(extraTexture, out var textureAsset))
                {
                    continue;
                }

                switch (textureType)
                {
                case MountTextureType.Back:
                    MountData.backTexture = textureAsset;
                    break;

                case MountTextureType.BackGlow:
                    MountData.backTextureGlow = textureAsset;
                    break;

                case MountTextureType.BackExtra:
                    MountData.backTextureExtra = textureAsset;
                    break;

                case MountTextureType.BackExtraGlow:
                    MountData.backTextureExtraGlow = textureAsset;
                    break;

                case MountTextureType.Front:
                    MountData.frontTexture = textureAsset;
                    break;

                case MountTextureType.FrontGlow:
                    MountData.frontTextureGlow = textureAsset;
                    break;

                case MountTextureType.FrontExtra:
                    MountData.frontTextureExtra = textureAsset;
                    break;

                case MountTextureType.FrontExtraGlow:
                    MountData.frontTextureExtraGlow = textureAsset;
                    break;
                }
            }
        }
Пример #11
0
        protected override sealed void Register()
        {
            Type = ModDust.ReserveDustID();

            ModTypeLookup <ModDust> .Register(this);

            ModDust.dusts.Add(this);
            Texture2D = !string.IsNullOrEmpty(Texture) ? ModContent.GetTexture(Texture).Value : TextureAssets.Dust.Value;
        }
Пример #12
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModProjectile> .Register(this);

            projectile.type = ProjectileLoader.ReserveProjectileID();
            DisplayName     = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.ProjectileName.{Name}");

            ProjectileLoader.projectiles.Add(this);
        }
Пример #13
0
        protected sealed override void Register()
        {
            ProjectileLoader.VerifyGlobalProjectile(this);

            ModTypeLookup <GlobalProjectile> .Register(this);

            index = ProjectileLoader.globalProjectiles.Count;

            ProjectileLoader.globalProjectiles.Add(this);
        }
Пример #14
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModPrefix> .Register(this);

            DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.Prefix.{Name}");
            Type        = ModPrefix.ReservePrefixID();

            ModPrefix.prefixes.Add(this);
            ModPrefix.categoryPrefixes[Category].Add(this);
        }
Пример #15
0
        protected sealed override void Register()
        {
            ItemLoader.VerifyGlobalItem(this);

            ModTypeLookup <GlobalItem> .Register(this);

            index = (ushort)ItemLoader.globalItems.Count;

            ItemLoader.globalItems.Add(this);
        }
Пример #16
0
        protected sealed override void Register()
        {
            ContainerName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.Containers.{Name}", true);

            ModTypeLookup <ModTile> .Register(this);

            Type = (ushort)TileLoader.ReserveTileID();

            TileLoader.tiles.Add(this);
        }
Пример #17
0
        protected sealed override void Register()
        {
            NPCLoader.VerifyGlobalNPC(this);

            ModTypeLookup <GlobalNPC> .Register(this);

            index = NPCLoader.globalNPCs.Count;

            NPCLoader.globalNPCs.Add(this);
        }
Пример #18
0
        protected override sealed void Register()
        {
            ModTypeLookup <ModBuff> .Register(this);

            Type        = BuffLoader.ReserveBuffID();
            DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.BuffName.{Name}");
            Description = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.BuffDescription.{Name}");

            BuffLoader.buffs.Add(this);
        }
Пример #19
0
        internal static void RegisterDefaultDisplays()
        {
            int i = 0;

            foreach (var infoDisplay in InfoDisplays)
            {
                infoDisplay.Type = i++;
                ContentInstance.Register(infoDisplay);
                ModTypeLookup <InfoDisplay> .Register(infoDisplay);
            }
        }
Пример #20
0
        internal static void RegisterDefaultClasses()
        {
            int i = 0;

            foreach (var damageClass in DamageClasses)
            {
                damageClass.Type = i++;
                ContentInstance.Register(damageClass);
                ModTypeLookup <DamageClass> .Register(damageClass);
            }
        }
Пример #21
0
        public virtual void Load(Mod mod)
        {
            Mod = mod;

            if (!Mod.loading)
            {
                throw new Exception("AddTileEntity can only be called from Mod.Load or Mod.Autoload");
            }

            manager.Register(this);
            ModTypeLookup <ModTileEntity> .Register(this);
        }
Пример #22
0
        internal static void AddBossBar(ModBossBar bossBar)
        {
            bossBar.index = bossBars.Count;
            bossBars.Add(bossBar);
            ModTypeLookup <ModBossBar> .Register(bossBar);

            //Texture is optional
            if (ModContent.TextureExists(bossBar.Texture))
            {
                bossBarTextures[bossBar.index] = ModContent.GetTexture(bossBar.Texture);
            }
        }
Пример #23
0
        public virtual void Load(Mod mod)
        {
            Mod = mod;

            if (!Mod.loading)
            {
                throw new Exception("AddTileEntity can only be called from Mod.Load or Mod.Autoload");
            }

            //TODO: TileENtityLoader??
            int id = ReserveTileEntityID();

            Type = id;
            type = (byte)id;

            ModTypeLookup <ModTileEntity> .Register(this);

            tileEntities.Add(this);
        }
Пример #24
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModNPC> .Register(this);

            npc.type    = NPCLoader.ReserveNPCID();
            DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.NPCName.{Name}");

            NPCLoader.npcs.Add(this);

            Type type         = GetType();
            var  autoloadHead = type.GetAttribute <AutoloadHead>();

            if (autoloadHead != null)
            {
                Mod.AddNPCHeadTexture(npc.type, HeadTexture);
            }
            var autoloadBossHead = type.GetAttribute <AutoloadBossHead>();

            if (autoloadBossHead != null)
            {
                Mod.AddBossHeadTexture(BossHeadTexture, npc.type);
            }
        }
Пример #25
0
        protected override sealed void Register()
        {
            ModTypeLookup <GlobalBgStyle> .Register(this);

            GlobalBgStyleLoader.globalBgStyles.Add(this);
        }
Пример #26
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModPlayer> .Register(this);

            PlayerHooks.Add(this);
        }
Пример #27
0
        protected sealed override void Register()
        {
            ModTypeLookup <GlobalTile> .Register(this);

            TileLoader.globalTiles.Add(this);
        }
Пример #28
0
        protected sealed override void Register()
        {
            ModTypeLookup <GlobalWall> .Register(this);

            WallLoader.globalWalls.Add(this);
        }
Пример #29
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModWorld> .Register(this);

            WorldHooks.Add(this);
        }
Пример #30
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModRarity> .Register(this);

            Type = RarityLoader.Add(this);
        }