Esempio n. 1
0
        public void Load(string fname)
        {
            entries.Clear();
            langs.Clear();
            RZDBReader br        = new RZDBReader(File.OpenRead(fname));
            int        langCount = br.ReadSize();

            for (int i = 0; i < langCount; ++i)
            {
                AddLanguage(br.ReadString());
            }
            int messageCount = br.ReadSize();

            for (int i = 0; i < messageCount; ++i)
            {
                AddMessageEntry(br.ReadString());
            }
            for (int i = 0; i < langCount; ++i)
            {
                for (int j = 0; j < messageCount; ++j)
                {
                    messages[langs[i]][entries[j]] = br.ReadString();
                }
            }
            br.Close();
        }
 private void LoadFromFile(string fname)
 {
     try
     {
         textBoxFile.Text = fname;
         RZDBReader br = new RZDBReader(File.OpenRead(fname));
         entityCount = br.ReadSize();
         for (int i = 0; i < entityCount; ++i)
         {
             entityData[i] = new GameEntityData(br);
         }
         statTableSize = br.ReadSize();
         for (int i = 0; i < statTableSize; ++i)
         {
             statData[i] = new BaseStatData(br);
         }
         br.Close();
         comboBoxObj.SelectedIndex = 0;
     }
     catch (Exception)
     {
         MessageBox.Show("Invalid file.");
     }
 }