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); }