Battle_Script_Pro.Form1.Form1 C# (CSharp) Method

Form1() public method

public Form1 ( int offset, string fileName ) : System
offset int
fileName string
return System
        public Form1(int offset, string fileName)
        {
            InitializeComponent();
            this.MaximumSize = this.MinimumSize = this.Size;
            SetupTool();
            if (File.Exists(fileName))
            {
                if (Path.GetExtension(fileName).ToUpper().Equals(".GBA"))
                {
                    byte[] rom = File.ReadAllBytes(fileName);
                    headersNeeded = new Dictionary<string, bool>();
                    headersNeeded.Add("abilities", false);
                    headersNeeded.Add("moves", false);
                    headersNeeded.Add("pokemon", false);
                    headersNeeded.Add("items", false);
                    List<string> toReturn = DecompileScript(location, File.ReadAllBytes(selectedROMPath)).ToList();
                    bool insertReturn = false;
                    int countLines = 0;
                    foreach (string s in headersNeeded.Keys)
                    {
                        if (headersNeeded[s])
                        {
                            toReturn.Insert(0, "#include " + s + ".bsh");
                            countLines++;
                            insertReturn = true;
                        }
                    }
                    if (insertReturn)
                    {
                        toReturn.Insert(countLines, "");
                    }
                    scripts[tabControl1.SelectedIndex].Lines = toReturn.ToArray();
                    headersNeeded.Clear();
                }
                else
                {
                    MessageBox.Show("This file format is unsupported.");
                }
                this.KeyPreview = true;
                this.KeyDown += new KeyEventHandler(Form_KeyDown);
            }
        }

Same methods

Form1::Form1 ( ) : System
Form1::Form1 ( string fileName ) : System
Form1