Exemplo n.º 1
0
        /// <summary>
        /// Loads all labels from a language file and hashes them.
        /// </summary>
        /// <param name="file">Language label file path.</param>
        /// <param name="game"><see cref="GameINT"/> of the file.</param>
        public static void LoadLangLabels(string file, GameINT game)
        {
            var      options = new Options(file);
            FileBase db      = game switch
            {
                GameINT.Carbon => new Support.Carbon.Datamap(),
                GameINT.MostWanted => new Support.MostWanted.Datamap(),
                GameINT.Underground2 => new Support.Underground2.Datamap(),
                GameINT.Prostreet => new Support.Prostreet.Datamap(),
                _ => null
            };

            if (db == null)
            {
                return;
            }
            db.Load(options);

            foreach (STRBlock str in db.GetManager("STRBlocks"))
            {
                foreach (var record in str.GetRecords())
                {
                    record.Text.BinHash();
                }
            }
        }
    }
Exemplo n.º 2
0
 public static BaseStream GetStreamer(GameINT game, string lxry, string streamlxry)
 {
     return(game switch
     {
         GameINT.Carbon => new CarbonStream(lxry, streamlxry),
         GameINT.MostWanted => new MostWantedStream(lxry, streamlxry),
         GameINT.Underground2 => new Underground2Stream(lxry, streamlxry),
         _ => throw new InvalidGameException(game),
     });
Exemplo n.º 3
0
 public static BaseProfile NewProfile(GameINT game, string directory)
 {
     return(game switch
     {
         GameINT.Carbon => new CarbonProfile(directory),
         GameINT.MostWanted => new MostWantedProfile(directory),
         GameINT.Prostreet => new ProstreetProfile(directory),
         GameINT.Undercover => new UndercoverProfile(directory),
         GameINT.Underground1 => new Underground1Profile(directory),
         GameINT.Underground2 => new Underground2Profile(directory),
         _ => throw new InvalidGameException(game)
     });
        public SynchronizedDatabase(GameINT game, string folder, string file)
        {
            this.Database = game switch
            {
                GameINT.Carbon => new Nikki.Support.Carbon.Datamap(),
                GameINT.MostWanted => new Nikki.Support.MostWanted.Datamap(),
                GameINT.Prostreet => new Nikki.Support.Prostreet.Datamap(),
                GameINT.Undercover => new Nikki.Support.Undercover.Datamap(),
                GameINT.Underground1 => new Nikki.Support.Underground1.Datamap(),
                GameINT.Underground2 => new Nikki.Support.Underground2.Datamap(),
                _ => throw new ArgumentException(nameof(game)),
            };

            this.Folder   = folder;
            this.Filename = file.ToUpperInvariant();
        }
Exemplo n.º 5
0
 public SerializationHeader(int size, GameINT game, string name)
 {
     this.Size = size + 12;
     this.Game = game;
     this.Name = name;
 }
Exemplo n.º 6
0
        private void PopulateAttribTypesBasedOnGame(GameINT game)
        {
            // Since there is not easy type to just "GET" available attribute types,
            // we use what we have available in each module

            switch (game)
            {
            case GameINT.Carbon:
            case GameINT.Prostreet:
            case GameINT.Undercover:
                this.AttribTypeComboBox.Items.AddRange(new string[]
                {
                    Boolean,                             /// <see cref="Nikki.Support.Carbon.Attributes.BoolAttribute"/>
                                                         /// <see cref="Nikki.Support.Prostreet.Attributes.BoolAttribute"/>


                    Color,                               /// <see cref="Nikki.Support.Carbon.Attributes.ColorAttribute"/>
                                                         /// <see cref="Nikki.Support.Prostreet.Attributes.ColorAttribute"/>


                    Floating,                             /// <see cref="Nikki.Support.Carbon.Attributes.FloatAttribute"/>
                                                          /// <see cref="Nikki.Support.Prostreet.Attributes.FloatAttribute"/>


                    Integer,                             /// <see cref="Nikki.Support.Carbon.Attributes.IntAttribute"/>
                                                         /// <see cref="Nikki.Support.Prostreet.Attributes.IntAttribute"/>


                    Key,                             /// <see cref="Nikki.Support.Carbon.Attributes.KeyAttribute"/>
                                                     /// <see cref="Nikki.Support.Prostreet.Attributes.KeyAttribute"/>


                    ModelTable,                             /// <see cref="Nikki.Support.Carbon.Attributes.ModelTableAttribute"/>
                                                            /// <see cref="Nikki.Support.Prostreet.Attributes.ModelTableAttribute"/>


                    PartID,                             /// <see cref="Nikki.Support.Carbon.Attributes.PartIDAttribute"/>
                                                        /// <see cref="Nikki.Support.Prostreet.Attributes.PartIDAttribute"/>


                    String,                             /// <see cref="Nikki.Support.Carbon.Attributes.StringAttribute"/>
                                                        /// <see cref="Nikki.Support.Prostreet.Attributes.StringAttribute"/>


                    TwoString,                             /// <see cref="Nikki.Support.Carbon.Attributes.TwoStringAttribute"/>
                                                           /// <see cref="Nikki.Support.Prostreet.Attributes.TwoStringAttribute"/>
                });
                this.AttribTypeComboBox.SelectedIndex = 0;
                break;

            case GameINT.Underground1:
            case GameINT.Underground2:
            case GameINT.MostWanted:
                this.AttribTypeComboBox.Items.AddRange(new string[]
                {
                    Boolean,                             /// <see cref="Nikki.Support.MostWanted.Attributes.BoolAttribute"/>
                                                         /// <see cref="Nikki.Support.Underground2.Attributes.BoolAttribute"/>
                    /// <see cref="Nikki.Support.Underground1.Attributes.BoolAttribute"/>


                    Floating,                             /// <see cref="Nikki.Support.MostWanted.Attributes.FloatAttribute"/>
                                                          /// <see cref="Nikki.Support.Underground2.Attributes.FloatAttribute"/>
                    /// <see cref="Nikki.Support.Underground1.Attributes.FloatAttribute"/>


                    Integer,                             /// <see cref="Nikki.Support.MostWanted.Attributes.IntAttribute"/>
                                                         /// <see cref="Nikki.Support.Underground2.Attributes.IntAttribute"/>
                    /// <see cref="Nikki.Support.Underground1.Attributes.IntAttribute"/>


                    Key,                             /// <see cref="Nikki.Support.MostWanted.Attributes.KeyAttribute"/>
                                                     /// <see cref="Nikki.Support.Underground2.Attributes.KeyAttribute"/>
                    /// <see cref="Nikki.Support.Underground1.Attributes.KeyAttribute"/>


                    String,                             /// <see cref="Nikki.Support.MostWanted.Attributes.StringAttribute"/>
                                                        /// <see cref="Nikki.Support.Underground2.Attributes.StringAttribute"/>
                    /// <see cref="Nikki.Support.Underground1.Attributes.StringAttribute"/>
                });
                this.AttribTypeComboBox.SelectedIndex = 0;
                break;

            default:
                break;
            }
        }
Exemplo n.º 7
0
 public AttribCreator(GameINT game)
 {
     this.InitializeComponent();
     this.ToggleTheme();
     this.PopulateAttribTypesBasedOnGame(game);
 }
Exemplo n.º 8
0
 public InvalidGameException(GameINT game)
     : base($"Game {game} is not supported with this endscript")
 {
 }
Exemplo n.º 9
0
        /// <summary>
        /// Gets the default .tpk name by index passed.
        /// </summary>
        /// <param name="index">Index of the .tpk in the array.</param>
        /// <returns>Collection Name of the .tpk</returns>
        public static string GetTPKName(int index, GameINT game)
        {
            switch (game)
            {
            case GameINT.Carbon:
                switch (index)
                {
                case 0:
                    return("GLOBALMESSAGETEXTURES");

                case 1:
                    return("GLOBALTEXTURES");

                case 2:
                    return("FLARETEXTURES");

                case 3:
                    return("GLOBALTEXTURESPC");

                case 4:
                    return("EMITTER_SYSTEM_TEXTURE_PAGE");

                case 5:
                    return("EMITTER_SYSTEM_NORMALMAPS_P");

                case 6:
                    return("FLARE_TEXTURE_PAGE");

                default:
                    return(null);
                }


            case GameINT.MostWanted:
                switch (index)
                {
                case 0:
                    return("GLOBALMESSAGE");

                case 1:
                case 2:
                case 3:
                    return("GLOBAL");

                default:
                    return(null);
                }

            case GameINT.Underground2:
                switch (index)
                {
                case 0:
                    return("GLOBALMESSAGE");

                case 1:
                case 2:
                    return("GLOBAL");

                default:
                    return(null);
                }

            default:
                return(null);
            }
        }