Exemplo n.º 1
0
 private string a(UnknownDR A_0)
 {
     try
     {
         VLTClass dq   = A_0.dq1;
         string   text = HashTracker.getValueForHash(A_0.c1.hash);
         if (A_0.c1.ui3 == 0u)
         {
             return(text);
         }
         return(this.a(dq.dqb1.a(A_0.c1.ui3)) + "/" + text);
     }
     catch
     {
         return("");
     }
 }
Exemplo n.º 2
0
 private void j(object A_0, EventArgs A_1)
 {
     if (this.tv.SelectedNode != null)
     {
         TreeNode selectedNode = this.tv.SelectedNode;
         if (selectedNode.Tag is UnknownDE)
         {
             Clipboard.SetDataObject("Database");
         }
         else if (selectedNode.Tag is VLTClass)
         {
             VLTClass dq = selectedNode.Tag as VLTClass;
             Clipboard.SetDataObject(HashTracker.getValueForHash(dq.classHash));
         }
         else
         {
             UnknownDR dr = selectedNode.Tag as UnknownDR;
             Clipboard.SetDataObject(HashTracker.getValueForHash(dr.c1.hash));
         }
     }
 }
Exemplo n.º 3
0
        /*
         * private void e( object A_0, EventArgs A_1 )
         * {
         *      if( this.tvFields.SelectedNode != null )
         *      {
         *              TreeNode treeNode = this.tvFields.SelectedNode;
         *              if( treeNode.Parent != null )
         *              {
         *                      treeNode = treeNode.Parent;
         *              }
         *              VLTBaseType bb = treeNode.Tag as VLTBaseType;
         *              this.a( bb.dr1, bb.ui3 );
         *      }
         * }
         */

        // TODO: opt
        private void tv_AfterSelect(object A_0, TreeViewEventArgs A_1)
        {
            object tag = A_1.Node.Tag;

            if (tag is VLTClass)
            {
                this.classGrid.Visible = true;
                this.pnlData.Visible   = false;
                VLTClass  dq        = tag as VLTClass;
                DataSet   dataSet   = new DataSet("VLT");
                DataTable dataTable = dataSet.Tables.Add("Fields");
                dataTable.Columns.Add("Name", typeof(string));
                dataTable.Columns.Add("Type", typeof(string));
                dataTable.Columns.Add("Length", typeof(ushort));
                dataTable.Columns.Add("Count", typeof(short));

                foreach (VLTClass.aclz1 a in dq)
                {
                    DataRow dataRow = dataTable.NewRow();
                    dataRow[0] = HashTracker.getValueForHash(a.hash);
                    dataRow[1] = HashTracker.getValueForHash(a.ui2);
                    dataRow[2] = a.len;
                    dataRow[3] = a.count;
                    dataTable.Rows.Add(dataRow);
                }

                this.classGrid.DataSource = dataSet;
                this.classGrid.DataMember = "Fields";

                // This gets rid of the extra row in the table that appears when viewing a root node (e.x. junkman, pvehicle)
                CurrencyManager currencyManager = (CurrencyManager)this.BindingContext[dataSet, "Fields"];
                ((DataView)currencyManager.List).AllowNew    = false;
                ((DataView)currencyManager.List).AllowEdit   = false;
                ((DataView)currencyManager.List).AllowDelete = false;

                UnknownA8 a2 = dq.b01.a(VLTOtherValue.TABLE_END) as UnknownA8;
                this.classGrid.Update();
            }
            else if (tag is UnknownDR)
            {
                this.lblFieldType.Text   = "";
                this.lblFieldOffset.Text = "";
                this.dataGrid.DataSource = null;
                this.dataGrid.Update();
                this.classGrid.Visible = false;
                this.pnlData.Visible   = true;
                string   text     = "";
                string   text2    = "";
                TreeNode treeNode = null;
                if (this.tvFields.SelectedNode != null)
                {
                    if (this.tvFields.SelectedNode.Parent != null && this.tvFields.SelectedNode.Parent.Tag == null)
                    {
                        text  = this.tvFields.SelectedNode.Parent.Text;
                        text2 = this.tvFields.SelectedNode.Text;
                    }
                    else
                    {
                        text = this.tvFields.SelectedNode.Text;
                    }
                }
                UnknownDR dr  = tag as UnknownDR;
                VLTClass  dq2 = dr.dq1;
                this.tvFields.BeginUpdate();
                this.tvFields.Nodes.Clear();
                int num = 0;

                foreach (VLTClass.aclz1 a3 in dq2)
                {
                    VLTBaseType bb = dr.bba1[num++];
                    if (!a3.c() || dr.booa1[num - 1])
                    {
                        if (a3.isArray())
                        {
                            VLTArrayType m     = bb as VLTArrayType;
                            string       text3 = string.Concat(new object[]
                            {
                                HashTracker.getValueForHash(a3.hash),
                                " [",
                                m.getMaxEntryCount(),
                                "/",
                                m.getCurrentEntryCount(),
                                "]"
                            });
                            TreeNode treeNode2 = this.tvFields.Nodes.Add(text3);
                            treeNode2.Tag = bb;
                            for (int i = 0; i < m.getMaxEntryCount(); ++i)
                            {
                                TreeNode treeNode3 = treeNode2.Nodes.Add("[" + i + "]");
                                treeNode3.Tag = m.genlist[i];
                                if (treeNode2.Text == text && treeNode3.Text == text2)
                                {
                                    treeNode = treeNode3;
                                }
                            }
                            if (treeNode2.Text == text && treeNode == null)
                            {
                                treeNode = treeNode2;
                            }
                        }
                        else
                        {
                            TreeNode treeNode4 = this.tvFields.Nodes.Add(HashTracker.getValueForHash(a3.hash));
                            treeNode4.Tag = bb;
                            if (treeNode4.Text == text)
                            {
                                treeNode = treeNode4;
                            }
                        }
                    }
                }

                if (this.tvFields.Nodes.Count > 0)
                {
                    if (treeNode == null)
                    {
                        this.tvFields.SelectedNode = this.tvFields.Nodes[0];
                    }
                    else
                    {
                        this.tvFields.SelectedNode = treeNode;
                    }
                }
                this.tvFields.EndUpdate();
                UnknownA8 a4 = dr.b01.a(VLTOtherValue.TABLE_END) as UnknownA8;
            }
            else
            {
                this.classGrid.Visible = false;
                this.pnlData.Visible   = false;
            }
        }
