public PaletteViewer() { Classifications = new EditorClassifications(); Classifications.SubArchives = new int[] { 1, 4, 6 }; StaticFileExtensions = ""; FileExtensions = ""; Controls = new Control[2]; Label not = new Label(); not.AutoSize = false; not.Text = "Not an image"; not.Dock = DockStyle.Fill; not.TextAlign = ContentAlignment.MiddleCenter; not.Visible = false; Controls[1] = not; PictureBox image = new PictureBox(); image.SizeMode = PictureBoxSizeMode.CenterImage; image.Dock = DockStyle.Fill; Controls[0] = image; ToolControls = new Control[0]; 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); image.BackgroundImage = checkerboard; image.BackgroundImageLayout = ImageLayout.Tile; }
public ItemViewer() { try { Classifications = new EditorClassifications(); Classifications.Filenames = new string[] { "obj.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]; pic_item_small = (PictureBox)window.Controls.Find("pItemSmall", true)[0]; pic_item_large = (PictureBox)window.Controls.Find("pItemLarge", true)[0]; properties = (PropertyGrid)window.Controls.Find("prop_item", true)[0]; model_viewer = (ModelViewer)window.Controls.Find("modelViewer", true)[0]; model_viewer.Controls[1].MouseUp += model_viewer_MouseUp; model_viewer.software_control.MouseUp += model_viewer_MouseUp; properties.PropertyValueChanged += properties_PropertyValueChanged; name_label.Text = "Select an item"; 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]; NumericUpDown n_amount = (NumericUpDown)toolbox.Controls.Find("nAmount", true)[0]; lock_sprite = (CheckBox)toolbox.Controls.Find("chkModelSprite", true)[0]; n_item.ValueChanged += delegate(object sender, EventArgs e) { SelectItem((int)n_item.Value, (int)n_amount.Value, true); }; n_amount.ValueChanged += delegate(object sender, EventArgs e) { SelectItem((int)n_item.Value, (int)n_amount.Value); }; 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); pic_item_small.BackgroundImage = checkerboard; pic_item_large.BackgroundImage = checkerboard; last_item = 0; last_amount = 1; initialized = false; } catch (Exception e) { MessageBox.Show(e.Message + "\n\n" + e.StackTrace); } }
public ImageViewer() { Classifications = new EditorClassifications(); Classifications.SubArchives = new int[] { 1, 4, 6 }; FileExtensions = ""; StaticFileExtensions = "PNG Image|*.png"; Controls = new Control[2]; Label not = new Label(); not.AutoSize = false; not.Text = "Not an image"; not.Dock = DockStyle.Fill; not.TextAlign = ContentAlignment.MiddleCenter; not.Visible = false; Controls[1] = not; PictureBox image = new PictureBox(); image.SizeMode = PictureBoxSizeMode.CenterImage; image.Dock = DockStyle.Fill; Controls[0] = image; ToolControls = new Control[2]; Label l = new Label(); l.BackColor = Color.Transparent; l.AutoSize = false; l.Text = "Sub-index:"; l.Top = 20; l.Left = 4; l.Width = 80; ToolControls[0] = l; NumericUpDown n = new NumericUpDown(); n.Maximum = 256; n.Width = 80; n.Left = 88; n.Top = l.Top - 3; n.ValueChanged += delegate(object sender, EventArgs e) { PluginSelected(); }; ToolControls[1] = n; 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); image.BackgroundImage = checkerboard; image.BackgroundImageLayout = ImageLayout.Tile; }
public HexEditor() { Classifications = new EditorClassifications(); FileExtensions = "Data file (*.dat)|*.dat"; StaticFileExtensions = "Data file (*.dat)|*.dat"; Controls = new Control[1]; Be.Windows.Forms.HexBox box = new Be.Windows.Forms.HexBox(); box.StringViewVisible = true; box.UseFixedBytesPerLine = true; box.LineInfoVisible = true; box.VScrollBarVisible = true; box.Dock = DockStyle.Fill; Controls[0] = box; ToolControls = new Control[0]; }
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 ModelViewer() { Classifications = new EditorClassifications(); Classifications.Archives = new int[] { 1 }; StaticFileExtensions = ""; FileExtensions = ""; ConfigureForm = new Configure(); Controls = new Control[1]; model_viewer = new Cache_Editor_API.Controls.ModelViewer(); model_viewer.Dock = DockStyle.Fill; Controls[0] = model_viewer; initialized = false; ToolControls = new Control[0]; /*ToolboxControls t = new ToolboxControls(); ToolControls = new Control[t.Controls[0].Controls.Count]; for (int i = 0; i < t.Controls[0].Controls.Count; i++) ToolControls[i] = t.Controls[0].Controls[i];*/ }
public VarBitViewer() { Classifications = new EditorClassifications(); Classifications.Filenames = new string[] { "varbit.dat" }; FileExtensions = ""; StaticFileExtensions = ""; Controls = new Control[1]; properties = new PropertyGrid(); properties.Dock = DockStyle.Fill; Controls[0] = properties; 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_item.ValueChanged += delegate(object sender, EventArgs e) { SelectVarBit((int)n_item.Value); }; initialized = false; last_var = 0; }