Exemplo n.º 1
0
        public static void Initialize()
        {
            _entries = new Hashtable();

            string filePath = Files.GetFilePath("body.def");

            if (filePath == null)
            {
                return;
            }

            using (var def = new StreamReader(filePath))
            {
                string line;

                while ((line = def.ReadLine()) != null)
                {
                    if ((line = line.Trim()).Length == 0 || line.StartsWith("#"))
                    {
                        continue;
                    }

                    try
                    {
                        int index1 = line.IndexOf("{", StringComparison.Ordinal);
                        int index2 = line.IndexOf("}", StringComparison.Ordinal);

                        string param1 = line.Substring(0, index1);
                        string param2 = line.Substring(index1 + 1, index2 - index1 - 1);
                        string param3 = line.Substring(index2 + 1);

                        int indexOf = param2.IndexOf(',');

                        if (indexOf > -1)
                        {
                            param2 = param2.Substring(0, indexOf).Trim();
                        }

                        int iParam1 = Convert.ToInt32(param1.Trim());
                        int iParam2 = Convert.ToInt32(param2.Trim());
                        int iParam3 = Convert.ToInt32(param3.Trim());

                        _entries[iParam1] = new BodyTableEntry(iParam2, iParam1, iParam3);
                    }
                    catch
                    {
                        // TODO: ignored?
                        // ignored
                    }
                }
            }
        }
Exemplo n.º 2
0
        static BodyTable()
        {
            m_Entries = new Dictionary <int, BodyTableEntry>();

            string filePath = Client.GetFilePath("body.def");

            if (filePath == null)
            {
                return;
            }

            StreamReader def = new StreamReader(filePath);

            string line;

            while ((line = def.ReadLine()) != null)
            {
                if ((line = line.Trim()).Length == 0 || line.StartsWith("#"))
                {
                    continue;
                }

                try
                {
                    int index1 = line.IndexOf(" {");
                    int index2 = line.IndexOf("} ");

                    string param1 = line.Substring(0, index1);
                    string param2 = line.Substring(index1 + 2, index2 - index1 - 2);
                    string param3 = line.Substring(index2 + 2);

                    int indexOf = param2.IndexOf(',');

                    if (indexOf > -1)
                    {
                        param2 = param2.Substring(0, indexOf).Trim();
                    }

                    int iParam1 = Convert.ToInt32(param1);
                    int iParam2 = Convert.ToInt32(param2);
                    int iParam3 = Convert.ToInt32(param3);

                    m_Entries[iParam1] = new BodyTableEntry(iParam2, iParam1, iParam3);
                }
                catch
                {
                }
            }
        }
Exemplo n.º 3
0
        private static void LoadTable()
        {
            int length = 400 + ((int)Animations.m_FileIndex.Index.Length - 35000) / 175;

            Animations.m_Table = new int[length];
            for (int i = 0; i < length; i++)
            {
                object item = BodyTable.m_Entries[i];
                if (item == null || BodyConverter.Contains(i))
                {
                    Animations.m_Table[i] = i;
                }
                else
                {
                    BodyTableEntry bodyTableEntry = (BodyTableEntry)item;
                    Animations.m_Table[i] = bodyTableEntry.m_OldID | -2147483648 | ((bodyTableEntry.m_NewHue ^ 32768) & 65535) << 15;
                }
            }
        }
Exemplo n.º 4
0
        private static void LoadTable()
        {
            int length = 400 + (Animations.m_FileIndex.Index.Length - 35000) / 175;

            Animations.m_Table = new int[length];
            for (int body = 0; body < length; ++body)
            {
                object obj = BodyTable.m_Entries[(object)body];
                if (obj == null || BodyConverter.Contains(body))
                {
                    Animations.m_Table[body] = body;
                }
                else
                {
                    BodyTableEntry bodyTableEntry = (BodyTableEntry)obj;
                    Animations.m_Table[body] = bodyTableEntry.m_OldID | int.MinValue | ((bodyTableEntry.m_NewHue ^ 32768) & (int)ushort.MaxValue) << 15;
                }
            }
        }
Exemplo n.º 5
0
        private static void LoadTable()
        {
            int count = 400 + ((m_FileIndex.Index.Length - 35000) / 175);

            m_Table = new int[count];

            for (int i = 0; i < count; ++i)
            {
                object o = BodyTable.m_Entries[i];

                if (o == null || BodyConverter.Contains(i))
                {
                    m_Table[i] = i;
                }
                else
                {
                    BodyTableEntry bte = (BodyTableEntry)o;

                    m_Table[i] = bte.OldID | (1 << 31) | ((bte.NewHue & 0xFFFF) << 15);
                }
            }
        }
Exemplo n.º 6
0
		public static void Initialize()
		{
			m_Entries = new Hashtable();

			string filePath = Files.GetFilePath("body.def");

			if (filePath == null)
			{
				return;
			}

			using (var def = new StreamReader(filePath))
			{
				string line;

				while ((line = def.ReadLine()) != null)
				{
					if ((line = line.Trim()).Length == 0 || line.StartsWith("#"))
					{
						continue;
					}

					try
					{
						int index1 = line.IndexOf("{");
						int index2 = line.IndexOf("}");

						string param1 = line.Substring(0, index1);
						string param2 = line.Substring(index1 + 1, index2 - index1 - 1);
						string param3 = line.Substring(index2 + 1);

						int indexOf = param2.IndexOf(',');

						if (indexOf > -1)
						{
							param2 = param2.Substring(0, indexOf).Trim();
						}

						int iParam1 = Convert.ToInt32(param1.Trim());
						int iParam2 = Convert.ToInt32(param2.Trim());
						int iParam3 = Convert.ToInt32(param3.Trim());

						m_Entries[iParam1] = new BodyTableEntry(iParam2, iParam1, iParam3);
					}
					catch
					{ }
				}
			}
		}
Exemplo n.º 7
0
        static BodyTable()
        {
            m_Entries = new Hashtable();

            string filePath = Client.GetFilePath( "body.def" );

            if ( filePath == null )
                return;

            StreamReader def = new StreamReader( filePath );

            string line;

            while ( (line = def.ReadLine()) != null )
            {
                if ( (line=line.Trim()).Length == 0 || line.StartsWith("#") )
                    continue;

                try
                {
                    int index1 = line.IndexOf( " {" );
                    int index2 = line.IndexOf( "} " );

                    string param1 = line.Substring( 0, index1 );
                    string param2 = line.Substring( index1 + 2, index2 - index1 - 2 );
                    string param3 = line.Substring( index2 + 2 );

                    int indexOf = param2.IndexOf( ',' );

                    if ( indexOf > -1 )
                        param2 = param2.Substring( 0, indexOf ).Trim();

                    int iParam1 = Convert.ToInt32( param1 );
                    int iParam2 = Convert.ToInt32( param2 );
                    int iParam3 = Convert.ToInt32( param3 );

                    m_Entries[iParam1] = new BodyTableEntry( iParam2, iParam1, iParam3 );
                }
                catch
                {
                }
            }
        }