Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        public static int? GetValue(PCCPackage p, int index)
        {
            Objectselect prompt = new Objectselect();
            prompt.Init(p, index);

            return prompt.ShowDialog() == DialogResult.OK ? prompt.returnValue() : null;
        }
Ejemplo n.º 2
0
        public static int?GetValue(PCCPackage p, int index)
        {
            Objectselect prompt = new Objectselect();

            prompt.Init(p, index);

            return(prompt.ShowDialog() == DialogResult.OK ? prompt.returnValue() : null);
        }
Ejemplo n.º 3
0
 private void treeView2_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     TreeNode t = treeView2.SelectedNode;
     int n = listBox2.SelectedIndex;
     if (t == null || n == -1 || isSelectOpen)
         return;
     PCCPackage.ImportEntry imp;
     switch (t.Index)
     {
         case 4://Link
             isSelectOpen = true;
             Objectselect osel = new Objectselect();
             osel.Init(pcc, pcc.Exports[n].idxLink);
             osel.Show();
             while (!osel.PressedOK && !osel.Aborted) Application.DoEvents();
             isSelectOpen = false;
             if (osel.Aborted)
                 return;
             osel.Close();
             imp = pcc.Imports[n];
             imp.idxLink = osel.Result;
             pcc.Imports[n] = imp;
             RefreshAll();
             break;
         case 0://Package
         case 2://Class
         case 5://Name
             isSelectOpen = true;
             Nameselect nsel = new Nameselect();
             if (t.Index == 0)
                 nsel.Init(pcc, pcc.Imports[n].idxPackage);
             if (t.Index == 2)
                 nsel.Init(pcc, pcc.Imports[n].idxClass);
             if (t.Index == 5)
                 nsel.Init(pcc, pcc.Imports[n].idxName);
             nsel.Show();
             while (nsel.Result == -1 && !nsel.IsDisposed) Application.DoEvents();
             isSelectOpen = false;
             if (nsel.Result != -2 && nsel.Result != -1)
             {
                 imp = pcc.Imports[n];
                 if (t.Index == 0)
                     imp.idxPackage = nsel.Result;
                 if (t.Index == 2)
                     imp.idxClass = nsel.Result;
                 if (t.Index == 5)
                     imp.idxName = nsel.Result;
                 pcc.Imports[n] = imp;
                 RefreshAll();
             }
             nsel.Close();
             break;
         default:
             break;
     }
 }
Ejemplo n.º 4
0
 private void treeView3_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     TreeNode t = treeView3.SelectedNode;
     int n = listBox3.SelectedIndex;
     if (t == null || n == -1 || isSelectOpen)
         return;
     PCCPackage.ExportEntry ex;
     string result;
     switch (t.Index)
     {
         case 0://Class
         case 1://Parent
         case 2://Link
         case 5://Archetype
             isSelectOpen = true;
             Objectselect osel = new Objectselect();
             if (t.Index == 0)
                 osel.Init(pcc, pcc.Exports[n].idxClass);
             if (t.Index == 1)
                 osel.Init(pcc, pcc.Exports[n].idxParent);
             if (t.Index == 2)
                 osel.Init(pcc, pcc.Exports[n].idxLink);
             if (t.Index == 5)
                 osel.Init(pcc, pcc.Exports[n].idxArchetype);
             osel.Show();
             while (!osel.PressedOK && !osel.Aborted) Application.DoEvents();
             isSelectOpen = false;
             if (osel.Aborted)
                 return;
             osel.Close();
             ex = pcc.Exports[n];
             if(t.Index == 0)
                 ex.idxClass = osel.Result;
             if (t.Index == 1)
                 ex.idxParent = osel.Result;
             if (t.Index == 2)
                 ex.idxLink = osel.Result;
             if (t.Index == 5)
                 ex.idxArchetype = osel.Result;
             pcc.Exports[n] = ex;
             RefreshAll();
             break;
         case 3://Name
             isSelectOpen = true;
             Nameselect nsel = new Nameselect();
             nsel.Init(pcc, pcc.Exports[n].idxName);
             nsel.Show();
             while (nsel.Result == -1 && !nsel.IsDisposed) Application.DoEvents();
             isSelectOpen = false;
             if (nsel.Result != -2 && nsel.Result != -1)
             {
                 ex = pcc.Exports[n];
                 ex.idxName = nsel.Result;
                 pcc.Exports[n] = ex;
                 RefreshAll();
             }
             nsel.Close();
             break;
         case 4://Index
             ex = pcc.Exports[n];
             result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new value", "ME3Explorer", ex.Index.ToString(), 0, 0);
             if (result != "")
             {
                 int i = 0;
                 if (Int32.TryParse(result, out i))
                 {
                     ex.Index = i;
                     pcc.Exports[n] = ex;
                     RefreshAll();
                 }
             }
             break;
         case 7://Flags
             ex = pcc.Exports[n];
             result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new hex value", "ME3Explorer", ex.ObjectFlags.ToString("X8"), 0, 0);
             if (result != "")
             {
                 int i = 0;
                 if (Int32.TryParse(result, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.CurrentCulture, out i))
                 {
                     ex.ObjectFlags = i;
                     pcc.Exports[n] = ex;
                     RefreshAll();
                 }
             }
             break;
         default:
             break;
     }
 }