Esempio n. 1
0
        static GameScene()
        {
            Scene = new MirScene
            {
                Size = Settings.ScreenSize
            };

            Scene.BeforeDraw += Scene_BeforeDraw;
            Scene.MouseDown  += Scene_MouseDown;
            Scene.MouseUp    += Scene_MouseUp;
            Scene.MouseMove  += Scene_MouseMove;
            Scene.KeyDown    += Scene_KeyDown;
            Scene.KeyPress   += Scene_KeyPress;
            Scene.AfterDraw  += Scene_AfterDraw;

            for (int I = 0; I < OutputLines.Length; I++)
            {
                OutputLines[I] = new MirLabel
                {
                    AutoSize  = true,
                    BackColor = Color.Transparent,
                    ForeColor = Color.DarkGreen,
                    OutLine   = true,
                    Location  = new Point(20, 50 + I * 13),
                    Font      = new Font("Microsoft Sans Serif", 8F)
                }
            }
            ;

            MainPanel.Create();
            MiniMap.Create();
            ChatPanel.Create();
            BeltPanel.Create();
        }
Esempio 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;
            }
        }