public ObjectViewer() { Classifications = new EditorClassifications(); Classifications.Filenames = new string[] { "loc.dat" }; FileExtensions = ""; StaticFileExtensions = ""; ConfigureForm = new Configure(); Window window = new Window(); this.Controls = new Control[window.Controls.Count]; for (int i = 0; i < window.Controls.Count; i++) { this.Controls[i] = window.Controls[i]; } name_label = (Label)window.Controls.Find("lblName", true)[0]; properties = (PropertyGrid)window.Controls.Find("prop_item", true)[0]; model_viewer = (ModelViewer)window.Controls.Find("modelViewer", true)[0]; properties.PropertyValueChanged += properties_PropertyValueChanged; name_label.Text = "Select an object"; ItemToolbox toolbox = new ItemToolbox(); ToolControls = new Control[toolbox.Controls.Count]; for (int i = 0; i < ToolControls.Length; i++) { ToolControls[i] = toolbox.Controls[i]; } NumericUpDown n_item = (NumericUpDown)toolbox.Controls.Find("nItem", true)[0]; n_type = (NumericUpDown)toolbox.Controls.Find("nType", true)[0]; n_item.ValueChanged += delegate(object sender, EventArgs e) { SelectObject((int)n_item.Value, true); }; n_type.ValueChanged += delegate(object sender, EventArgs e) { if (last_type != (int)n_type.Value) { last_type = (int)n_type.Value; SelectObject((int)n_item.Value, true); } }; checkerboard = new Bitmap(32, 32); Graphics g = Graphics.FromImage(checkerboard); g.Clear(Color.White); g.FillRectangle(Brushes.LightGray, 0, 0, 16, 16); g.FillRectangle(Brushes.LightGray, 16, 16, 16, 16); last_object = 0; initialized = false; }
public ObjectViewer() { Classifications = new EditorClassifications(); Classifications.Filenames = new string[] { "loc.dat" }; FileExtensions = ""; StaticFileExtensions = ""; ConfigureForm = new Configure(); Window window = new Window(); this.Controls = new Control[window.Controls.Count]; for (int i = 0; i < window.Controls.Count; i++) this.Controls[i] = window.Controls[i]; name_label = (Label)window.Controls.Find("lblName", true)[0]; properties = (PropertyGrid)window.Controls.Find("prop_item", true)[0]; model_viewer = (ModelViewer)window.Controls.Find("modelViewer", true)[0]; properties.PropertyValueChanged += properties_PropertyValueChanged; name_label.Text = "Select an object"; ItemToolbox toolbox = new ItemToolbox(); ToolControls = new Control[toolbox.Controls.Count]; for (int i = 0; i < ToolControls.Length; i++) ToolControls[i] = toolbox.Controls[i]; NumericUpDown n_item = (NumericUpDown)toolbox.Controls.Find("nItem", true)[0]; n_type = (NumericUpDown)toolbox.Controls.Find("nType", true)[0]; n_item.ValueChanged += delegate(object sender, EventArgs e) { SelectObject((int)n_item.Value, true); }; n_type.ValueChanged += delegate(object sender, EventArgs e) { if (last_type != (int)n_type.Value) { last_type = (int)n_type.Value; SelectObject((int)n_item.Value, true); } }; checkerboard = new Bitmap(32, 32); Graphics g = Graphics.FromImage(checkerboard); g.Clear(Color.White); g.FillRectangle(Brushes.LightGray, 0, 0, 16, 16); g.FillRectangle(Brushes.LightGray, 16, 16, 16, 16); last_object = 0; initialized = false; }