public SaveForm(NSE_Framework.Write write, byte[] Data, int Offset, int OrigonalLength) { InitializeComponent(); if (Program.MainForm.Read.FileLength > 0x1000000) { TextBox1.MaxLength = 7; } if (Offset != -1) { TextBox1.Text = Offset.ToString("X2"); } else { NSE_Framework.Find find = new NSE_Framework.Find(Program.MainForm.Filename); int f = find.FindFreeSpace(0, Data.Length); if (f != -1) { TextBox1.Text = f.ToString("X2"); } } Label3.Text = OrigonalLength.ToString(); this.OrigonalOffset = Offset; this.Data = Data; this.OrigonalLength = OrigonalLength; this.write = write; }
private void LoadForm(object sender, EventArgs e) { if (Host.Filename != null && Host.Filename != null) { //Creates a new read object Read = new NSE_Framework.Read(Host.Filename); //Creates a new write object Write = new NSE_Framework.Write(Host.Filename); //see if were eddting a pokemon game if (Read.ReadString(0xA0, 7).ToLower() == "pokemon") { //gets the header Header = Read.ReadString(0xAC, 4); if (Header.Substring(0, 2) == "BP") { #region FIRERED_LEAFGREEN_EMERALD FrontTable = Read.ReadPointer(0x128); BackTable = Read.ReadPointer(0x12C); NormalTable = Read.ReadPointer(0x130); ShinyTable = Read.ReadPointer(0x134); MiniSpriteTable = Read.ReadPointer(0x138); MiniPaletteIndex = Read.ReadPointer(0x13C); MiniPalettes = Read.ReadPointer(0x140); MAX = 439; if (!NSE2.Program.MainForm.SafetyRepointing) { if (MessageBox.Show(this, "It seems that SafetyRepointing is disabled:\nIt's suggested that you enable SafetyRepointing for best results.\nEnable SafetyRepointing?", "Notice:", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes) { NSE2.Program.MainForm.SafetyRepointing = true; } } CanNavigate = true; #endregion } else { MessageBox.Show("Currently this plugin only supports Firered, Leafgreen and Emerald.\n-Link12552", "Notice:", MessageBoxButtons.OK); } Navigate(); NumericUpDownPalette.Enabled = true; // Wires the EDITBOX to NSE Host.SetEditor(ref EditBox); } } }
public MainForm(IPluginHost Host) { InitializeComponent(); this.Host = Host; read = new NSE_Framework.Read(Host.Filename); write = new NSE_Framework.Write(Host.Filename); }
public InsertForm(NSE_Framework.Write write, byte[] Data) { InitializeComponent(); if (Program.MainForm.Read.FileLength > 0x1000000) { TextBox1.MaxLength = 7; } NSE_Framework.Find find = new NSE_Framework.Find(Program.MainForm.Filename); TextBox1.Text = find.FindFreeSpace(0X800000, Data.Length, true).ToString("X2"); Label3.Text = Data.Length.ToString(); this.Data = Data; this.write = write; }
public SaveForm(NSE_Framework.Write write, byte[] Data, int Offset) { InitializeComponent(); if (Program.MainForm.Read.FileLength > 0x1000000) { TextBox1.MaxLength = 7; } CheckBoxAbort.Enabled = false; TextBox1.Text = Offset.ToString("X2"); Label3.Text = Data.Length.ToString(); this.OrigonalOffset = Offset; this.Data = Data; this.OrigonalLength = Data.Length; this.write = write; }