private void Button15_Click(object sender, EventArgs e)
        {
            Text                = "Please wait...";
            UseWaitCursor       = true;
            ProgressBar.Value   = 0;
            ProgressBar.Visible = true;
            int LoopVar;

            LoopVar = 0;
            while (LoopVar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAbilities", "")) - 1d == true)
            {
                AbilityList.SelectedIndex = LoopVar;
                LoopVar += 1;
                Refresh();
                Enabled = false;
                ModifyNameCommands.ChangeAbilityName(LoopVar, MMainFunctions.DecapString(Conversions.ToString(GetNameFunctions.GetAbilityName(LoopVar))));
                ProgressBar.Value = (int)(LoopVar / Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAbilities", "")) * 100d);
            }

            LoopVar = 0;
            AbilityList.Items.Clear();
            while (LoopVar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAbilities", "")) == true)
            {
                AbilityList.Items.Add(GetNameFunctions.GetAbilityName(LoopVar));
                LoopVar += 1;
            }

            AbilityList.SelectedIndex = 0;
            Text                = "Ability Editor";
            UseWaitCursor       = false;
            Enabled             = true;
            ProgressBar.Visible = false;
            BringToFront();
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            int tempy;

            tempy = ComboBox3.SelectedIndex;
            ModifyNameCommands.ChangeAttackName(ComboBox3.SelectedIndex + 1, TextBox1.Text);
            int LoopVar;

            LoopVar = 1;
            ComboBox3.Items.Clear();
            while (LoopVar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAttacks", "")) + 1d == true)
            {
                ComboBox3.Items.Add(GetNameFunctions.GetAttackName(LoopVar));
                LoopVar = LoopVar + 1;
            }

            ComboBox3.SelectedIndex = tempy;
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            int indexbuff;

            indexbuff = AbilityList.SelectedIndex;
            ModifyNameCommands.ChangeAbilityName(AbilityList.SelectedIndex, TextBox1.Text);
            int loopvar;

            loopvar = 0;
            AbilityList.Items.Clear();
            while (loopvar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAbilities", "")) == true)
            {
                AbilityList.Items.Add(GetNameFunctions.GetAbilityName(loopvar));
                loopvar += 1;
            }

            AbilityList.SelectedIndex = -1;
            AbilityList.SelectedIndex = indexbuff;
        }
        private void Button3_Click(object sender, EventArgs e)
        {
            int indexbuff = ListBox1.SelectedIndex;

            offset1 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "PokedexData", ""), System.Globalization.NumberStyles.HexNumber);
            if (MainObject.Header2 == "AXP" | MainObject.Header2 == "AXV")
            {
                string localReverseHEX()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Hght.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart = offset1 + 12 + indexbuff * MainObject.SkipVar;
                string argData  = localReverseHEX();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart, ref argData);
                string localReverseHEX1()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Wght.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart1 = offset1 + 2 + 12 + indexbuff * MainObject.SkipVar;
                string argData1  = localReverseHEX1();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart1, ref argData1);
                string localReverseHEX2()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Scale1.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart2 = offset1 + 26 + indexbuff * MainObject.SkipVar;
                string argData2  = localReverseHEX2();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart2, ref argData2);
                string localReverseHEX3()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Offset_1.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart3 = offset1 + 28 + indexbuff * MainObject.SkipVar;
                string argData3  = localReverseHEX3();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart3, ref argData3);
                string localReverseHEX4()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Scale2.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart4 = offset1 + 30 + indexbuff * MainObject.SkipVar;
                string argData4  = localReverseHEX4();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart4, ref argData4);
                string localReverseHEX5()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Offset_2.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart5 = offset1 + 32 + indexbuff * MainObject.SkipVar;
                string argData5  = localReverseHEX5();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart5, ref argData5);
            }
            else if (MainObject.Header2 == "BPR" | MainObject.Header2 == "BPG")
            {
                string localReverseHEX6()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Hght.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart6 = offset1 + 12 + indexbuff * MainObject.SkipVar;
                string argData6  = localReverseHEX6();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart6, ref argData6);
                string localReverseHEX7()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Wght.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart7 = offset1 + 2 + 12 + indexbuff * MainObject.SkipVar;
                string argData7  = localReverseHEX7();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart7, ref argData7);
                string localReverseHEX8()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Scale1.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart8 = offset1 + 26 + indexbuff * MainObject.SkipVar;
                string argData8  = localReverseHEX8();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart8, ref argData8);
                string localReverseHEX9()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Offset_1.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart9 = offset1 + 28 + indexbuff * MainObject.SkipVar;
                string argData9  = localReverseHEX9();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart9, ref argData9);
                string localReverseHEX10()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Scale2.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart10 = offset1 + 30 + indexbuff * MainObject.SkipVar;
                string argData10  = localReverseHEX10();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart10, ref argData10);
                string localReverseHEX11()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Offset_2.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart11 = offset1 + 32 + 12 + indexbuff * MainObject.SkipVar;
                string argData11  = localReverseHEX11();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart11, ref argData11);
            }
            else if (MainObject.Header2 == "BPE")
            {
                string localReverseHEX12()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Hght.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart12 = offset1 + 12 + indexbuff * MainObject.SkipVar;
                string argData12  = localReverseHEX12();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart12, ref argData12);
                string localReverseHEX13()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Wght.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart13 = offset1 + 2 + 12 + indexbuff * MainObject.SkipVar;
                string argData13  = localReverseHEX13();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart13, ref argData13);
                string localReverseHEX14()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Scale1.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart14 = offset1 + 22 + indexbuff * MainObject.SkipVar;
                string argData14  = localReverseHEX14();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart14, ref argData14);
                string localReverseHEX15()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Offset_1.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart15 = offset1 + 24 + indexbuff * MainObject.SkipVar;
                string argData15  = localReverseHEX15();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart15, ref argData15);
                string localReverseHEX16()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Scale2.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart16 = offset1 + 26 + indexbuff * MainObject.SkipVar;
                string argData16  = localReverseHEX16();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart16, ref argData16);
                string localReverseHEX17()
                {
                    string argHEXData = Strings.Right("0000" + Conversion.Hex(Offset_2.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
                }

                int    argStart17 = offset1 + 28 + indexbuff * MainObject.SkipVar;
                string argData17  = localReverseHEX17();
                HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart17, ref argData17);
            }

            ModifyNameCommands.ChangePokedexTypeName(indexbuff, Type1.Text);
            ListBox1.Items.Clear();
            int varloop = 0;

            while (varloop < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfDexEntries", "")))
            {
                ListBox1.Items.Add(Operators.ConcatenateObject(Strings.Right("0000" + varloop, 4) + ". ", GetNameFunctions.GetPokedexTypeName(varloop)));
                varloop = varloop + 1;
            }

            ListBox1.SelectedIndex = indexbuff;
        }
        private void SaveBttn_Click(object sender, EventArgs e)
        {
            int listvar;
            int LoopVar;

            listvar = ItemListComboBox.SelectedIndex;
            ModifyNameCommands.ChangeItemName(listvar, ChangeNameTextBox.Text);
            string localReverseHEX()
            {
                string argHEXData = Strings.Right("0000" + Conversion.Hex(IndexTextBox.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart = ItemBaseOff + 14 + listvar * 44;
            string argData  = localReverseHEX();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart, ref argData);
            string localReverseHEX1()
            {
                string argHEXData = Strings.Right("0000" + Conversion.Hex(PriceTextBox.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart1 = ItemBaseOff + 16 + listvar * 44;
            string argData1  = localReverseHEX1();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart1, ref argData1);
            int    argStart2 = ItemBaseOff + 18 + listvar * 44;
            string argData2  = Conversion.Hex(HoldEffectTextBox.Text);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart2, ref argData2);
            int    argStart3 = ItemBaseOff + 19 + listvar * 44;
            string argData3  = Conversion.Hex(ValueTextBox.Text);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart3, ref argData3);
            int    argStart4 = ItemBaseOff + 24 + listvar * 44;
            string argData4  = Conversion.Hex(MysteryValue1TextBox.Text);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart4, ref argData4);
            int    argStart5 = ItemBaseOff + 25 + listvar * 44;
            string argData5  = Conversion.Hex(MysteryValue2TextBox.Text);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart5, ref argData5);
            int    argStart6 = ItemBaseOff + 26 + listvar * 44;
            string argData6  = Conversion.Hex(PocketComboBox.SelectedIndex);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart6, ref argData6);
            int    argStart7 = ItemBaseOff + 27 + listvar * 44;
            string argData7  = Conversion.Hex(TypeTextBox.Text);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart7, ref argData7);
            string localReverseHEX2()
            {
                string argHEXData = Conversion.Hex(int.Parse(FieldUsagePTTextBox.Text, System.Globalization.NumberStyles.HexNumber) + 0x8000000); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart8 = ItemBaseOff + 28 + ItemListComboBox.SelectedIndex * 44;
            string argData8  = localReverseHEX2();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart8, ref argData8);
            string localReverseHEX3()
            {
                string argHEXData = Conversion.Hex(int.Parse(BattleUsagePTTextBox.Text, System.Globalization.NumberStyles.HexNumber) + 0x8000000); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart9 = ItemBaseOff + 36 + ItemListComboBox.SelectedIndex * 44;
            string argData9  = localReverseHEX3();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart9, ref argData9);
            int    argStart10 = ItemBaseOff + 32 + listvar * 44;
            string argData10  = Conversion.Hex(BUTextBox.Text);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart10, ref argData10);
            string localReverseHEX4()
            {
                string argHEXData = ExtParTxt.Text; var ret = HexFunctions.ReverseHex(ref argHEXData); ExtParTxt.Text = argHEXData; return(ret);
            }

            int    argStart11 = ItemBaseOff + 40 + ItemListComboBox.SelectedIndex * 44;
            string argData11  = localReverseHEX4();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart11, ref argData11);
            if (MainObject.Header2 == "BPR" | MainObject.Header2 == "BPG" | MainObject.Header2 == "BPE")
            {
            }
            else
            {
            }

            LoopVar = 0;
            ItemListComboBox.Items.Clear();
            while (LoopVar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfItems", "")) == true)
            {
                ItemListComboBox.Items.Add(GetNameFunctions.GetItemName(LoopVar));
                LoopVar = LoopVar + 1;
            }

            ItemListComboBox.SelectedIndex = listvar;
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            string localReverseHEX()
            {
                string argHEXData = Strings.Right("0000" + Conversion.Hex(ComboBox2.SelectedIndex), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 12;
            string argData  = localReverseHEX();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart, ref argData);
            string localReverseHEX1()
            {
                string argHEXData = Strings.Right("0000" + Conversion.Hex(ComboBox1.SelectedIndex), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart1 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 56;
            string argData1  = localReverseHEX1();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart1, ref argData1);
            ModifyNameCommands.ChangeTradeNickName(ListBox1.SelectedIndex, TextBox1.Text);
            ModifyNameCommands.ChangeTradeOtName(ListBox1.SelectedIndex, TextBox2.Text);
            string localReverseHEX2()
            {
                string argHEXData = Strings.Right("0000" + Conversion.Hex(ComboBox3.SelectedIndex), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart2 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 40;
            string argData2  = localReverseHEX2();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart2, ref argData2);
            string localReverseHEX3()
            {
                string argHEXData = Strings.Right("0000" + Conversion.Hex(TextBox3.Text), 4); var ret = HexFunctions.ReverseHex(ref argHEXData); return(ret);
            }

            int    argStart3 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 24;
            string argData3  = localReverseHEX3();

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart3, ref argData3);
            int    argStart4 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 14;
            string argData4  = Strings.Right("00" + Conversion.Hex(NumericUpDown1.Value), 2);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart4, ref argData4);
            int    argStart5 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 15;
            string argData5  = Strings.Right("00" + Conversion.Hex(NumericUpDown2.Value), 2);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart5, ref argData5);
            int    argStart6 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 16;
            string argData6  = Strings.Right("00" + Conversion.Hex(NumericUpDown3.Value), 2);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart6, ref argData6);
            int    argStart7 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 17;
            string argData7  = Strings.Right("00" + Conversion.Hex(NumericUpDown4.Value), 2);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart7, ref argData7);
            int    argStart8 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 18;
            string argData8  = Strings.Right("00" + Conversion.Hex(NumericUpDown5.Value), 2);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart8, ref argData8);
            int    argStart9 = int.Parse(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "TradeData", ""), System.Globalization.NumberStyles.HexNumber) + ListBox1.SelectedIndex * 60 + 19;
            string argData9  = Strings.Right("00" + Conversion.Hex(NumericUpDown6.Value), 2);

            HexFunctions.WriteHex(ref MainObject.LoadedRom, ref argStart9, ref argData9);
        }