예제 #1
0
        public void FrmMainGame_KeyDown(object sender, KeyEventArgs e)
        {
            if (ChatModule.ChatInput.ProcessKey(e))
            {
                if (e.KeyCode == Keys.Enter)
                {
                    C_GameLogic.HandlePressEnter();
                }
            }

            if (ChatModule.ChatInput.Active)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    C_GameLogic.HandlePressEnter();
                }
            }
            else
            {
                if (e.KeyCode == Keys.S)
                {
                    C_UpdateUI.VbKeyDown = true;
                }
                if (e.KeyCode == Keys.W)
                {
                    C_UpdateUI.VbKeyUp = true;
                }
                if (e.KeyCode == Keys.A)
                {
                    C_UpdateUI.VbKeyLeft = true;
                }
                if (e.KeyCode == Keys.D)
                {
                    C_UpdateUI.VbKeyRight = true;
                }
                if (e.KeyCode == Keys.Down)
                {
                    C_UpdateUI.VbKeyDown = true;
                }
                if (e.KeyCode == Keys.Up)
                {
                    C_UpdateUI.VbKeyUp = true;
                }
                if (e.KeyCode == Keys.Left)
                {
                    C_UpdateUI.VbKeyLeft = true;
                }
                if (e.KeyCode == Keys.Right)
                {
                    C_UpdateUI.VbKeyRight = true;
                }

                if (e.KeyCode == Keys.ShiftKey)
                {
                    C_UpdateUI.VbKeyShift = true;
                }
                if (e.KeyCode == Keys.ControlKey)
                {
                    C_UpdateUI.VbKeyControl = true;
                }
                if (e.KeyCode == Keys.Alt)
                {
                    C_UpdateUI.VbKeyAlt = true;
                }

                if (e.KeyCode == Keys.Space)
                {
                    C_GameLogic.CheckMapGetItem();
                }
            }
        }
예제 #2
0
        public void Picscreen_KeyDown(object sender, KeyEventArgs e)
        {
            int num = 0;

            if (e.KeyCode == Keys.S)
            {
                C_UpdateUI.VbKeyDown = true;
            }
            if (e.KeyCode == Keys.W)
            {
                C_UpdateUI.VbKeyUp = true;
            }
            if (e.KeyCode == Keys.A)
            {
                C_UpdateUI.VbKeyLeft = true;
            }
            if (e.KeyCode == Keys.D)
            {
                C_UpdateUI.VbKeyRight = true;
            }
            if (e.KeyCode == Keys.ShiftKey)
            {
                C_UpdateUI.VbKeyShift = true;
            }
            if (e.KeyCode == Keys.ControlKey)
            {
                C_UpdateUI.VbKeyControl = true;
            }
            if (e.KeyCode == Keys.Alt)
            {
                C_UpdateUI.VbKeyAlt = true;
            }

            //hotbar
            if (e.KeyCode == Keys.NumPad1)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[1].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(1);
                }
            }
            if (e.KeyCode == Keys.NumPad2)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[2].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(2);
                }
            }
            if (e.KeyCode == Keys.NumPad3)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[3].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(3);
                }
            }
            if (e.KeyCode == Keys.NumPad4)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[4].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(4);
                }
            }
            if (e.KeyCode == Keys.NumPad5)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[5].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(5);
                }
            }
            if (e.KeyCode == Keys.NumPad6)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[6].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(6);
                }
            }
            if (e.KeyCode == Keys.NumPad7)
            {
                num = C_Types.Player[C_Variables.Myindex].Hotbar[7].Slot;

                if (num != 0)
                {
                    C_HotBar.SendUseHotbarSlot(7);
                }
            }

            //admin
            if (e.KeyCode == Keys.Insert)
            {
                if (C_Types.Player[C_Variables.Myindex].Access > 0)
                {
                    C_NetworkSend.SendRequestAdmin();
                }
            }
            //hide gui
            if (e.KeyCode == Keys.F10)
            {
                C_Variables.HideGui = !C_Variables.HideGui;
            }

            if (e.KeyCode == Keys.Enter)
            {
                ChatModule.ChatInput.ProcessKey(e);
                C_GameLogic.HandlePressEnter();
                C_GameLogic.CheckMapGetItem();
            }
        }