Exemple #1
0
        public void OnRowSwitch(PokemonBoxViewer caller)
        {
            if (PokeManager.IsHoldingPokemon || PokeManager.HasSelection)
            {
                PokeManager.DropAll();
                PokeManager.ClearSelectedPokemon();
                PokeManager.RefreshUI();
            }

            if (!PokeManager.Settings.AllowDoubleBoxRows)
            {
                int callerIndex = GetIndex(caller);
                PokemonBoxViewer[] priorities = new PokemonBoxViewer[3];
                boxViewer1.SupressIndexChanged = true;
                boxViewer2.SupressIndexChanged = true;
                boxViewer3.SupressIndexChanged = true;

                priorities[0] = caller;
                if (callerIndex == 1)
                {
                    if (IsValid(boxViewer2, caller) || !IsValid(boxViewer3, caller))
                    {
                        priorities[1] = boxViewer2;
                        priorities[2] = boxViewer3;
                    }
                    else
                    {
                        priorities[1] = boxViewer3;
                        priorities[2] = boxViewer2;
                    }
                }
                else if (callerIndex == 2)
                {
                    priorities[1] = boxViewer1;
                    priorities[2] = boxViewer3;
                }
                else
                {
                    priorities[1] = boxViewer1;
                    priorities[2] = boxViewer2;
                }

                MakeValid(priorities[1], priorities[0]);
                MakeValid(priorities[2], priorities[0], priorities[1]);

                boxViewer1.SupressIndexChanged = false;
                boxViewer2.SupressIndexChanged = false;
                boxViewer3.SupressIndexChanged = false;
            }
            else
            {
            }
        }
Exemple #2
0
        public void OnGameSwitch(PokemonBoxViewer caller = null)
        {
            if (PokeManager.IsHoldingPokemon || PokeManager.HasSelection)
            {
                PokeManager.DropAll();
                PokeManager.ClearSelectedPokemon();
                PokeManager.RefreshUI();
            }

            if (!PokeManager.Settings.AllowDoubleBoxRows)
            {
                if (caller == null)
                {
                    caller = boxViewer1;
                }
                int callerIndex = GetIndex(caller);
                PokemonBoxViewer[] priorities = new PokemonBoxViewer[3];
                boxViewer1.SupressIndexChanged = true;
                boxViewer2.SupressIndexChanged = true;
                boxViewer3.SupressIndexChanged = true;

                priorities[0] = boxViewer1;
                if (callerIndex == 1)
                {
                    if (IsValid(boxViewer2, caller) || !IsValid(boxViewer3, caller))
                    {
                        priorities[1] = boxViewer2;
                        priorities[2] = boxViewer3;
                    }
                    else
                    {
                        priorities[1] = boxViewer3;
                        priorities[2] = boxViewer2;
                    }

                    boxViewer2.ComboBoxGames.ResetGameSaveVisibility();
                    boxViewer3.ComboBoxGames.ResetGameSaveVisibility();
                    if (GetNumRows(caller) == 1)
                    {
                        boxViewer2.ComboBoxGames.SetGameSaveVisible(GameIndex, false);
                        boxViewer3.ComboBoxGames.SetGameSaveVisible(GameIndex, false);
                    }
                }
                else if (callerIndex == 2)
                {
                    if (GetNumRows(caller) > 2)
                    {
                        priorities[1] = boxViewer3;
                        priorities[2] = boxViewer2;
                    }
                    else
                    {
                        priorities[1] = boxViewer2;
                        priorities[2] = boxViewer3;
                    }
                    //FindAvailableRow(priorities[1], priorities[1]);
                }
                else
                {
                    if (GetNumRows(caller) > 2)
                    {
                        priorities[1] = boxViewer2;
                        priorities[2] = boxViewer3;
                    }
                    else
                    {
                        priorities[1] = boxViewer3;
                        priorities[2] = boxViewer2;
                    }
                    //FindAvailableRow(priorities[1], priorities[1]);
                }

                MakeValid(priorities[1], priorities[0]);
                MakeValid(priorities[2], priorities[0], priorities[1]);

                boxViewer1.SupressIndexChanged = false;
                boxViewer2.SupressIndexChanged = false;
                boxViewer3.SupressIndexChanged = false;
            }
            else
            {
                boxViewer2.ComboBoxGames.ResetGameSaveVisibility();
                boxViewer3.ComboBoxGames.ResetGameSaveVisibility();
            }
        }