Example #1
0
        public static void CreateVisualPartVirtualitemData(StreamWriter vltedw, string partName, string shortDesc, Construct struc, int i)
        {
            string longDesc     = "GM_CATALOG_00000000"; //forall
            string type         = "visualpart";          //forall
            string brand        = struc.brand;           //depends on struc
            int    resellPrice  = 0;                     //forall
            int    tier         = 0;                     //forall
            string warnOnDelete = "False";               //forall

            int catalogMultiplier = -1;                  //struc depend

            if (struc is HoodCF)
            {
                catalogMultiplier = 0;   //struc depend
            }
            string index = i.ToString(); //dependant on loop counter

            if (i < 10)
            {
                index = "0" + index;
            }


            //individual car
            string partName = car + struc.firstPartName + index + struc.secondPartName; //depends on global/private
            //spoiler global/cf
            string partName = struc.firstPartName + index + AllCars.sizes[j] + struc.secondPartName;
            //global neon/plate
            string partName = struc.firstPartName + "STYLE" + index + struc.secondPartName;

            //individual car
            string shortDesc = "GM_CATALOG_0000" + carcatalog; //depends on global/private/spoiler
            //spoiler global/cf
            string shortDesc = "GM_CATALOG_0000" + AllCars.sizeCatalog[j];
            //global neon/plate
            string shortDesc = "GM_CATALOG_0000" + "49F3";



            uint   partHash = Hashing.BinHash(partName);                             //same
            string nodeName = GetVltNodeHash(partName);                              //same
            string icon     = struc.icon;                                            //struc
            string subtype  = struc.subtype;                                         //struc
            string title    = "GM_CATALOG_" + struc.catalogs[i + catalogMultiplier]; //struc


            //same for everything
            vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type);

            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand");
            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice");
            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier");
            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete");

            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand);
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString());
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString());
            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete);
            //same for everything
        }
