public static void LoadSetFileWindowOk(Window callingWindow) { string fileName = ((FileWindow)callingWindow).Results[0]; #region Load the file to the mInstructionSetSaveList field - it may be stored off until the .scnx is found LastLoadInformation.LastInstructionSetLoaded = fileName; mInstructionSetSaveList = InstructionSetSaveList.FromFile(LastLoadInformation.LastInstructionSetLoaded); #endregion #region Load the properties file (.iepsx) if it exists string iepsxFileName = FileManager.RemoveExtension(fileName) + ".iepsx"; if (FileManager.FileExists(iepsxFileName)) { InstructionEditorPropertiesSave iepsx = InstructionEditorPropertiesSave.FromFile(iepsxFileName); iepsx.ApplyToEditor(); } #endregion // See if there is already a Blocking scene loaded if (EditorData.BlockingScene == null || string.IsNullOrEmpty(EditorData.BlockingScene.Name)) { OkCancelWindow okCancelWindow = GuiManager.ShowOkCancelWindow("There is no blocking scene currently loaded. Attempt to load the scene " + "referenced by the loaded Instruction Set?", "No Scene Loaded"); okCancelWindow.OkClick += LoadBlockingFromLoadedInstructionSet; } else { AddCurrentlyLoadedInstructionSet(); } /* * #region blueprint Sprites already loaded * if(GuiData.ListBoxWindow.BlueprintSpriteListBox.Count != 0) * { * CreateActiveSpritesFromIss(); * TimeLineMessages.ToStartPushed(null); * * } #endregion * #region blueprint Sprites not already loaded * else * { * MultiButtonMessageBox mbmb = GuiManager.AddMultiButtonMessageBox(); * mbmb.Name = "No Blueprints Loaded"; * mbmb.Text = ((FileWindow)callingWindow).result[0] + " instruction set requires active Sprites to be loaded. What would you like to do?"; * * mbmb.AddButton("Manually search for .scnx file.", new GuiMessage(LoadActiveSceneClick)); * * // mbmb.AddButton("Automatically search for .scn with Sprites matching instructions.", new GuiMessage(AutoSearchScn)); * } #endregion */ }
public static void SaveSetFileWindowOk(Window callingWindow) { string fileName = ((FileWindow)callingWindow).Results[0]; #region Save the istx InstructionSetSaveList instructionSetSaveList = new FlatRedBall.Content.Instructions.InstructionSetSaveList(); if (EditorData.BlockingScene == null) { GuiManager.ShowMessageBox("There is no scene loaded. A scene must be loaded for the .istx to reference.", "Error saving"); } else { foreach (AnimationSequence animationSequence in EditorData.GlobalInstructionSets) { AnimationSequenceSave sequenceSave = AnimationSequenceSave.FromAnimationSequence(animationSequence); instructionSetSaveList.AnimationSequenceSaves.Add(sequenceSave); //AddSetToSave(instructionSet, instructionSetSaveList, ""); // TODO: } foreach (KeyValuePair <INameable, InstructionSet> kvp in EditorData.ObjectInstructionSets) { AddSetToSave(kvp.Value, instructionSetSaveList, kvp.Key.Name); } instructionSetSaveList.SceneFileName = EditorData.BlockingScene.Name; instructionSetSaveList.Save(fileName); } #endregion #region Save the iepsx file fileName = FileManager.RemoveExtension(fileName) + ".iepsx"; InstructionEditorPropertiesSave ieps = InstructionEditorPropertiesSave.FromEditorData(); ieps.Save(fileName); #endregion }