Exemplo n.º 1
0
 static void InventoryButton_Click(object sender, EventArgs e)
 {
     if (InventoryDialog.Window.Visible)
     {
         InventoryDialog.Hide();
     }
     else
     {
         InventoryDialog.Show();
     }
 }
Exemplo n.º 2
0
        static void Scene_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Up:
                ChatPanel.StartIndex--;
                ChatPanel.UpdateChatList();
                break;

            case Keys.Down:
                ChatPanel.StartIndex++;
                ChatPanel.UpdateChatList();
                break;

            case Keys.V:
                MiniMap.Toggle();
                break;

            case Keys.F9:
            case Keys.I:
                if (InventoryDialog.Window.Visible)
                {
                    InventoryDialog.Hide();
                }
                else
                {
                    InventoryDialog.Show();
                }
                break;

            case Keys.F10:
            case Keys.C:
                if (CharacterDialog.Window.Visible && CharacterDialog.CharacterPage.Visible)
                {
                    CharacterDialog.Hide();
                }
                else
                {
                    CharacterDialog.Show();
                    CharacterDialog.CharacterButton_Click(null, EventArgs.Empty);
                }
                break;

            case Keys.F11:
            case Keys.S:
                if (CharacterDialog.Window.Visible && CharacterDialog.SkillPage.Visible)
                {
                    CharacterDialog.Hide();
                }
                else
                {
                    CharacterDialog.Show();
                    CharacterDialog.SkillButton_Click(null, EventArgs.Empty);
                }
                break;

            case Keys.Escape:
                InventoryDialog.Hide();
                CharacterDialog.Hide();
                break;

            case Keys.Tab:
                if (Main.Timer.ElapsedMilliseconds > Main.PickUpTime)
                {
                    Main.PickUpTime = Main.Timer.ElapsedMilliseconds + 200;
                    for (int I = 0; I < ItemObject.ItemList.Count; I++)
                    {
                        if (ItemObject.ItemList[I].Location == MapObject.User.Location)
                        {
                            OutBound.PickUp();
                            return;
                        }
                    }
                }
                break;

            case Keys.X:
                if (!Alt)
                {
                    break;
                }
                LogOut();
                break;

            case Keys.Q:
                if (!Alt)
                {
                    break;
                }
                QuitGame();
                break;

            case Keys.Z:
                if (Ctrl)
                {
                    BeltPanel.Flip();
                }
                else
                {
                    if (BeltPanel.Window.Visible)
                    {
                        BeltPanel.Hide();
                    }
                    else
                    {
                        BeltPanel.Show();
                    }
                }
                break;

            case Keys.NumPad1:
            case Keys.D1:
                if (Main.Time > Main.UseItemTime)
                {
                    BeltPanel.Grid[0].UseItem();
                }
                break;

            case Keys.NumPad2:
            case Keys.D2:
                if (Main.Time > Main.UseItemTime)
                {
                    BeltPanel.Grid[1].UseItem();
                }
                break;

            case Keys.NumPad3:
            case Keys.D3:
                if (Main.Time > Main.UseItemTime)
                {
                    BeltPanel.Grid[2].UseItem();
                }
                break;

            case Keys.NumPad4:
            case Keys.D4:
                if (Main.Time > Main.UseItemTime)
                {
                    BeltPanel.Grid[3].UseItem();
                }
                break;

            case Keys.NumPad5:
            case Keys.D5:
                if (Main.Time > Main.UseItemTime)
                {
                    BeltPanel.Grid[4].UseItem();
                }
                break;

            case Keys.NumPad6:
            case Keys.D6:
                if (Main.Time > Main.UseItemTime)
                {
                    BeltPanel.Grid[5].UseItem();
                }
                break;
            }
        }