Beispiel #1
0
        public static void GenPedDefs_CreatePropFiles_FiveM(GenPedDefsOptions opts, string targetFileName, KeyValuePair <string, Tuple <string, int, int, int, string, string> > entry, int textureCount)
        {
            string sourceYddFile = entry.Key;
            string prefix        = entry.Value.Item1;
            int    origPos       = entry.Value.Item2;
            int    pos           = entry.Value.Item3;
            int    count         = entry.Value.Item4;
            string folder        = entry.Value.Item5;
            string yddFileName   = entry.Value.Item6;

            string targetYddFile = opts.OutputDirectory + "\\stream\\" + targetFileName + "_p^" + yddFileName;

            File.Copy(sourceYddFile, targetYddFile, true);

            int texCount = 0;

            for (int k = pos; k < textureCount + pos; k++)
            {
                char c = 'a';

                for (int l = 0; l < texCount; l++)
                {
                    c++;
                }

                string sourceYtdPath = folder + "\\" + origPos + "\\" + texCount + ".ytd";
                string targetYtdFile = "p_" + prefix + "_diff_" + pos.ToString().PadLeft(3, '0') + "_" + c + ".ytd";
                string targetYtdPath = opts.OutputDirectory + "\\stream\\" + targetFileName + "_p" + "^" + targetYtdFile;

                File.Copy(sourceYtdPath, targetYtdPath, true);

                texCount++;
            }
        }
Beispiel #2
0
        public static void GenPedDefs_CreateComponentFiles(GenPedDefsOptions opts, string targetDirName, KeyValuePair <string, Tuple <string, int, int, int, string, string> > entry, int textureCount)
        {
            string sourceYddFile = entry.Key;
            string sourceYldFile = sourceYddFile.Replace(".ydd", ".yld");
            string prefix        = entry.Value.Item1;
            int    origPos       = entry.Value.Item2;
            int    pos           = entry.Value.Item3;
            int    count         = entry.Value.Item4;
            string folder        = entry.Value.Item5;
            string yddFileName   = entry.Value.Item6;
            string directory     = opts.OutputDirectory + "\\x64\\models\\cdimages\\streamedpeds_mp.rpf\\" + targetDirName;

            Directory.CreateDirectory(directory);

            string targetYddFile = directory + "\\" + yddFileName;

            File.Copy(sourceYddFile, targetYddFile, true);

            if (File.Exists(sourceYldFile))
            {
                string targetYldFile = targetYddFile.Replace(".ydd", ".yld");
                File.Copy(sourceYldFile, targetYldFile, true);
            }

            int texCount = 0;

            for (int k = pos; k < textureCount + pos; k++)
            {
                char c = 'a';

                for (int l = 0; l < texCount; l++)
                {
                    c++;
                }

                string sourceYtdPath = folder + "\\" + origPos + "\\" + texCount + ".ytd";
                string targetYtdFile = prefix + "_diff_" + pos.ToString().PadLeft(3, '0') + "_" + c + "_uni.ytd";
                string targetYtdPath = directory + "\\" + targetYtdFile;

                File.Copy(sourceYtdPath, targetYtdPath, true);

                texCount++;
            }
        }