Example #2
0
        public static void CreateNVisualPartVirtualItem(Construct struc, string car, string carcatalog, string filesPath, bool more, bool all)
        {
            if (struc.global == false)
            {
                uint carID = Hashing.BinHash(car);

                string longDesc     = "GM_CATALOG_00000000"; //forall
                string type         = "visualpart";          //forall
                string brand        = "visual_brand_nfs";    //depends on struc
                int    resellPrice  = 0;                     //forall
                int    tier         = 0;                     //forall
                string warnOnDelete = "False";               //forall

                int catalogMultiplier = -1;                  //struc depend
                if (struc is HoodCF)
                {
                    catalogMultiplier = 0;                          //struc depend
                }
                int counter = more ? struc.newUpper : struc.upper;  //struc and outer dependant

                int lowCount = all ? struc.lower : struc.upper + 1; //struc and outer dependant

                for (int i = lowCount; i < counter + 1; i++)        //go through every part in Struc
                {
                    string index = i.ToString();                    //dependant on loop counter
                    if (i < 10)
                    {
                        index = "0" + index;
                    }

                    string partName = car + struc.firstPartName + index + struc.secondPartName; //depends on global/private
                    uint   partHash = Hashing.BinHash(partName);                                //same
                    string nodeName = GetVltNodeHash(partName);                                 //same
                    string icon     = struc.icon;                                               //struc
                    string subtype  = struc.subtype;                                            //struc
                    string title    = "GM_CATALOG_000" + struc.catalogs[i + catalogMultiplier]; //depends idk

                    string shortDesc = "GM_CATALOG_0000" + carcatalog;                          //depends on global/private/spoiler


                    StreamWriter vltedw = new StreamWriter(filesPath, true);

                    //same for everything
                    vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type);

                    vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand");
                    vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice");
                    vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier");
                    vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete");

                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand);
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString());
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString());
                    vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete);
                    //same for everything

                    //different
                    vltedw.WriteLine(vltedCommands[1] + " visualpart " + nodeName);
                    vltedw.WriteLine(vltedCommands[2] + " visualpart " + nodeName + " baseCarHashes 1");
                    vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " visualPartHash " + partHash);
                    vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " baseCarHashes[0] " + carID);
                    //different
                    vltedw.Dispose();


                    //optional
                    // StreamWriter sw = File.AppendText("./hashes/" + car + ".txt");
                    // // if(i == struc.lower) sw.WriteLine("//vanilla");
                    // // else if (i == struc.upper + 1) sw.WriteLine("\n//addon");
                    // sw.WriteLine(partName + "\t" + partHash);

                    // sw.Dispose();
                }
            }
            else
            {
                if (struc is SpoilerGlobal || struc is SpoilerGlobalCF)
                {
                    //NEED 3 ARRAYS OF HATCH, LARGE AND SMALL
                    string longDesc          = "GM_CATALOG_00000000";
                    string type              = "visualpart";
                    string brand             = "visual_brand_nfs";
                    int    resellPrice       = 0;
                    int    tier              = 0;
                    string warnOnDelete      = "False";
                    int    catalogMultiplier = -1;

                    int counter = more ? struc.newUpper : struc.upper;

                    int lowCount = all ? struc.lower : struc.upper + 1;

                    for (int j = 0; j < AllCars.sizes.Length; j++)
                    {
                        for (int i = lowCount; i < counter + 1; i++)
                        {
                            string index = i.ToString();
                            if (i < 10)
                            {
                                index = "0" + index;
                            }

                            string partName = struc.firstPartName + index + AllCars.sizes[j] + struc.secondPartName;
                            uint   partHash = Hashing.BinHash(partName);
                            string nodeName = GetVltNodeHash(partName);
                            string icon     = struc.icon;
                            string subtype  = struc.subtype;
                            string title    = "GM_CATALOG_" + struc.catalogs[i + catalogMultiplier];

                            string shortDesc = "GM_CATALOG_0000" + AllCars.sizeCatalog[j];


                            StreamWriter vltedw = new StreamWriter(filesPath, true);
                            vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type);

                            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand");
                            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice");
                            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier");
                            vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete");

                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand);
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString());
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString());
                            vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete);



                            vltedw.WriteLine(vltedCommands[1] + " visualpart " + nodeName);

                            vltedw.WriteLine(vltedCommands[2] + " visualpart " + nodeName + " baseCarHashes " + AllCars.sizeArraysNew[j].Length.ToString());
                            if (i <= struc.upper)
                            {
                                vltedw.WriteLine(vltedCommands[3] + " visualpart " + nodeName + " baseCarHashes 0");
                                vltedw.WriteLine(vltedCommands[3] + " visualpart " + nodeName + " baseCarHashes " + AllCars.sizeArraysNew[j].Length.ToString());
                            }

                            vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " visualPartHash " + partHash);
                            for (int k = 0; k < AllCars.sizeArraysNew[j].Length; k++)
                            {
                                vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " baseCarHashes[" + k.ToString() + "] " + AllCars.sizeArraysNew[j][k]);
                            }


                            vltedw.Dispose();

                            // StreamWriter sw = File.AppendText("./hashes/" + "SPOILER" + AllCars.sizes[j] + ".txt");

                            // sw.WriteLine(partName + "\t" + partHash);

                            // sw.Dispose();
                        }
                    }
                }
                else if (struc is Neon || struc is LicensePlate)
                {
                    string longDesc          = "GM_CATALOG_00000000";
                    string type              = "visualpart";
                    string brand             = (struc is Neon) ? "visual_brand_lumox" : "visual_brand_nfs";
                    int    resellPrice       = 0;
                    int    tier              = 0;
                    string warnOnDelete      = "False";
                    int    catalogMultiplier = 0;

                    int counter = more ? struc.newUpper : struc.upper;

                    int lowCount = all ? struc.lower : struc.upper + 1;

                    for (int i = lowCount; i < counter + 1; i++)
                    {
                        string index = i.ToString();
                        if (i < 10)
                        {
                            index = "0" + index;
                        }

                        string partName = struc.firstPartName + "STYLE" + index + struc.secondPartName;
                        uint   partHash = Hashing.BinHash(partName);
                        string nodeName = GetVltNodeHash(partName);
                        string icon     = struc.icon;
                        string subtype  = struc.subtype;
                        string title    = "GM_CATALOG_" + struc.catalogs[i + catalogMultiplier];

                        string shortDesc = "GM_CATALOG_000049F3";

                        StreamWriter vltedw = new StreamWriter(filesPath, true);
                        vltedw.WriteLine(vltedCommands[1] + " virtualitem " + nodeName);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " title " + title);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " hash " + partHash);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " icon " + struc.icon);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " itemName " + partName);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " longdescription " + longDesc);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " shortdescription " + shortDesc);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " subType " + struc.subtype);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " type " + type);

                        vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " brand");
                        vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " resellprice");
                        vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " tier");
                        vltedw.WriteLine(vltedCommands[2] + " virtualitem " + nodeName + " warnondelete");

                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " brand " + brand);
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " resellprice " + resellPrice.ToString());
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " tier " + tier.ToString());
                        vltedw.WriteLine(vltedCommands[0] + " virtualitem " + nodeName + " warnondelete " + warnOnDelete);



                        vltedw.WriteLine(vltedCommands[1] + " visualpart " + nodeName);
                        vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " visualPartHash " + partHash);

                        vltedw.WriteLine(vltedCommands[2] + " visualpart " + nodeName + " baseCarHashes " + AllCars.everyCarHash.Length.ToString());

                        for (int k = 0; k < AllCars.everyCarHash.Length; k++)
                        {
                            vltedw.WriteLine(vltedCommands[0] + " visualpart " + nodeName + " baseCarHashes[" + k.ToString() + "] " + AllCars.everyCarHash[k]);
                        }


                        vltedw.Dispose();
                    }
                }
            }
        }