Beispiel #1
0
        /// <summary>
        /// Gets the version of the current textures file
        /// </summary>
        /// <param name="path">The textures file path</param>
        /// <returns>The version or null if not found</returns>
        public Rayman2Translation?GetTexturesVersion(FileSystemPath path)
        {
            if (!path.FileExists)
            {
                return(null);
            }

            try
            {
                var size = path.GetSize();

                if (size == ByteSize.FromBytes(29271236))
                {
                    return(Rayman2Translation.Original);
                }

                if (size == ByteSize.FromBytes(29276103))
                {
                    return(Rayman2Translation.Swedish);
                }

                if (size == ByteSize.FromBytes(29274254))
                {
                    return(Rayman2Translation.Portuguese);
                }

                if (size == ByteSize.FromBytes(29116088))
                {
                    return(Rayman2Translation.Slovak);
                }

                return(null);
            }
            catch (Exception ex)
            {
                ex.HandleError("Getting R2 textures file size");
                return(null);
            }
        }