コード例 #1
0
ファイル: SAV_Misc3.cs プロジェクト: kang1806/PKHeX
        private void B_Save_Click(object sender, EventArgs e)
        {
            if (tabControl1.Controls.Contains(TAB_Joyful))
            {
                SaveJoyful();
            }
            if (tabControl1.Controls.Contains(TAB_Ferry))
            {
                SaveFerry();
            }
            if (tabControl1.Controls.Contains(TAB_BF))
            {
                SaveBattleFrontier();
            }
            if (SAV.FRLG)
            {
                SAV.SetData(SAV.SetString(TB_OTName.Text, TB_OTName.MaxLength), SAV.GetBlockOffset(4) + 0xBCC);
                ComboBox[] cba    = { CB_TCM1, CB_TCM2, CB_TCM3, CB_TCM4, CB_TCM5, CB_TCM6 };
                int        ofsTCM = SAV.GetBlockOffset(2) + 0x106;
                for (int i = 0; i < cba.Length; i++)
                {
                    BitConverter.GetBytes((ushort)(int)cba[i].SelectedValue).CopyTo(SAV.Data, ofsTCM + (i << 1));
                }
            }

            SAV.BP   = (ushort)NUD_BP.Value;
            SAV.Coin = (ushort)NUD_Coins.Value;

            Origin.SetData(SAV.Data, 0);
            Close();
        }
コード例 #2
0
ファイル: SAV_Misc3.cs プロジェクト: nixhex/PKHeX
        private void B_Save_Click(object sender, EventArgs e)
        {
            if (tabControl1.Controls.Contains(TAB_Joyful))
            {
                SaveJoyful();
            }
            if (tabControl1.Controls.Contains(TAB_Ferry))
            {
                SaveFerry();
            }
            if (tabControl1.Controls.Contains(TAB_BF))
            {
                SaveBattleFrontier();
            }
            if (SAV.FRLG)
            {
                SAV.SetData(SAV.Large, SAV.SetString(TB_RivalName.Text, TB_RivalName.MaxLength), 0x3A4C);
                ComboBox[] cba = { CB_TCM1, CB_TCM2, CB_TCM3, CB_TCM4, CB_TCM5, CB_TCM6 };
                for (int i = 0; i < cba.Length; i++)
                {
                    SAV.SetEventConst(0x43 + i, (ushort)(int)cba[i].SelectedValue);
                }
            }

            if (!SAV.RS)
            {
                SAV.BP = (ushort)NUD_BP.Value;
            }
            SAV.Coin = (ushort)NUD_Coins.Value;

            Origin.CopyChangesFrom(SAV);
            Close();
        }