public void load_tsi(string path) { this.treeView.Nodes.Clear(); this.ListDDS.Clear(); BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open)); this.dds_count = binaryReader.ReadInt16(); for (int num = 0; num != (int)this.dds_count; num++) { dds dds = new dds(); short count = binaryReader.ReadInt16(); dds.path = Encoding.UTF7.GetString(binaryReader.ReadBytes((int)count)); this.treeView.Nodes.Add("Dds : \"" + dds.path + "\""); dds.colour_key = binaryReader.ReadInt32(); this.ListDDS.Add(dds); } this.totalelement_count = binaryReader.ReadInt16(); for (int num = 0; num != (int)this.dds_count; num++) { this.ListDDS[num].ddselement_count = binaryReader.ReadInt16(); for (int num2 = 0; num2 != (int)this.ListDDS[num].ddselement_count; num2++) { dds.dds_element dds_element = new dds.dds_element(); dds_element.Load_element(ref binaryReader); this.ListDDS[num].ListDDS_element.Add(dds_element); this.treeView.Nodes[num].Nodes.Add(dds_element.name); } } this.propertyGrid.SelectedObject = this.ListDDS[0].ListDDS_element[0]; binaryReader.Close(); }
private void addDdsToolStripMenuItem_Click(object sender, EventArgs e) { this.treeView.Nodes.Add("Dds : \"New node\""); this.treeView.Refresh(); dds dds = new dds(); dds.colour_key = 0; dds.path = "New node"; dds.ddselement_count = 0; dds dds2 = new dds(); dds2.path = "New node"; dds2.colour_key = 0; this.ListDDS.Add(dds2); }
private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { if (this.propertyGrid.SelectedObject.GetType() == typeof(dds)) { dds dds = (dds)this.propertyGrid.SelectedObject; this.treeView.SelectedNode.Text = "Dds : \"" + dds.path + "\""; } if (this.propertyGrid.SelectedObject.GetType() == typeof(dds.dds_element)) { dds.dds_element dds_element = (dds.dds_element) this.propertyGrid.SelectedObject; this.treeView.SelectedNode.Text = dds_element.name; TreeNode selectedNode = this.treeView.SelectedNode; TreeNode parent = selectedNode.Parent; if (this.preview) { this.loadRect(this.ListDDS[parent.Index].ListDDS_element[selectedNode.Index].x1, this.ListDDS[parent.Index].ListDDS_element[selectedNode.Index].y1, this.ListDDS[parent.Index].ListDDS_element[selectedNode.Index].x2, this.ListDDS[parent.Index].ListDDS_element[selectedNode.Index].y2); } } }
private void copyDDSToolStripMenuItem_Click(object sender, EventArgs e) { this.copyDDS = this.ListDDS[this.treeView.SelectedNode.Index]; }