Exemplo n.º 1
0
        public void EditorInput()
        {
            InputClient input = Systems.input;

            // Release TempTool Control every tick:
            if (EditorTools.tempTool != null)
            {
                EditorTools.ClearTempTool();
            }

            // Get the Local Keys Held Down
            Keys[] localKeys = input.GetAllLocalKeysDown();
            if (localKeys.Length == 0)
            {
                return;
            }

            // Key Presses that AREN'T using control keys:
            if (!input.LocalKeyDown(Keys.LeftControl) && !input.LocalKeyDown(Keys.RightControl))
            {
                // Func Tool Key Binds
                if (FuncTool.funcToolKey.ContainsKey(localKeys[0]))
                {
                    EditorTools.SetTempTool(FuncTool.funcToolMap[FuncTool.funcToolKey[localKeys[0]]]);
                }

                // Tile Tool Key Binds
                else if (EditorUI.currentSlotGroup > 0)
                {
                    this.CheckTileToolKeyBinds(localKeys[0]);
                }
            }

            // Open Wheel Menu
            if (input.LocalKeyPressed(Keys.Tab))
            {
                this.editorUI.contextMenu.OpenMenu();
            }

            // Button Mappings
            else if (input.LocalKeyPressed(Keys.P))
            {
                FuncButton.funcButtonMap[(byte)FuncButtonEnum.Play].ActivateFuncButton();
            }

            // If holding shift down, increase camera movement speed by 3.
            byte moveMult = (input.LocalKeyDown(Keys.LeftShift) || input.LocalKeyDown(Keys.RightShift)) ? (byte)3 : (byte)1;

            // Camera Movement
            Systems.camera.MoveWithInput(Systems.localServer.MyPlayer.input, moveMult);
            Systems.camera.StayBoundedAuto(350, 250);
        }