Exemplo n.º 4
0
        private void tv_AfterSelect(object sender, TreeViewEventArgs e)
        {
            object tag = e.Node.Tag;

            if (tag is VLTClass)
            {
                this.classGrid.Visible = true;
                this.pnlData.Visible   = false;
                VLTClass dq = tag as VLTClass;

                if (!this.classGridDataSet.Tables.Contains(dq.classHash.ToString()))
                {
                    DataTable dataTable = this.classGridDataSet.Tables.Add(dq.classHash.ToString());
                    dataTable.Columns.Add("Name", typeof(string));
                    dataTable.Columns.Add("Type", typeof(string));
                    dataTable.Columns.Add("Length", typeof(ushort));
                    dataTable.Columns.Add("Count", typeof(short));

                    foreach (VLTClass.aclz1 a in dq)
                    {
                        /*
                         * object[] rowData =
                         * {
                         *      HashTracker.getValueForHash( a.hash ),
                         *      HashTracker.getValueForHash( a.ui2 ),
                         *      a.len,
                         *      a.count
                         * };
                         * dataTable.Rows.Add( rowData );*/
                        dataTable.Rows.Add(new object[] {
                            HashTracker.getValueForHash(a.hash),
                            HashTracker.getValueForHash(a.ui2),
                            a.len,
                            a.count
                        });

                        /*
                         * DataRow dataRow = dataTable.NewRow();
                         * dataRow[0] = HashTracker.getValueForHash( a.hash );
                         * dataRow[1] = HashTracker.getValueForHash( a.ui2 );
                         * dataRow[2] = a.len;
                         * dataRow[3] = a.count;
                         * dataTable.Rows.Add( dataRow );*/
                    }
                }

                this.classGrid.DataMember = dq.classHash.ToString();
                //this.classGrid.Columns["Name"].Width = 80;
                //this.classGrid.Columns["Type"].Width = 150;
                //this.classGrid.Columns["Length"].Width = 60;
                //this.classGrid.Columns["Count"].Width = 60;

                this.classGrid.Update();
            }
            else if (tag is UnknownDR)              // TODO
            {
                this.lblFieldType.Text   = "";
                this.lblFieldOffset.Text = "";
                this.dataGrid.DataSource = null;
                this.dataGrid.Update();
                this.classGrid.Visible = false;
                this.pnlData.Visible   = true;
                string   text     = "";
                string   text2    = "";
                TreeNode treeNode = null;
                if (this.tvFields.SelectedNode != null)
                {
                    if (this.tvFields.SelectedNode.Parent != null && this.tvFields.SelectedNode.Parent.Tag == null)
                    {
                        text  = this.tvFields.SelectedNode.Parent.Text;
                        text2 = this.tvFields.SelectedNode.Text;
                    }
                    else
                    {
                        text = this.tvFields.SelectedNode.Text;
                    }
                }
                UnknownDR dr  = tag as UnknownDR;
                VLTClass  dq2 = dr.dq1;
                this.tvFields.BeginUpdate();
                this.tvFields.Nodes.Clear();
                int num = 0;

                foreach (VLTClass.aclz1 a3 in dq2)
                {
                    VLTBaseType bb = dr.bba1[num++];
                    if (!a3.c() || dr.booa1[num - 1])
                    {
                        if (a3.isArray())
                        {
                            VLTArrayType m     = bb as VLTArrayType;
                            string       text3 = string.Concat(new object[]
                            {
                                HashTracker.getValueForHash(a3.hash),
                                " [",
                                m.getMaxEntryCount(),
                                "/",
                                m.getCurrentEntryCount(),
                                "]"
                            });
                            TreeNode treeNode2 = this.tvFields.Nodes.Add(text3);
                            treeNode2.Tag = bb;
                            for (int i = 0; i < m.getMaxEntryCount(); ++i)
                            {
                                TreeNode treeNode3 = treeNode2.Nodes.Add("[" + i + "]");
                                treeNode3.Tag = m.genlist[i];
                                if (treeNode2.Text == text && treeNode3.Text == text2)
                                {
                                    treeNode = treeNode3;
                                }
                            }
                            if (treeNode2.Text == text && treeNode == null)
                            {
                                treeNode = treeNode2;
                            }
                        }
                        else
                        {
                            TreeNode treeNode4 = this.tvFields.Nodes.Add(HashTracker.getValueForHash(a3.hash));
                            treeNode4.Tag = bb;
                            if (treeNode4.Text == text)
                            {
                                treeNode = treeNode4;
                            }
                        }
                    }
                }

                if (this.tvFields.Nodes.Count > 0)
                {
                    if (treeNode == null)
                    {
                        this.tvFields.SelectedNode = this.tvFields.Nodes[0];
                    }
                    else
                    {
                        this.tvFields.SelectedNode = treeNode;
                    }
                }
                this.tvFields.EndUpdate();
            }
            else
            {
                this.classGrid.Visible = false;
                this.pnlData.Visible   = false;
            }
        }