コード例 #1
0
        void SaveInstructionCodeClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();
            fileWindow.SetFileType("txt");
            fileWindow.OkClick += SaveInstructionCodeOk;
        }
コード例 #2
0
        static void SaveSetPropertySelectionOk(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();
            fileWindow.SetFileType("istx");
            fileWindow.OkClick += new GuiMessage(SaveSetFileWindowOk);
        }
コード例 #3
0
        void SaveActiveScene(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();
            fileWindow.SetFileType("scnx");
            fileWindow.OkClick += SaveActiveSceneOk;
        }
コード例 #4
0
ファイル: GuiData.cs プロジェクト: profexorgeek/FlatRedBall
        private static void XmlSeralizeObject(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();
            fileWindow.SetFileType("xml");

            fileWindow.OkClick += XmlSerializeObjectOk;
        }
コード例 #5
0
        void OpenFileWindowSaveScene(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();

            fileWindow.Filter = "Scene XML File (*.scnx)|*.scnx";

            fileWindow.OkClick += SaveSceneOk;
        }
コード例 #6
0
        public void OpenFileWindowSaveScene(Window callingWindow)
        {
            FileWindow tempFileWindow = GuiManager.AddFileWindow();

            //tempFileWindow.activityToExecute = "loadScene";
            tempFileWindow.SetToSave();
            tempFileWindow.Filter          = "SpriteEditor XML Scene (*.scnx)|*.scnx";
            tempFileWindow.CurrentFileType = "scnx";

            tempFileWindow.saveNameText = FileManager.RemoveExtension(FileManager.RemovePath(GameData.FileName));
            tempFileWindow.OkClick     += new GuiMessage(SaveSceneFileWindowOk);
        }
コード例 #7
0
ファイル: Menu.cs プロジェクト: profexorgeek/FlatRedBall
        void OpenFileWindowSaveShapeList(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();
            fileWindow.SetFileType("shcx");

            if (!string.IsNullOrEmpty(EditorData.LastLoadedShapeCollection))
            {
                fileWindow.SetDirectory(FileManager.GetDirectory(EditorData.LastLoadedShapeCollection));
                fileWindow.saveNameText = FileManager.RemoveExtension(FileManager.RemovePath(EditorData.LastLoadedShapeCollection));
            }

            fileWindow.OkClick += SaveShapeListOk;
        }
コード例 #8
0
ファイル: Menu.cs プロジェクト: profexorgeek/FlatRedBall
        private void SaveEmitterListZipClick(Window callingWindow)
        {
            FileWindow tempWindow = GuiManager.AddFileWindow();

            tempWindow.Filter          = "Emitter List Zip (*.emiz)|*.emiz";
            tempWindow.CurrentFileType = "emiz";
            tempWindow.saveNameText    = FileManager.RemovePath(EditorData.CurrentEmixFileName);

            if (!string.IsNullOrEmpty(EditorData.CurrentEmixFileName))
            {
                tempWindow.SetDirectory(FileManager.GetDirectory(EditorData.CurrentEmixFileName));
            }

            tempWindow.SetToSave();
            tempWindow.OkClick += SaveEmitterZipOk;
        }
コード例 #9
0
ファイル: Menu.cs プロジェクト: profexorgeek/FlatRedBall
        private void SaveEmitterArraysClick(FlatRedBall.Gui.Window callingWindow)
        {
            FileWindow tempWindow = GuiManager.AddFileWindow();

            tempWindow.Filter          = "XML Emitter (*.emix)|*.emix";
            tempWindow.CurrentFileType = "emix";
            tempWindow.saveNameText    = FileManager.RemovePath(EditorData.CurrentEmixFileName);

            if (!string.IsNullOrEmpty(EditorData.CurrentEmixFileName))
            {
                tempWindow.SetDirectory(FileManager.GetDirectory(EditorData.CurrentEmixFileName));
            }

            tempWindow.SetToSave();
            tempWindow.OkClick += SaveEmitterOk;
        }
コード例 #10
0
        void OpenFileWindowSaveNodeNetwork(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToSave();

            fileWindow.Filter = "Node Network Files (*.nntx)|*.nntx|XML files (*.xml)|*.xml";

            fileWindow.OkClick += SaveNodeNetworkOk;

            if (!string.IsNullOrEmpty(EditorData.LastLoadedFile))
            {
                string directory = FileManager.GetDirectory(EditorData.LastLoadedFile);

                fileWindow.SetDirectory(directory);
            }
        }
