コード例 #1
0
        public static void openFileWindowLoadTexture(Window callingWindow)
        {
            FileWindow tempFileWindow = GuiManager.AddFileWindow();

            tempFileWindow.SetFileType("graphic");
            tempFileWindow.OkClick += new GuiMessage(loadTextureOk);
        }
コード例 #2
0
        void OnTextureButtonClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetFileType(FileWindow.FileWindowTypes.Graphics);
            fileWindow.OkClick += new GuiMessage(OnTextureLoadOk);
        }
コード例 #3
0
        public static void LoadInactiveSceneClick(Window callingWindow)
        {
            FileWindow tempFileWindow = GuiManager.AddFileWindow();

            tempFileWindow.SetFileType("scnx");
            tempFileWindow.OkClick += new GuiMessage(LoadInactiveSceneFileOk);
        }
コード例 #4
0
        public static void OpenFileWindowLoadSpriteRig(Window callingWindow)
        {
            FileWindow tempFileWindow = GuiManager.AddFileWindow();

            tempFileWindow.SetFileType("srgx");
            tempFileWindow.OkClick += new GuiMessage(LoadSpriteRigOk);
        }
コード例 #5
0
        public static void LoadSetClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetFileType("istx");
            fileWindow.OkClick += new GuiMessage(LoadSetFileWindowOk);
        }
コード例 #6
0
        public static void LoadScnxButtonClick(FlatRedBall.Gui.Window callingWindow)
        {
            FileWindow tempWindow = GuiManager.AddFileWindow();

            tempWindow.SetFileType("scnx");
            tempWindow.OkClick += new GuiMessage(LoadScnxFileWindowOK);
        }
コード例 #7
0
        private void OpenFileWindow(Window callingWindow)
        {
#if !SILVERLIGHT
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToLoad();

            if (string.IsNullOrEmpty(mDefaultDirectory) == false)
            {
                fileWindow.SetDirectory(mDefaultDirectory);
            }

            fileWindow.OkClick += FileWindowOkClick;

            fileWindow.SetFileType(mFileTypes);

            if (!string.IsNullOrEmpty(Text))
            {
                try
                {
                    string directory = FileManager.GetDirectory(Text);

                    if (System.IO.Directory.Exists(directory))
                    {
                        fileWindow.SetDirectory(directory);
                    }
                }
                catch
                {
                    // don't worry about it, this is just for convenience.
                }
            }
#endif
        }
コード例 #8
0
        void SaveInstructionCodeClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

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

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

            fileWindow.SetToSave();
            fileWindow.SetFileType("scnx");
            fileWindow.OkClick += SaveActiveSceneOk;
        }
コード例 #11
0
        void AddSpriteClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetToLoad();
            fileWindow.SetFileType("graphic and animation");
            fileWindow.OkClick += AddSpriteOk;
        }
コード例 #12
0
        private void AddSpriteFrameClick(Window callingWindow)
        {
            FileWindow tempFileWindow = GuiManager.AddFileWindow();

            tempFileWindow.SetFileType("graphic and animation");
            tempFileWindow.ShowLoadDirButton();
            tempFileWindow.betweenLoadFolder += new BetweenLoadFolder(MoveCameraToTheRight);
            tempFileWindow.OkClick           += new GuiMessage(this.AddSpriteFrameOk);
        }
コード例 #13
0
 private void TextureComboBoxSelect(Window callingWindow)
 {
     if (((ComboBox)callingWindow).Text == "From file. . .")
     {
         FileWindow fileWindow = GuiManager.AddFileWindow();
         fileWindow.SetFileType("graphic");
         fileWindow.SetToLoad();
     }
 }
コード例 #14
0
ファイル: GuiData.cs プロジェクト: profexorgeek/FlatRedBall
        private static void XmlSeralizeObject(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

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

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

            fileWindow.SetFileType("shcx");

            fileWindow.OkClick += LoadShapeListOk;

            if (!string.IsNullOrEmpty(EditorData.LastLoadedShapeCollection))
            {
                fileWindow.SetDirectory(FileManager.GetDirectory(EditorData.LastLoadedShapeCollection));
            }
        }
コード例 #16
0
ファイル: Menu.cs プロジェクト: profexorgeek/FlatRedBall
        private void LoadSceneClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetFileType("scnx");
            fileWindow.SetToLoad();
            fileWindow.OkClick += LoadSceneOk;

            if (EditorData.SplineList != null && !string.IsNullOrEmpty(EditorData.SplineList.Name))
            {
                fileWindow.SetDirectory(FileManager.GetDirectory(EditorData.SplineList.Name));
            }
        }
コード例 #17
0
        void AddAnimationClick(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            List <string> fileTypes = new List <string>(2);

            fileTypes.Add("waa");
            fileTypes.Add("wam");


            fileWindow.SetFileType(fileTypes);

            fileWindow.SetToLoad();
            fileWindow.OkClick += new GuiMessage(AddAnimationOK);
        }
コード例 #18
0
 public static void gridTextureAnimationButtonClick(Window callingWindow)
 {
     if (SESpriteGridManager.CurrentSpriteGrid != null)
     {
         FileWindow    tempFileWindow = GuiManager.AddFileWindow();
         List <string> fileTypes      = new List <string>();
         fileTypes.Add("ach");
         fileTypes.Add("bmp");
         fileTypes.Add("jpg");
         fileTypes.Add("png");
         fileTypes.Add("tga");
         tempFileWindow.SetFileType(fileTypes);
         tempFileWindow.OkClick += new GuiMessage(SpriteGridGuiMessages.loadGridAnimationTextureOk);
     }
 }
コード例 #19
0
        void OpenFileWindowLoadScene(Window callingWindow)
        {
            FileWindow fileWindow = GuiManager.AddFileWindow();

            fileWindow.SetFileType("scnx");

            fileWindow.OkClick += LoadSceneOk;

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

                fileWindow.SetDirectory(directory);
            }
        }
コード例 #20
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;
        }
コード例 #21
0
        private void OpenSongWindow(Window callingWindow)
        {
            FileWindow    fileWindow = GuiManager.AddFileWindow();
            List <string> fileTypes  = new List <string>();

            fileTypes.Add("mp3");
            fileTypes.Add("wav");
            // FRB MDX doesn't support m4a
            //fileTypes.Add("m4a");

            fileWindow.SetFileType(fileTypes);

            fileWindow.SetToLoad();

            fileWindow.OkClick += LoadSongOk;
        }
コード例 #22
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
        }