Esempio n. 1
0
    private void LoadMisc6(PKM pk)
    {
        TB_EC.Text = $"{pk.EncryptionConstant:X8}";
        DEV_Ability.SelectedValue = pk.Ability;

        // with some simple error handling
        var bitNumber    = pk.AbilityNumber;
        int abilityIndex = AbilityVerifier.IsValidAbilityBits(bitNumber) ? bitNumber >> 1 : 0;

        LoadClamp(CB_Ability, abilityIndex);
        TB_AbilityNumber.Text = bitNumber.ToString();

        LoadRelearnMoves(pk);
        LoadHandlingTrainer(pk);

        if (pk is IRegionOrigin tr)
        {
            LoadGeolocation(tr);
        }
    }
Esempio n. 2
0
        private void LoadMisc6(PKM pk)
        {
            TB_EC.Text = $"{pk.EncryptionConstant:X8}";
            DEV_Ability.SelectedValue = pk.Ability;

            // with some simple error handling
            var bitNumber    = pk.AbilityNumber;
            int abilityIndex = AbilityVerifier.IsValidAbilityBits(bitNumber) ? bitNumber >> 1 : 0;

            if (abilityIndex >= CB_Ability.Items.Count)    // sanity check ability count being possible
            {
                abilityIndex = CB_Ability.Items.Count - 1; // last possible index, if out of range
            }
            CB_Ability.SelectedIndex = abilityIndex;
            TB_AbilityNumber.Text    = bitNumber.ToString();

            LoadRelearnMoves(pk);
            LoadHandlingTrainer(pk);

            if (pk is IRegionOrigin tr)
            {
                LoadGeolocation(tr);
            }
        }