예제 #1
0
    public SAV_Misc3(SaveFile sav)
    {
        InitializeComponent();
        WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
        SAV = (SAV3)(Origin = sav).Clone();

        LoadRecords();

        if (SAV is IGen3Joyful j)
        {
            ReadJoyful(j);
        }
        else
        {
            tabControl1.Controls.Remove(TAB_Joyful);
        }

        if (SAV is SAV3E)
        {
            ReadFerry();
            ReadBattleFrontier();
        }
        else
        {
            tabControl1.Controls.Remove(TAB_Ferry);
            tabControl1.Controls.Remove(TAB_BF);
        }

        if (SAV is SAV3FRLG frlg)
        {
            TB_RivalName.Text = frlg.RivalName;

            // Trainer Card Species
            ComboBox[] cba   = { CB_TCM1, CB_TCM2, CB_TCM3, CB_TCM4, CB_TCM5, CB_TCM6 };
            var        legal = GameInfo.FilteredSources.Species.ToList();
            for (int i = 0; i < cba.Length; i++)
            {
                cba[i].Items.Clear();
                cba[i].InitializeBinding();
                cba[i].DataSource = new BindingSource(legal, null);
                var g3Species = SAV.GetWork(0x43 + i);
                var species   = SpeciesConverter.GetG4Species(g3Species);
                cba[i].SelectedValue = species;
            }
        }
        else
        {
            TB_RivalName.Visible = L_TrainerName.Visible = GB_TCM.Visible = false;
        }

        NUD_Coins.Value = Math.Min(NUD_Coins.Maximum, SAV.Coin);
    }