Beispiel #1
0
        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>();
        }
Beispiel #2
0
 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);
         }
     }
 }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        public static string GetTranslation(this ModTranslation modTranslation, CultureInfo culture)
        {
            var translation = modTranslation.GetTranslation(Localizer.CultureInfoToGameCulture(culture));

            return(string.IsNullOrWhiteSpace(translation) ? "" : translation);
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
 public static string GetLocalizedString(ModTranslation translation)
 {
     return(translation.GetTranslation(LanguageManager.Instance.ActiveCulture));
 }
 public String GetTranslation(GameCulture culture)
 {
     return(translation.GetTranslation(culture));
 }