Exemple #1
0
        public override void HandleInput(GameTime gameTime)
        {
            if (CancelButton.LeftClick())
            {
                NameInput.Clear();
                ExitScreen();
            }

            if (SaveButton.LeftClick() && NameInput.Text.Length > 0)
            {
                ConfirmationPopUp confirmSaveBox = new ConfirmationPopUp();
                confirmSaveBox.Accepted += ConfirmSaveBoxAccepted;
                ScreenManager.AddScreen(confirmSaveBox);
            }

            base.HandleInput(gameTime);
        }
Exemple #2
0
        public override void HandleInput(GameTime gameTime)
        {
            if (LoadButton.LeftClick())
            {
                if (SavedMapList.SelectedItem != null)
                {
                    ConfirmationPopUp confirmLoadBox = new ConfirmationPopUp();
                    confirmLoadBox.Accepted += ConfirmLoadBoxAccept;
                    ScreenManager.AddScreen(confirmLoadBox);
                }
            }
            else if (DeleteButton.LeftClick())
            {
                if (SavedMapList.SelectedItem != null)
                {
                    ConfirmationPopUp confirmDeleteBox = new ConfirmationPopUp();
                    confirmDeleteBox.Accepted += ConfirmDeletionBoxAccept;
                    ScreenManager.AddScreen(confirmDeleteBox);
                }
            }
            if (CancelButton.LeftClick())
            {
                ExitScreen();
            }

            SavedMapList.Update(this, gameTime);

            base.HandleInput(gameTime);
        }
Exemple #3
0
        public override void HandleInput(GameTime gameTime)
        {
            //KeyMouseReader.Update();
            EditorMapManager.Update();

            if (SaveButton.LeftClick())
            {
                ConfirmationPopUp ProccedToSaveScreenBox = new ConfirmationPopUp();

                if (!EditorMapManager.PlayerPlaced)
                    ProccedToSaveScreenBox = new ConfirmationPopUp("You have not placed the Player");
                else if (!EditorMapManager.GoalPlaced)
                    ProccedToSaveScreenBox = new ConfirmationPopUp("You have not place the Goal");
                else if (!EditorMapManager.HasSufficentCollisionFlags)
                    ProccedToSaveScreenBox = new ConfirmationPopUp("There is no or very few collisionflags");
                else
                {
                    ScreenManager.AddScreen(new SaveMapScreen(EditorMapManager));
                    return;
                }

                ProccedToSaveScreenBox.Accepted = ProccedToSaveScreenAccepted;
                ScreenManager.AddScreen(ProccedToSaveScreenBox);
            }

            else if (LoadButton.LeftClick())
                ScreenManager.AddScreen(new LoadMapScreen(EditorMapManager));

            else if (ExitButton.LeftClick())
                LoadingScreen.Load(ScreenManager, true, new BackgroundScreen(), new MainMenuScreen());

            else if (TileLayerButton.LeftClick())
                ChangeEditMode(0);
            else if (CollisionLayerButton.LeftClick())
                ChangeEditMode(1);
            else if (JumpLayerButton.LeftClick())
                ChangeEditMode(2);

            else if (KeyMouseReader.KeyClick(Microsoft.Xna.Framework.Input.Keys.D4))
                ChangeEditMode(4);

            if (EditMode == 0)
            {
                if (BGLayerButton.LeftClick())
                    EditorMapManager.SetSelectedLayer(0);
                else if (MiddleLayerButton.LeftClick())
                    EditorMapManager.SetSelectedLayer(1);
                else if (FGLayerButton.LeftClick())
                    EditorMapManager.SetSelectedLayer(2);
            }

            for (int i = 0; i < ToolButtons.Count; i++)
            {
                ToolButtons[i].Update(this, gameTime);

                if (ToolButtons[i].LeftClick())
                    EditorMapManager.SetCursorTexture(i);
            }

            base.HandleInput(gameTime);
        }