예제 #1
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            byte[] idbfile = new byte[1];
            eList = new EffectList();
            aList = new ActivationList();

            //640
            //load talisman
            OpenFileDialog browseFile = new OpenFileDialog();
            browseFile.Filter = "Xenoverse idb (*.idb)|*.idb";
            browseFile.Title = "Browse for  idb File";
            if (browseFile.ShowDialog() == DialogResult.Cancel)
                return;

            int count = 0;
               // if (browseFile.FileName.Contains("tal"))
            //{
                FileName = browseFile.FileName;
                //MessageBox.Show(FileName);
                idbfile = File.ReadAllBytes(FileName);
                count = BitConverter.ToInt32(idbfile, 8);
            //}

            if (chkMsgName.Checked)
            {
                //load msgfile for names
                browseFile = new OpenFileDialog();
                browseFile.Filter = "Xenoverse msg (*.msg)|*.msg";
                browseFile.Title = "Browse for msg name File";
                if (!(browseFile.ShowDialog() == DialogResult.Cancel))
                    NamesLoaded = true;

                if (browseFile.FileName.Contains("name") && NamesLoaded)
                {
                    FileNameMsgN = browseFile.FileName;
                    Names = msgStream.Load(FileNameMsgN);
                }
            }

            if (chkMsgDesc.Checked)
            {
                //load msgfile for names
                browseFile = new OpenFileDialog();
                browseFile.Filter = "Xenoverse msg (*.msg)|*.msg";
                browseFile.Title = "Browse for msg info File";
                if (!(browseFile.ShowDialog() == DialogResult.Cancel))
                    DescsLoaded = true;

                if (browseFile.FileName.Contains("info") && DescsLoaded)
                {
                    FileNameMsgD = browseFile.FileName;
                    Descs = msgStream.Load(FileNameMsgD);
                }
            }

            //idbItems set
            Items = new idbItem[count];
            for (int i = 0; i < Items.Length; i++)
            {
                Items[i].Data = new byte[640];
                Array.Copy(idbfile, 16 + (i * 640), Items[i].Data, 0, 640);
                if (NamesLoaded)
                    Items[i].msgIndexName = FindmsgIndex(ref Names, BitConverter.ToInt16(Items[i].Data, 4));
                if (DescsLoaded)
                    Items[i].msgIndexDesc = FindmsgIndex(ref Descs, BitConverter.ToInt16(Items[i].Data, 6));
            }

            itemList.Items.Clear();
            for (int i = 0; i < count; i++)
            {
                if (NamesLoaded)
                    itemList.Items.Add(BitConverter.ToInt16(Items[i].Data, 0).ToString() + " / " + String.Format("{0:X}", BitConverter.ToInt16(Items[i].Data, 0)) + "-" + Names.data[Items[i].msgIndexName].Lines[0]);
                else
                    itemList.Items.Add(BitConverter.ToInt16(Items[i].Data, 0).ToString() + " / " + String.Format("{0:X}", BitConverter.ToInt16(Items[i].Data, 0)));
            }
            EffectData();
            itemList.SelectedIndex = 0;
        }
예제 #2
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            byte[] idbfile = new byte[1];
            eList = new EffectList();
            aList = new ActivationList();


            //640
            //load talisman
            OpenFileDialog browseFile = new OpenFileDialog();

            browseFile.Filter = "Xenoverse idb (*.idb)|*.idb";
            browseFile.Title  = "Browse for  idb File";
            if (browseFile.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            int count = 0;

            // if (browseFile.FileName.Contains("tal"))
            //{
            FileName = browseFile.FileName;
            //MessageBox.Show(FileName);
            idbfile = File.ReadAllBytes(FileName);
            count   = BitConverter.ToInt32(idbfile, 8);
            //}

            if (chkMsgName.Checked)
            {
                //load msgfile for names
                browseFile        = new OpenFileDialog();
                browseFile.Filter = "Xenoverse msg (*.msg)|*.msg";
                browseFile.Title  = "Browse for msg name File";
                if (!(browseFile.ShowDialog() == DialogResult.Cancel))
                {
                    NamesLoaded = true;
                }


                if (browseFile.FileName.Contains("name") && NamesLoaded)
                {
                    FileNameMsgN = browseFile.FileName;
                    Names        = msgStream.Load(FileNameMsgN);
                }
            }

            if (chkMsgDesc.Checked)
            {
                //load msgfile for names
                browseFile        = new OpenFileDialog();
                browseFile.Filter = "Xenoverse msg (*.msg)|*.msg";
                browseFile.Title  = "Browse for msg info File";
                if (!(browseFile.ShowDialog() == DialogResult.Cancel))
                {
                    DescsLoaded = true;
                }


                if (browseFile.FileName.Contains("info") && DescsLoaded)
                {
                    FileNameMsgD = browseFile.FileName;
                    Descs        = msgStream.Load(FileNameMsgD);
                }
            }

            //idbItems set
            Items = new idbItem[count];
            for (int i = 0; i < Items.Length; i++)
            {
                Items[i].Data = new byte[640];
                Array.Copy(idbfile, 16 + (i * 640), Items[i].Data, 0, 640);
                if (NamesLoaded)
                {
                    Items[i].msgIndexName = FindmsgIndex(ref Names, BitConverter.ToInt16(Items[i].Data, 4));
                }
                if (DescsLoaded)
                {
                    Items[i].msgIndexDesc = FindmsgIndex(ref Descs, BitConverter.ToInt16(Items[i].Data, 6));
                }
            }



            itemList.Items.Clear();
            for (int i = 0; i < count; i++)
            {
                if (NamesLoaded)
                {
                    itemList.Items.Add(BitConverter.ToInt16(Items[i].Data, 0).ToString() + " / " + String.Format("{0:X}", BitConverter.ToInt16(Items[i].Data, 0)) + "-" + Names.data[Items[i].msgIndexName].Lines[0]);
                }
                else
                {
                    itemList.Items.Add(BitConverter.ToInt16(Items[i].Data, 0).ToString() + " / " + String.Format("{0:X}", BitConverter.ToInt16(Items[i].Data, 0)));
                }
            }
            EffectData();
            itemList.SelectedIndex = 0;
        }