コード例 #1
0
        private void listBox2_DoubleClick(object sender, EventArgs e)
        {
            int n;

            if (pcc == null || Dialog == null || (n = listBox2.SelectedIndex) == -1)
            {
                return;
            }
            string result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new name entry", "ME1Explorer", Dialog.SpeakerList[n].SpeakerTag.ToString(), 0, 0);

            if (result == "")
            {
                return;
            }
            int i = 0;

            if (int.TryParse(result, out i) && pcc.isName(i))
            {
                BioConversation.SpeakerListStruct sp = new BioConversation.SpeakerListStruct();
                sp.SpeakerTag         = i;
                sp.Text               = pcc.getNameEntry(i);
                Dialog.SpeakerList[n] = sp;
            }
            RefreshTabs();
        }
コード例 #2
0
        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            int i = 0;

            if (Int32.TryParse(textBox3.Text, out i))
            {
                label5.Text = "Preview: " + pcc.getNameEntry(i);
            }
            else
            {
                label5.Text = "Preview: fail";
            }
        }
コード例 #3
0
ファイル: PCCEditor.cs プロジェクト: solarisstar/ME3Explorer
        public void loadPCC()
        {
            CurrentView = 2;
            classes     = new List <int>();
            foreach (PCCObject.ExportEntry ent in pcc.Exports)
            {
                int f = -1;
                for (int i = 0; i < classes.Count(); i++)
                {
                    if (classes[i] == ent.ClassNameID)
                    {
                        f = i;
                    }
                }
                if (f == -1)
                {
                    classes.Add(ent.ClassNameID);
                }
            }
            bool run = true;

            while (run)
            {
                run = false;
                for (int i = 0; i < classes.Count() - 1; i++)
                {
                    if (pcc.getNameEntry(classes[i]).CompareTo(pcc.getNameEntry(classes[i + 1])) > 0)
                    {
                        int t = classes[i];
                        classes[i]     = classes[i + 1];
                        classes[i + 1] = t;
                        run            = true;
                    }
                }
            }
            RefreshView();
            status2.Text = "@" + Path.GetFileName(Path.GetFileName(pcc.fullname));
        }
コード例 #4
0
        private void addObjectsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CurrentObjects == null)
            {
                return;
            }
            string result = Microsoft.VisualBasic.Interaction.InputBox("Please enter object index", "ME1Explorer");

            if (result == "")
            {
                return;
            }
            int i;

            if (int.TryParse(result, out i))
            {
                if (i < pcc.Exports.Count)
                {
                    if (!CurrentObjects.Contains(i))
                    {
                        byte[]      buff     = pcc.Exports[SequenceIndex].Data;
                        List <byte> ListBuff = new List <byte>(buff);
                        BitConverter.IsLittleEndian = true;
                        List <PropertyReader.Property> p = PropertyReader.getPropList(pcc, buff);
                        for (int j = 0; j < p.Count(); j++)
                        {
                            if (pcc.getNameEntry(p[j].Name) == "SequenceObjects")
                            {
                                int    count     = BitConverter.ToInt32(p[j].raw, 24);
                                byte[] sizebuff  = BitConverter.GetBytes(BitConverter.ToInt32(p[j].raw, 16) + 4);
                                byte[] countbuff = BitConverter.GetBytes(count + 1);
                                for (int k = 0; k < 4; k++)
                                {
                                    ListBuff[p[j].offsetval - 8 + k] = sizebuff[k];
                                    ListBuff[p[j].offsetval + k]     = countbuff[k];
                                }
                                ListBuff.InsertRange(p[j].offsetval + 4 + count * 4, BitConverter.GetBytes(i + 1));
                                pcc.Exports[SequenceIndex].Data = ListBuff.ToArray();
                                SaveData s = new SaveData();
                                s.index = i;
                                s.X     = graphEditor.Camera.Bounds.X + graphEditor.Camera.Bounds.Width / 2;
                                s.Y     = graphEditor.Camera.Bounds.Y + graphEditor.Camera.Bounds.Height / 2;
                                List <SaveData> list = new List <SaveData>();
                                list.Add(s);
                                saveView(false, list);
                                LoadSequence(SequenceIndex, false);
                                break;
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show(i + " is already in the sequence.");
                    }
                }
                else
                {
                    MessageBox.Show(i + " is not in the export list.");
                }
            }
            else
            {
                MessageBox.Show(result + " is not an integer.");
            }
        }