/// <summary> /// Creates a ModTranslation object that you can use in AddMapEntry. /// </summary> /// <param name="key">The key for the ModTranslation. The full key will be MapObject.ModName.key</param> /// <returns></returns> public ModTranslation CreateMapEntryName(string key = null) { if (string.IsNullOrEmpty(key)) { key = Name; } return(Mod.GetOrCreateTranslation(string.Format("Mods.{0}.MapObject.{1}", Mod.Name, key))); }
protected override void Register() { InfoName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.InfoDisplayName.{Name}"); ModTypeLookup <InfoDisplay> .Register(this); Type = InfoDisplayLoader.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() { ModTypeLookup <ModProjectile> .Register(this); projectile.type = ProjectileLoader.ReserveProjectileID(); DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.ProjectileName.{Name}"); ProjectileLoader.projectiles.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); }
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() { 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() { 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); } }