コード例 #1
0
    public SuperTrainingEditor(PKM pk)
    {
        Entity = (ISuperTrain)pk;
        InitializeComponent();
        WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
        int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

        TLP_SuperTrain.Padding = TLP_DistSuperTrain.Padding = new Padding(0, 0, vertScrollWidth, 0);

        // Updating a Control display with auto-sized elements on every row addition is cpu intensive. Disable layout updates while populating.
        TLP_SuperTrain.SuspendLayout();
        TLP_DistSuperTrain.SuspendLayout();
        TLP_SuperTrain.Scroll     += WinFormsUtil.PanelScroll;
        TLP_DistSuperTrain.Scroll += WinFormsUtil.PanelScroll;
        PopulateRegimens("SuperTrain", TLP_SuperTrain, reglist);
        PopulateRegimens("DistSuperTrain", TLP_DistSuperTrain, distlist);
        WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
        TLP_SuperTrain.ResumeLayout();
        TLP_DistSuperTrain.ResumeLayout();

        CHK_SecretUnlocked.Checked = Entity.SecretSuperTrainingUnlocked;
        CHK_SecretComplete.Checked = Entity.SecretSuperTrainingComplete;

        if (pk is PK6 pk6)
        {
            CB_Bag.Items.Clear();
            CB_Bag.Items.Add("---");
            for (int i = 1; i < GameInfo.Strings.trainingbags.Length - 1; i++)
            {
                CB_Bag.Items.Add(GameInfo.Strings.trainingbags[i]);
            }

            CB_Bag.SelectedIndex = pk6.TrainingBag;
            NUD_BagHits.Value    = pk6.TrainingBagHits;

            if (!CHK_SecretUnlocked.Checked) // force update to disable checkboxes
            {
                CHK_Secret_CheckedChanged(this, EventArgs.Empty);
            }
        }
        else
        {
            L_Bag.Visible = CB_Bag.Visible = L_Hits.Visible = NUD_BagHits.Visible = false;
            CHK_SecretUnlocked.Visible = CHK_SecretComplete.Visible = false;
        }
    }
コード例 #2
0
        public SuperTrainingEditor()
        {
            InitializeComponent();
            int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

            TLP_SuperTrain.Padding = TLP_DistSuperTrain.Padding = new Padding(0, 0, vertScrollWidth, 0);

            // Updating a Control display with autosized elements on every row addition is cpu intensive. Disable layout updates while populating.
            TLP_SuperTrain.SuspendLayout();
            TLP_DistSuperTrain.SuspendLayout();
            TLP_SuperTrain.Scroll     += Util.PanelScroll;
            TLP_DistSuperTrain.Scroll += Util.PanelScroll;
            populateRegimens("SuperTrain", TLP_SuperTrain, reglist);
            populateRegimens("DistSuperTrain", TLP_DistSuperTrain, distlist);
            Util.TranslateInterface(this, Main.curlanguage);
            TLP_SuperTrain.ResumeLayout();
            TLP_DistSuperTrain.ResumeLayout();

            CB_Bag.Items.Clear();
            CB_Bag.Items.Add("---");
            for (int i = 1; i < Main.GameStrings.trainingbags.Length - 1; i++)
            {
                CB_Bag.Items.Add(Main.GameStrings.trainingbags[i]);
            }

            if (pkm is PK6)
            {
                PK6 pk6 = (PK6)pkm;
                CHK_SecretUnlocked.Checked = pk6.SecretSuperTrainingUnlocked;
                CHK_SecretComplete.Checked = pk6.SecretSuperTrainingComplete;
                if (!CHK_SecretUnlocked.Checked) // force update to disable checkboxes
                {
                    CHK_Secret_CheckedChanged(null, null);
                }
                CB_Bag.SelectedIndex = pk6.TrainingBag;
                NUD_BagHits.Value    = pk6.TrainingBagHits;
            }
            else
            {
                CB_Bag.Visible = NUD_BagHits.Visible = false;
            }
        }