コード例 #1
0
ファイル: MainScreen.cs プロジェクト: suloku/wc-tool
 void Inject_wc3_butClick(object sender, EventArgs e)
 {
     if (sav3file.has_WC == true)
     {
         DialogResult dialogResult = MessageBox.Show("Savefile already has a WonderCard. Overwrite?", "WonderCard Injection", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.No)
         {
             return;
         }
     }
     if (sav3file.has_mystery_gift == true)
     {
         string path     = null;
         int    filesize = FileIO.load_file(ref wc3new, ref path, wc3filter);
         if ((filesize == wc3.SIZE_WC3 && sav3file.isjap == false) || (filesize == wc3.SIZE_WC3_jap && sav3file.isjap == true))
         {
             sav3file.set_WC3(wc3new);
             //custom_script.Checked = true;
             //Add fix sav3 checksum func3
             sav3file.update_section_chk(4);
             MessageBox.Show("WC3 injected.");
             FileIO.save_data(sav3file.Data, savfilter);
         }
         else if (filesize == -1)
         {
             ;
         }
         else
         {
             MessageBox.Show("Invalid file size.");
         }
     }
     else
     {
         MessageBox.Show("Save file does not have Mystery Gift enabled.");
     }
 }