public void Notify(ControllerCommand cmd)
        {
            if (controlledSpellbook != null)
            {
                switch (cmd)
                {
                case ControllerCommand.Spellbook_SelectNext:
                    descriptionList.SelectNext();
                    break;

                case ControllerCommand.Spellbook_SelectPrevious:
                    descriptionList.SelectPrevious();
                    break;

                case ControllerCommand.Spellbook_SelectNextPage:
                    descriptionList.SelectNextPage();
                    break;

                case ControllerCommand.Spellbook_SelectPreviousPage:
                    descriptionList.SelectPreviousPage();
                    break;

                case ControllerCommand.Spellbook_Close:
                    ValidIndex = false;
                    this.Hide();
                    gamePanel.Show();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Spellbook_Pick:
                    ValidIndex = true;
                    this.Hide();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Spellbook_Open:
                    Opened = true;
                    gamePanel.Hide();
                    this.Show();
                    descriptionList.Items = controlledSpellbook.ToList();
                    this.Refresh();
                    this.Focus();
                    break;
                }
            }

            descriptionList.Refresh();
        }
Ejemplo n.º 2
0
        public void Notify(ControllerCommand cmd)
        {
            RapidOperation = RapidOperation.None;

            if (controlledBackpack != null)
            {
                switch (cmd)
                {
                case ControllerCommand.Backpack_SelectNext:
                    descriptionList.SelectNext();
                    break;

                case ControllerCommand.Backpack_SelectPrevious:
                    descriptionList.SelectPrevious();
                    break;

                case ControllerCommand.Backpack_SelectNextPage:
                    descriptionList.SelectNextPage();
                    break;

                case ControllerCommand.Backpack_SelectPreviousPage:
                    descriptionList.SelectPreviousPage();
                    break;

                case ControllerCommand.Backpack_Close:
                    ValidIndex = false;
                    this.Hide();
                    gamePanel.Show();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Backpack_Pick:
                    ValidIndex = true;
                    this.Hide();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Backpack_Open:
                    Opened = true;
                    gamePanel.Hide();
                    this.Show();
                    descriptionList.Items = controlledBackpack.ToList();
                    this.Refresh();
                    this.Focus();
                    break;

                case ControllerCommand.Backpack_PutOnArmor:
                    RapidOperation = RapidOperation.PutOn;
                    ValidIndex     = true;
                    this.Hide();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Backpack_EmbraceShield:
                    RapidOperation = RapidOperation.Embrace;
                    ValidIndex     = true;
                    this.Hide();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Backpack_UseItem:
                    RapidOperation = RapidOperation.Use;
                    ValidIndex     = true;
                    this.Hide();
                    FocusOnMap();
                    Opened = false;
                    break;

                case ControllerCommand.Backpack_HandleWeapon:
                    RapidOperation = RapidOperation.Handle;
                    ValidIndex     = true;
                    this.Hide();
                    FocusOnMap();
                    Opened = false;
                    break;
                }
            }

            descriptionList.Refresh();
        }