コード例 #11
0
        private static void ShowSpriteRigOptionsFileWindow(Window callingWindow)
        {
            FileWindow tempFileWindow = GuiManager.AddFileWindow();

            tempFileWindow.Filter          = "XML SpriteRig (*.srgx)|*.srgx";
            tempFileWindow.CurrentFileType = "srgx";
            tempFileWindow.SetToSave();
            tempFileWindow.OkClick += new GuiMessage(saveSpriteRig);
            ToggleButton relativeToggle = new ToggleButton(GuiManager.Cursor);

            tempFileWindow.AddWindow(relativeToggle);
            relativeToggle.Name = "scnRelativeAssets";
            relativeToggle.SetText("Not .scn-relative assets", ".scn-relative assets");
            relativeToggle.ScaleX = 9f;
            relativeToggle.SetPositionTL(22.5f, 6.5f);
            if (mAssetsRelativeToSpriteRig)
            {
                relativeToggle.Press();
            }
            else
            {
                relativeToggle.Unpress();
            }
        }
コード例 #12
0
        void KeyboardShortcuts()
        {
            if ((InputManager.ReceivingInput != null && InputManager.ReceivingInput.TakingInput) ||
                InputManager.ReceivingInputJustSet)
            {
                return;
            }


            KeyboardCameraControl();

            #region F for Frame or Focus

            if (InputManager.Keyboard.KeyPushed(Key.F))
            {
                if (CurrentSprites.Count != 0)
                {
                    CameraMethods.FocusOn(CurrentSprites[0]);
                }
                else if (CurrentPositionedModels.Count != 0)
                {
                    CameraMethods.FocusOn(CurrentPositionedModels[0]);
                }
            }

            #endregion

            #region Nudge control
            if (InputManager.Keyboard.KeyDown(Key.N))
            {
                GameData.Camera.XVelocity = GameData.Camera.YVelocity = GameData.Camera.ZVelocity = 0;
                if (GameData.EditorLogic.CurrentSprites.Count != 0)
                {
                    float distanceToMove = 1 / GameData.Camera.PixelsPerUnitAt((GameData.EditorLogic.CurrentSprites[0]).Z);


                    if (InputManager.Keyboard.KeyPushed(Key.Up))
                    {
                        (GameData.EditorLogic.CurrentSprites[0]).Y += distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Down))
                    {
                        (GameData.EditorLogic.CurrentSprites[0]).Y -= distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Left))
                    {
                        (GameData.EditorLogic.CurrentSprites[0]).X -= distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Right))
                    {
                        (GameData.EditorLogic.CurrentSprites[0]).X += distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Equals))
                    {
                        (GameData.EditorLogic.CurrentSprites[0]).Z += .01f;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Minus))
                    {
                        (GameData.EditorLogic.CurrentSprites[0]).Z -= .01f;
                    }
                }
                else if (CurrentSpriteFrames.Count != 0)
                {
                    float distanceToMove = 1 / GameData.Camera.PixelsPerUnitAt((GameData.EditorLogic.CurrentSpriteFrames[0]).Z);

                    if (InputManager.Keyboard.KeyPushed(Key.Up))
                    {
                        CurrentSpriteFrames[0].Y += distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Down))
                    {
                        CurrentSpriteFrames[0].Y -= distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Left))
                    {
                        CurrentSpriteFrames[0].X -= distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Right))
                    {
                        CurrentSpriteFrames[0].X += distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Equals))
                    {
                        CurrentSpriteFrames[0].Z += .01f;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Minus))
                    {
                        CurrentSpriteFrames[0].Z -= .01f;
                    }
                }
                else if (CurrentTexts.Count != 0)
                {
                    float distanceToMove = 1 / GameData.Camera.PixelsPerUnitAt((GameData.EditorLogic.CurrentTexts[0]).Z);

                    if (InputManager.Keyboard.KeyPushed(Key.Up))
                    {
                        CurrentTexts[0].Y += distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Down))
                    {
                        CurrentTexts[0].Y -= distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Left))
                    {
                        CurrentTexts[0].X -= distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Right))
                    {
                        CurrentTexts[0].X += distanceToMove;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Equals))
                    {
                        CurrentTexts[0].Z += .01f;
                    }
                    else if (InputManager.Keyboard.KeyPushed(Key.Minus))
                    {
                        CurrentTexts[0].Z -= .01f;
                    }
                }
            }
            #endregion

            #region tool key shortucts - move, rotate, scale, attach, detach, copy

            #region m - Move
            if (InputManager.Keyboard.KeyPushed(Key.M))
            {
                GuiData.ToolsWindow.MoveButton.Press();
            }
            #endregion

            #region r - Rotate
            if (InputManager.Keyboard.KeyPushed(Key.R))
            {
                GuiData.ToolsWindow.RotateButton.Press();
            }
            #endregion

            #region x - Scale
            if (InputManager.Keyboard.KeyPushed(Key.X))
            {
                GuiData.ToolsWindow.ScaleButton.Press();
            }
            #endregion

            #region a - Attach
            if (InputManager.Keyboard.KeyPushed(Key.A))
            {
                GuiData.ToolsWindow.attachSprite.Toggle();
            }
            #endregion

            #region d - Detach
            if (InputManager.Keyboard.KeyPushed(Key.D))
            {
                GuiData.ToolsWindow.detachSprite(null);
            }
            #endregion

            #region CTRL + c - Copy
            if (InputManager.Keyboard.ControlCPushed() &&
                (CurrentPositionedModels.Count != 0 || GameData.EditorLogic.CurrentSprites.Count != 0 || CurrentSpriteFrames.Count != 0 || CurrentTexts.Count != 0))
            {
                GuiData.ToolsWindow.DuplicateClick();
            }
            #endregion

            #endregion

            #region showing position by pressing C
            else if (InputManager.Keyboard.KeyPushed(Key.C))
            {
                if (GameData.showingCursorPosition)
                {
                    GameData.showingCursorPosition = false;
                }
                else
                {
                    GameData.showingCursorPosition = true;
                }
            }
            #endregion

            #region space - editing in solo mode
            if (InputManager.Keyboard.KeyPushed(Key.Space))
            {
                GameData.Cursor.ToggleSoloEdit();
            }
            #endregion

            #region DEL
            if (InputManager.Keyboard.KeyPushed(Key.Delete))
            {
                DeleteSelectedObject();
            }
            #endregion

            #region pressing shift to set scale dimention proportions
            if (InputManager.Keyboard.KeyPushed(Key.LeftShift) || InputManager.Keyboard.KeyPushed(Key.RightShift))
            {
                if (GameData.EditorLogic.CurrentSprites.Count != 0)
                {
                    xToY = (float)(GameData.EditorLogic.CurrentSprites[0].ScaleX / GameData.EditorLogic.CurrentSprites[0].ScaleY);
                }
                else if (CurrentSpriteFrames.Count != 0)
                {
                    xToY = CurrentSpriteFrames[0].ScaleX / CurrentSpriteFrames[0].ScaleY;
                }
            }
            #endregion

            #region file shortcuts

            #region CTRL + S
            if (InputManager.Keyboard.KeyPushed(Key.S) && (InputManager.Keyboard.KeyDown(Key.LeftControl) || (InputManager.Keyboard.KeyDown(Key.RightControl))))
            {
                SpriteEditor.Gui.GuiData.MenuStrip.SaveSceneClick(GameData.FileName);
            }
            #endregion

            #region CTRL + N
            if (InputManager.Keyboard.KeyPushed(Key.N) && (InputManager.Keyboard.KeyDown(Key.LeftControl) || (InputManager.Keyboard.KeyDown(Key.RightControl))))
            {
                SpriteEditor.Gui.MenuStrip.NewSceneClick(null);
            }
            #endregion

            #endregion

            #region Sys Rq/ Print Screen

            if (InputManager.Keyboard.KeyPushed(Key.SysRq))
            {
                FileWindow fw = GuiManager.AddFileWindow();
                fw.SetToSave();
                fw.OkClick += new GuiMessage(GameData.SetScreenshotFile);

                List <string> fileTypes = new List <string>();
                fileTypes.Add("bmp");
                fileTypes.Add("jpg");
                fileTypes.Add("tga");
                fileTypes.Add("png");
                fileTypes.Add("dds");

                fw.SetFileType(fileTypes);
                fw.CurrentFileType = "png";
            }
            #endregion
        }