Exemplo n.º 1
0
        public override void ControlHandle(Key k)
        {
            switch (k)
            {
            case Key.Up:
                if (_option > 0)
                {
                    _option--;
                }
                if (_topRow > _option)
                {
                    _topRow--;
                }
                break;

            case Key.Down:
                if (_option < _equipment.Count - 1)
                {
                    _option++;
                }
                if (_topRow < _option - rows + 1)
                {
                    _topRow++;
                }
                break;

            case Key.Circle:
                int slot = _equipment[_option].Slot;
                EquipTop.Instance.Changed = true;
                switch (EquipTop.Instance.Option)
                {
                case 0:
                    Weapon.SwapMateria(Selected.Weapon, (Weapon)_equipment[_option].Item, Selected);
                    Selected.Weapon = (Weapon)Inventory.SwapOut(Selected.Weapon, slot);
                    break;

                case 1:
                    Armor.SwapMateria(Selected.Armor, (Armor)_equipment[_option].Item, Selected);
                    Inventory.AddToInventory(Selected.Armor);
                    Inventory.DecreaseCount(slot);
                    Selected.Armor = (Armor)_equipment[_option].Item;
                    break;

                case 2:
                    if (Selected.Accessory.Name != null)
                    {
                        Inventory.AddToInventory(Selected.Accessory);
                    }
                    Inventory.DecreaseCount(slot);
                    Selected.Accessory = (Accessory)_equipment[_option].Item;
                    break;
                }
                MenuScreen.EquipScreen.ChangeToDefaultControl();
                break;

            case Key.X:
                MenuScreen.EquipScreen.ChangeToDefaultControl();
                break;

            default:
                break;
            }
        }