public static void openFileWindowLoadTexture(Window callingWindow) { FileWindow tempFileWindow = GuiManager.AddFileWindow(); tempFileWindow.SetFileType("graphic"); tempFileWindow.OkClick += new GuiMessage(loadTextureOk); }
void OnTextureButtonClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetFileType(FileWindow.FileWindowTypes.Graphics); fileWindow.OkClick += new GuiMessage(OnTextureLoadOk); }
public static void LoadInactiveSceneClick(Window callingWindow) { FileWindow tempFileWindow = GuiManager.AddFileWindow(); tempFileWindow.SetFileType("scnx"); tempFileWindow.OkClick += new GuiMessage(LoadInactiveSceneFileOk); }
public static void OpenFileWindowLoadSpriteRig(Window callingWindow) { FileWindow tempFileWindow = GuiManager.AddFileWindow(); tempFileWindow.SetFileType("srgx"); tempFileWindow.OkClick += new GuiMessage(LoadSpriteRigOk); }
public static void LoadSetClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetFileType("istx"); fileWindow.OkClick += new GuiMessage(LoadSetFileWindowOk); }
public static void LoadScnxButtonClick(FlatRedBall.Gui.Window callingWindow) { FileWindow tempWindow = GuiManager.AddFileWindow(); tempWindow.SetFileType("scnx"); tempWindow.OkClick += new GuiMessage(LoadScnxFileWindowOK); }
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 }
void SaveInstructionCodeClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToSave(); fileWindow.SetFileType("txt"); fileWindow.OkClick += SaveInstructionCodeOk; }
static void SaveSetPropertySelectionOk(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToSave(); fileWindow.SetFileType("istx"); fileWindow.OkClick += new GuiMessage(SaveSetFileWindowOk); }
void SaveActiveScene(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToSave(); fileWindow.SetFileType("scnx"); fileWindow.OkClick += SaveActiveSceneOk; }
void AddSpriteClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToLoad(); fileWindow.SetFileType("graphic and animation"); fileWindow.OkClick += AddSpriteOk; }
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); }
private void TextureComboBoxSelect(Window callingWindow) { if (((ComboBox)callingWindow).Text == "From file. . .") { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetFileType("graphic"); fileWindow.SetToLoad(); } }
private static void XmlSeralizeObject(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToSave(); fileWindow.SetFileType("xml"); fileWindow.OkClick += XmlSerializeObjectOk; }
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)); } }
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)); } }
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); }
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); } }
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); } }
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; }
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; }
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 }