Esempio n. 1
0
        public void keyHandler(KeyEventArgs e, bool down)
        {
            if (e.KeyCode == controls[0])
            {
                isUp = down;
            }
            else if (e.KeyCode == controls[1])
            {
                isDown = down;
            }
            else if (e.KeyCode == controls[2])
            {
                isLeft = down;
            }
            else if (e.KeyCode == controls[3])
            {
                isRight = down;
            }

            if (!down)
            {
                // Zooming
                if (e.KeyCode == controls[7])
                {
                    editor.getCamera().switchZoom();
                }
                else if (e.KeyCode == controls[8])
                {
                    // TODO - temp fix
                    main.setMode(Mode.MENU);
                }
            }
        }
Esempio n. 2
0
        public void doTask()
        {
            if (task != Task.TYPE)
            {
                frame.setIsTyping(false);
            }
            switch (task)
            {
            case Task.UNPAUSE:
                main.unpause();
                break;

            case Task.SET_MODE:
                Mode mode;
                Enum.TryParse(set, out mode);
                main.setMode(mode);
                break;

            case Task.CLOSE:
                main.Close();
                break;

            case Task.SET_PAUSE:
                if (main.getMode() != Mode.PAUSE)
                {
                    main.setMode(Mode.PAUSE);
                }
                main.setPauseFrame(set);
                break;

            case Task.SET_MENU:
                if (main.getMode() != Mode.MENU)
                {
                    main.setMode(Mode.MENU);
                }
                main.setMenuFrame(set);
                break;

            case Task.SWITCH_CONTROLS:
                main.getSettings().switchControlMode();
                List <Player> players = main.getLevel().getPlayers();
                players[0].setControls(
                    main.getSettings().getControlMode());

                if (players.Count > 1)
                {
                    players[1].setControls(1 -
                                           main.getSettings().getControlMode());
                }

                main.refreshPauseFrame();
                break;

            case Task.SWITCH_FOLLOW:
                main.getSettings().switchFollowMode(Int32.Parse(set));
                main.getLevel().setCamera(
                    main.getSettings().getFollowMode());
                main.refreshPauseFrame();
                break;

            case Task.SWITCH_PERIOD:
                main.getSettings().switchPeriod(Int32.Parse(set));
                main.applySettings();
                main.refreshPauseFrame();
                break;

            case Task.SWITCH_WINDOW:
                main.getSettings().switchWindowMode();
                main.applySettings();
                main.refreshPauseFrame();
                break;

            case Task.SWITCH_HUD:
                main.getSettings().switchHUDStatus();
                main.applySettings();
                main.refreshPauseFrame();
                break;

            case Task.TYPE:
                frame.setIsTyping(!frame.getIsTyping());
                break;

            case Task.SAVE_EDITOR:
                main.launchSaveEditor();
                break;
            }
        }
Esempio n. 3
0
 public void link()
 {
     main.setMode(linkTo);
 }