private void emitAllClick(FlatRedBall.Gui.Window callingWindow) { foreach (Emitter emitter in EditorData.Emitters) { emitter.Emit(); } }
void toStartButtonClick(Window callingWindow) { if (ToStartClick != null) { ToStartClick(this); } }
void OnSetButtonClick(Window callingWindow) { if (SetButtonClick != null) { SetButtonClick(this); } }
void OnEditButtonClick(Window callingWindow) { if (EditButtonClick != null) { EditButtonClick(this); } }
void SaveInstructionCodeClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToSave(); fileWindow.SetFileType("txt"); fileWindow.OkClick += SaveInstructionCodeOk; }
void TextBoxEnter(Window callingWindow) { AddText(mTextBox.Text); mTextBox.Text = ""; Input.InputManager.ReceivingInput = mTextBox; }
private void emitCurrentClick(FlatRedBall.Gui.Window callingWindow) { if (AppState.Self.CurrentEmitter != null) { AppState.Self.CurrentEmitter.Emit(null); } }
public static void SpriteYPosBoxGuiChange(Window callingWindow) { if(EditorData.EditorLogic.CurrentSprites.Count == 0) return; EditorData.EditorLogic.CurrentSprites[0].Y = ((UpDown)callingWindow).CurrentValue; }
void ComboBoxItemClick(Window callingWindow) { if (ItemSelect != null) { ItemSelect(this); } }
void SetChildrenWindowPositionsAndScales(Window callingWindow) { mAllProperties.ScaleX = (ScaleX - 1.5f) / 2.0f; mAllProperties.ScaleY = ScaleY - 3.9f; mAllProperties.X = mAllProperties.ScaleX + .7f; mAllProperties.Y = 1.7f + mAllProperties.ScaleY; mPropertiesToSave.ScaleX = mAllProperties.ScaleX; mPropertiesToSave.ScaleY = mAllProperties.ScaleY; mPropertiesToSave.X = (ScaleX * 2) - mPropertiesToSave.ScaleX - .7f; mPropertiesToSave.Y = mAllProperties.Y; mOkButton.Y = ScaleY * 2 - 1.5f; mCancelButton.Y = ScaleY * 2 - 1.5f; mCancelButton.X = ScaleX * 2 - .7f - mCancelButton.ScaleX; mOkButton.X = mCancelButton.X - mCancelButton.ScaleX - .5f - mOkButton.ScaleX; mAllPropertiesDisplay.X = .7f; mAllPropertiesDisplay.Y = 1; mPropertiesToSaveDisplay.X = mPropertiesToSave.X - mPropertiesToSave.ScaleX; mPropertiesToSaveDisplay.Y = 1; mUseAllButton.X = mAllProperties.X; mUseAllButton.ScaleX = mAllProperties.ScaleX; mUseAllButton.Y = this.ScaleY * 2 - 4.8f; }
private void ShiftSceneOk(Window callingWindow) { if (OkClick != null) { OkClick(this); } }
void playButtonClick(Window callingWindow) { if (PlayClick != null) { PlayClick(this); } }
void RestoreToStateBefore(Window callingWindow) { if (this.mCursor.PrimaryDown && this.mCursor.WindowPushed == this) { this.ButtonPushedState = mStateBeforePrimaryPush; } }
void WarnAboutSavingScene(Window callingWindow) { string message = "You are attempting to save a Scene (.scnx). Scenes do not include any node network information. If you are trying to save a node network, select the Save Node Network menu item"; OkCancelWindow ocw = GuiManager.ShowOkCancelWindow(message, "Warning"); ocw.OkClick += OpenFileWindowSaveScene; }
void ScaleAllPolygons(Window callingWindow) { Window polyScaleWindow = GuiManager.AddWindow(); polyScaleWindow.Name = "Scale All Polygons"; polyScaleWindow.ScaleX = 10f; polyScaleWindow.ScaleY = 4f; polyScaleWindow.HasMoveBar = true; polyScaleWindow.HasCloseButton = true; UpDown scaleBox = new UpDown(mCursor); polyScaleWindow.AddWindow(scaleBox); scaleBox.Name = "scale"; scaleBox.CurrentValue = 1f; scaleBox.ScaleX = 9f; scaleBox.X = 10f; scaleBox.Y = Window.MoveBarHeight; Button okButton = new Button(mCursor); polyScaleWindow.AddWindow(okButton); okButton.Text = "Set Scale"; okButton.ScaleX = 9f; okButton.X = 10f; okButton.Y = scaleBox.Y + scaleBox.ScaleY * 2f; okButton.Click += ScalePolygonsOK; }
public static void LoadScnxButtonClick(FlatRedBall.Gui.Window callingWindow) { FileWindow tempWindow = GuiManager.AddFileWindow(); tempWindow.SetFileType("scnx"); tempWindow.OkClick += new GuiMessage(LoadScnxFileWindowOK); }
private void RemovalOfWatchedWindow(Window callingWindow) { IObjectDisplayer asObjectDisplayer = callingWindow as IObjectDisplayer; GuiManager.RemoveWindow(callingWindow); if (asObjectDisplayer.ObjectDisplayingAsObject != null && mObjectDisplayers.ContainsKey(asObjectDisplayer.ObjectDisplayingAsObject)) { mObjectDisplayers.Remove(asObjectDisplayer.ObjectDisplayingAsObject); } else { // We still need to see if this Window is contained in this dictionary even // if the previous if statement fails. The reason for this is because of value // and immutable types. For example, a String PropertyGrid might open up for the // value "". Afterwards, the user changes the value and then double-clicks a list // to open a new PropertyGrid. Since the string has changed, then asObjectDisplayer.ObjectDisplayingAsObject // will no longer equal the "" string so the Window will never be removed when it should be. object keyToRemove = null; foreach (KeyValuePair<object, IObjectDisplayer> kvp in mObjectDisplayers) { if (kvp.Value == asObjectDisplayer) { keyToRemove = kvp.Key; break; } } if (keyToRemove != null) { mObjectDisplayers.Remove(keyToRemove); } } if (mWindowFamilies.ContainsValue(asObjectDisplayer)) { // Remove the object by its value IObjectDisplayer keyToRemove = null; foreach (KeyValuePair<IObjectDisplayer, IObjectDisplayer> kvp in mWindowFamilies) { if (kvp.Value == asObjectDisplayer) { keyToRemove = kvp.Key; break; } } if (keyToRemove != null) { mWindowFamilies.Remove(keyToRemove); } } }
void OnOkButtonClick(Window callingWindow) { if (OkClick != null) OkClick(this); GuiManager.RemoveWindow(this); }
void AddSpriteClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToLoad(); fileWindow.SetFileType("graphic and animation"); fileWindow.OkClick += AddSpriteOk; }
//public Button AddKeyframeListButton //{ // get { return mAddKeyframeListButton; } //} #endregion #region Event Methods private void AddKeyframeListClick(Window callingWindow) { if (EditorData.EditorLogic.CurrentInstructionSet == null) { GuiManager.ShowMessageBox("Currently the InstructionEditor is under \"Current'\" editing mode." + " To add an Animation, you must have a selected object first.", "Error"); return; } TextInputWindow tiw = GuiManager.ShowTextInputWindow("Enter a name for the new Animation:", "Enter name"); if (GuiData.TimeLineWindow.InstructionMode == InstructionMode.Current) { if (EditorData.EditorLogic.CurrentInstructionSet != null) { tiw.Text = "Keyframe List " + EditorData.EditorLogic.CurrentInstructionSet.Count; } else { tiw.Text = "Keyframe List " + 0; } } else { tiw.Text = "Animation " + EditorData.GlobalInstructionSets.Count; } tiw.OkClick += new GuiMessage(AddKeyframeListOk); }
private void ShowObjectDisplayWindowForSelectedObject(Window callingWindow) { if (SelectedObject != null) { GuiManager.ObjectDisplayManager.GetObjectDisplayerForObject(SelectedObject); } }
void SaveActiveScene(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToSave(); fileWindow.SetFileType("scnx"); fileWindow.OkClick += SaveActiveSceneOk; }
public void ExitOk(Window callingWindow) { #if FRB_XNA FlatRedBallServices.Game.Exit(); #else GameForm.Exit(form); #endif }
void LoadNodeNetworkClick(Window callingWindow) { FileWindow fileWindow = GuiManager.AddFileWindow(); fileWindow.SetToLoad(); fileWindow.Filter = "NodeNetwork XML File (*.nntx)|*.nntx"; fileWindow.OkClick += new GuiMessage(OnLoadNodeNetworkOk); }
void CloseNodeNetworkClick(Window callingWindow) { if (mNodeNetwork != null) { mNodeNetwork.Visible = false; mNodeNetwork = null; } }
void mAnimationTime_onGUIChange(Window callingWindow) { if (mAnimationController != null) { mAnimationController.ElapsedTime = ((TimeLine)callingWindow).CurrentValue; } }
void OkButtonClick(Window callingWindow) { if (OkClick != null) OkClick(this); Visible = false; this.mCursor.WindowClosing = this; }
public static void LoadEmittersClick(FlatRedBall.Gui.Window callingWindow) { FileWindow tempWindow = GuiManager.AddFileWindow(); tempWindow.Filter = "XML Emitter (*.emix)|*.emix"; tempWindow.CurrentFileType = "emix"; tempWindow.OkClick += new GuiMessage(LoadEmitterOK); }
private static void ClickShowAssemblyTypes(Window callingWindow) { mAssemblyTypeListDisplayWindow.Visible = true; GuiManager.BringToFront(mAssemblyTypeListDisplayWindow); mAssemblyTypeListDisplayWindow.ListShowing = EditorData.EditorLogic.CurrentAssembly.GetTypes(); }
protected override void SelectCameraConfiguration(Window callingWindow) { base.SelectCameraConfiguration(callingWindow); UpdateBounds(); UpdateDisplayedProperties(); }
static void AdvancedClick(Window callingWindow) { mTypesToLoad = new TypesToLoad(); mLastAsclw = new AdvancedShapeCollectionLoadingWindow( GuiManager.Cursor, CreateMbmb(mFileNameToLoad), mTypesToLoad); GuiManager.AddWindow(mLastAsclw); }
void StopPushed(Window callingWindow) { // Not sure if this'll work in the future, but for now this'll stop everything. InstructionManager.PauseEngine(false); playButton.Unpress(); GuiData.TimeLineWindow.IsPlaying = false; }
private void LoadSceneOk(Window callingWindow) { FileWindow asFileWindow = callingWindow as FileWindow; string fileName = asFileWindow.Results[0]; EditorData.LoadScene(fileName); }
public void addEmitterClick(FlatRedBall.Gui.Window callingWindow) { TextInputWindow tempWindow = GuiManager.ShowTextInputWindow("Enter a name for the new Emitter", "Add Particle"); tempWindow.Text = "Emitter" + NumberOfEmittersCreated; NumberOfEmittersCreated++; tempWindow.OkClick += new GuiMessage(addEmitterOkClick); }
public static void ShiftKeyframeTimesButtonClick(Window callingWindow) { if (EditorData.EditorLogic.CurrentSprites.Count == 0) return; TextInputWindow tiw = GuiManager.ShowTextInputWindow("Shift how many milliseconds?", EditorData.EditorLogic.CurrentSprites[0].Name); tiw.OkClick += new GuiMessage(ShiftKeyFrameTextInputOk); tiw.format = TextBox.FormatTypes.Decimal; }
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; }
public void addEmitterOkClick(FlatRedBall.Gui.Window callingWindow) { Emitter newEmitter = new Emitter(); SpriteManager.AddEmitter(newEmitter); ShapeManager.AddPolygon(newEmitter.EmissionBoundary); EditorData.SetDefaultValuesOnEmitter(newEmitter); EditorData.Emitters.Add(newEmitter); newEmitter.Name = ((TextInputWindow)callingWindow).Text; newEmitter.Texture = FlatRedBallServices.Load <Texture2D>("content/redball.bmp", AppState.Self.PermanentContentManager); }
public void EmitterArrayListBoxClick(FlatRedBall.Gui.Window callingWindow) { ListBoxBase asListBoxBase = callingWindow as ListBoxBase; EditorData.SelectEmitter((Emitter)asListBoxBase.GetFirstHighlightedObject()); }
private void clearAllButtonClick(FlatRedBall.Gui.Window callingWindow) { SpriteManager.RemoveAllParticleSprites(); }
public static void NewWorkspace(FlatRedBall.Gui.Window callingWindow) { // TODO: Support unloading Scene; EditorData.CreateNewWorkspace(); }
public static void LoadEmitterOK(FlatRedBall.Gui.Window callingWindow) { string fileName = ((FileWindow)callingWindow).Results[0]; AppCommands.Self.File.LoadEmitters(fileName); }
public static void LoadScnxFileWindowOK(FlatRedBall.Gui.Window callingWindow) { EditorData.LoadScene(((FileWindow)callingWindow).Results[0]); }
private void SaveEmitterOk(FlatRedBall.Gui.Window callingWindow) { string fileName = ""; if (callingWindow is FileWindow) { fileName = ((FileWindow)callingWindow).Results[0]; mLastFileName = fileName; } else { fileName = mLastFileName; } #region Get all of the not-relative textures mTexturesNotRelative.Clear(); mAnimationChainListsNotRelative.Clear(); string pathOfFile = FileManager.GetDirectory(fileName); foreach (Emitter emitter in EditorData.Emitters) { if (emitter.Texture != null && !FileManager.IsRelativeTo(emitter.Texture.Name, pathOfFile) && !mTexturesNotRelative.Contains(emitter.Texture)) { mTexturesNotRelative.Add(emitter.Texture); } if (emitter.ParticleBlueprint.AnimationChains != null && string.IsNullOrEmpty(emitter.ParticleBlueprint.AnimationChains.Name) == false && !FileManager.IsRelativeTo(emitter.ParticleBlueprint.AnimationChains.Name, pathOfFile) && !mAnimationChainListsNotRelative.Contains(emitter.ParticleBlueprint.AnimationChains)) { mAnimationChainListsNotRelative.Add(emitter.ParticleBlueprint.AnimationChains); } } #endregion mLastFileName = fileName; string message = "The following file has the following non-relative references\n" + fileName; CopyTexturesMultiButtonMessageBox mbmb = new CopyTexturesMultiButtonMessageBox(); mbmb.Text = message; mbmb.SaveClick += CopyAssetsToFileFolder; //mbmb.AddButton("Cancel Save", null); //mbmb.AddButton("Copy textures to relative and reference copies.", new GuiMessage(CopyAssetsToFileFolder)); foreach (Texture2D texture in mTexturesNotRelative) { mbmb.AddItem(texture.Name); } foreach (AnimationChainList animationChainList in mAnimationChainListsNotRelative) { mbmb.AddItem(animationChainList.Name); } if (EditorData.EditorProperties.FilesToMakeDotDotRelative.Count != mbmb.ItemsCount) { mbmb.FilesMarkedDotDotRelative = EditorData.EditorProperties.FilesToMakeDotDotRelative; GuiManager.AddDominantWindow(mbmb); } else { PerformSave(null); } }
private void DeleteEmitterClick(FlatRedBall.Gui.Window callingWindow) { EditorData.EditorLogic.DeleteCurrentEmitter(); }