public override void SetDefaults() { Main.tileSpelunker[Type] = true; Main.tileContainer[Type] = true; Main.tileShine2[Type] = true; Main.tileShine[Type] = 1200; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; Main.tileValue[Type] = 10; TileID.Sets.HasOutlines[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style5x4); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(2, 2); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; TileObjectData.newTile.HookCheck = new PlacementHook(new Func <int, int, int, int, int, int>(Chest.FindEmptyChest), -1, 0, true); TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func <int, int, int, int, int, int>(Chest.AfterPlacement_Hook), -1, 0, false); TileObjectData.newTile.AnchorInvalidTiles = new[] { (int)TileID.MagicalIceBlock }; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); AddMapEntry(new Color(0, 191, 225), name); disableSmartCursor = true; chest = name.GetTranslation(Language.ActiveCulture); chestDrop = ModContent.ItemType <UniversalCrafter>(); }
public static void SwapTranslation(this ModTranslation target, ModTranslation source) { //Currently the Steam API supports 29 languages for (int i = 1; i <= 29; i++) { string translation = source.GetTranslation(i); if (i == 1 || translation != source.GetDefault()) { target.AddTranslation(i, translation); } } }
public static void AddLine(this ModTranslation self, string text, int culture = 0) { string currentText; if (culture == 0) { currentText = self.GetDefault(); currentText += text + "\n"; self.SetDefault(currentText); } else { currentText = self.GetTranslation(culture); currentText += text + "\n"; self.AddTranslation(culture, currentText); } }
public static string GetTranslation(this ModTranslation modTranslation, CultureInfo culture) { var translation = modTranslation.GetTranslation(Localizer.CultureInfoToGameCulture(culture)); return(string.IsNullOrWhiteSpace(translation) ? "" : translation); }
public static LocalizedText TextFromTranslation(this ModTranslation translation) { Type type = typeof(LocalizedText); return((LocalizedText)type.Assembly.CreateInstance(type.FullName, false, BindingFlags.Instance | BindingFlags.NonPublic, null, new object[] { translation.Key, translation.GetTranslation(Language.ActiveCulture.LegacyId) }, null, null)); }
public static string GetLocalizedString(ModTranslation translation) { return(translation.GetTranslation(LanguageManager.Instance.ActiveCulture)); }
public String GetTranslation(GameCulture culture) { return(translation.GetTranslation(culture)); }