internal static void AddBossBarStyle(ModBossBarStyle bossBarStyle) { lock (bossBarStyles) { bossBarStyles.Add(bossBarStyle); ModTypeLookup <ModBossBarStyle> .Register(bossBarStyle); } }
internal static void Add(ModMenu modMenu) { lock (menus) { menus.Add(modMenu); ModTypeLookup <ModMenu> .Register(modMenu); } }
protected override void Register() { InfoName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.InfoDisplayName.{Name}"); ModTypeLookup <InfoDisplay> .Register(this); Type = InfoDisplayLoader.Add(this); }
protected override sealed void Register() { Type = (ushort)WallLoader.ReserveWallID(); ModTypeLookup <ModWall> .Register(this); WallLoader.walls.Add(this); }
protected sealed override void Register() { ModTypeLookup <ModTile> .Register(this); Type = (ushort)TileLoader.ReserveTileID(); TileLoader.tiles.Add(this); }
protected override sealed void Register() { Slot = UgBgStyleLoader.ReserveBackgroundSlot(); ModTypeLookup <ModUgBgStyle> .Register(this); UgBgStyleLoader.ugBgStyles.Add(this); }
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); }
protected sealed override void Register() { Type = WaterfallStyleLoader.ReserveStyle(); ModTypeLookup <ModWaterfallStyle> .Register(this); WaterfallStyleLoader.waterfallStyles.Add(this); }
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; } } }
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; }
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); }
protected sealed override void Register() { ProjectileLoader.VerifyGlobalProjectile(this); ModTypeLookup <GlobalProjectile> .Register(this); index = ProjectileLoader.globalProjectiles.Count; ProjectileLoader.globalProjectiles.Add(this); }
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); }
protected sealed override void Register() { ItemLoader.VerifyGlobalItem(this); ModTypeLookup <GlobalItem> .Register(this); index = (ushort)ItemLoader.globalItems.Count; ItemLoader.globalItems.Add(this); }
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); }
protected sealed override void Register() { NPCLoader.VerifyGlobalNPC(this); ModTypeLookup <GlobalNPC> .Register(this); index = NPCLoader.globalNPCs.Count; NPCLoader.globalNPCs.Add(this); }
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); }
internal static void RegisterDefaultDisplays() { int i = 0; foreach (var infoDisplay in InfoDisplays) { infoDisplay.Type = i++; ContentInstance.Register(infoDisplay); ModTypeLookup <InfoDisplay> .Register(infoDisplay); } }
internal static void RegisterDefaultClasses() { int i = 0; foreach (var damageClass in DamageClasses) { damageClass.Type = i++; ContentInstance.Register(damageClass); ModTypeLookup <DamageClass> .Register(damageClass); } }
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); }
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); } }
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); }
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); } }
protected override sealed void Register() { ModTypeLookup <GlobalBgStyle> .Register(this); GlobalBgStyleLoader.globalBgStyles.Add(this); }
protected sealed override void Register() { ModTypeLookup <ModPlayer> .Register(this); PlayerHooks.Add(this); }
protected sealed override void Register() { ModTypeLookup <GlobalTile> .Register(this); TileLoader.globalTiles.Add(this); }
protected sealed override void Register() { ModTypeLookup <GlobalWall> .Register(this); WallLoader.globalWalls.Add(this); }
protected sealed override void Register() { ModTypeLookup <ModWorld> .Register(this); WorldHooks.Add(this); }
protected sealed override void Register() { ModTypeLookup <ModRarity> .Register(this); Type = RarityLoader.Add(this); }