Esempio n. 1
0
 /// <summary>
 /// Populates a GSC file with the strings stored in this translation file.
 /// </summary>
 /// <param name="file"></param>
 internal void Populate(GscFile file)
 {
     for (int i = 0; i < _Strings.Count && i < file.Strings.Length; i++)
     {
         file.Strings[i] = _Strings[i];
     }
 }
Esempio n. 2
0
 public static GscFile FromBytes(byte[] bytes)
 {
     using (var stream = new MemoryStream(bytes))
     {
         return(GscFile.FromStream(stream));
     }
 }
Esempio n. 3
0
 public static GscFile FromFile(string path)
 {
     using (var stream = File.OpenRead(path))
     {
         return(GscFile.FromStream(stream));
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Turns this translation file into a GSC file that can be used in the game.
        /// </summary>
        /// <param name="refGsc">Path to the reference GSC.</param>
        /// <returns>The GSC representation of this translation file.</returns>
        public GscFile ToGSC(string refGsc)
        {
            var gsc = GscFile.FromFile(refGsc);

            Populate(gsc);

            return(gsc);
        }
Esempio n. 5
0
        /// <summary>
        /// Converts a GSC file (internal representation) into a TransFile (easily translatable).
        /// </summary>
        /// <param name="file">The file to be converted.</param>
        /// <returns>The TransFile representation of the GSC file.</returns>
        public static TransFile FromGSC(GscFile file)
        {
            var trans = new TransFile();

            trans.PopulateFrom(file);

            return(trans);
        }
Esempio n. 6
0
 /// <summary>
 /// Converts a GSC file (internal representation) into a TransFile (easily translatable).
 /// </summary>
 /// <param name="file">The file to be converted.</param>
 /// <returns>The TransFile representation of the GSC file.</returns>
 public static TransFile FromGSC(string file)
 {
     return(TransFile.FromGSC(GscFile.FromFile(file)));
 }
Esempio n. 7
0
 /// <summary>
 /// Loads the strings defined by a GSC file into this translation file.
 /// </summary>
 /// <param name="file"></param>
 internal void PopulateFrom(GscFile file)
 {
     _Strings = file.Strings.ToList();
 }