Ejemplo n.º 1
0
        void load_savegame(string filepath)
        {
            string path     = filepath;
            int    filesize = FileIO.load_file(ref savebuffer, ref path, dsfilter);

            versiontext.Text = "";

            if (filesize == SAV5.SIZERAW || filesize == SAV5.SIZERAW + 122)
            {
                //Convert DSV to SAV
                if (filesize == SAV5.SIZERAW + 122)
                {
                    Array.Resize(ref savebuffer, SAV5.SIZERAW);
                }

                savegamename.Text = path;
                save = new SAV5(savebuffer);

                if (save.B2W2)
                {
                    versiontext.Text = "Black/White 2";

                    dumper_but.Enabled          = true;
                    chk_but.Enabled             = true;
                    chk_updt_but.Enabled        = true;
                    save_but.Enabled            = true;
                    grotto_but.Enabled          = true;
                    trainer_records_but.Enabled = true;
                    medal_but.Enabled           = true;
                    forest_but.Enabled          = true;
                    key_but.Enabled             = true;
                    join_but.Enabled            = true;
                    trainer_but.Enabled         = true;
                    memory_but.Enabled          = true;
                    dlc_but.Enabled             = true;
                    dr_but.Enabled   = true;
                    prop_but.Enabled = true;
                }
                else if (save.BW)
                {
                    versiontext.Text = "Black/White 1";

                    dumper_but.Enabled          = true;
                    chk_but.Enabled             = true;
                    chk_updt_but.Enabled        = true;
                    save_but.Enabled            = true;
                    grotto_but.Enabled          = false;
                    trainer_records_but.Enabled = false;
                    medal_but.Enabled           = false;
                    forest_but.Enabled          = true;
                    key_but.Enabled             = false;
                    join_but.Enabled            = false;
                    trainer_but.Enabled         = true;
                    memory_but.Enabled          = false;
                    dlc_but.Enabled             = true;
                    dr_but.Enabled   = false;
                    prop_but.Enabled = true;
                }
                else
                {
                    versiontext.Text = "Invalid file";
                }
            }
            else
            {
                MessageBox.Show("Invalid file.");
                savegamename.Text           = "";
                dumper_but.Enabled          = false;
                chk_but.Enabled             = false;
                chk_updt_but.Enabled        = false;
                save_but.Enabled            = false;
                grotto_but.Enabled          = false;
                trainer_records_but.Enabled = false;
                medal_but.Enabled           = false;
                forest_but.Enabled          = false;
                key_but.Enabled             = false;
                join_but.Enabled            = false;
                trainer_but.Enabled         = false;
                memory_but.Enabled          = false;
                dlc_but.Enabled             = false;
                dr_but.Enabled = false;
            }
        }
Ejemplo n.º 2
0
 void Save_butClick(object sender, EventArgs e)
 {
     //if (save.Edited)
     FileIO.save_data(save.Data);
     //else MessageBox.Show("Save has not been edited");
 }