Ejemplo n.º 1
0
 public void Save(bool SaveAsMode = false, string SaveAsFilePath = "")
 {
     try
     {
         if (StageStamps != null)
         {
             StageStamps.StampList = StageStamps.GetNormalStamps();
             if (StageStamps?.loadstate == RSDKv5.Stamps.LoadState.Upgrade)
             {
                 string message = "This Editor Chunk File needs to be updated to a newer version of the format. This will happen almost instantly, however you will be unable to use your chunks in a previous version of maniac on this is done. Would you like to continue?" + Environment.NewLine + "(Click Yes to Save, Click No to Continue without Saving Your Chunks)";
                 string tile    = "Chunk File Format Upgrade Required";
                 System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show(message, tile, System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Warning);
                 if (result != System.Windows.MessageBoxResult.Yes)
                 {
                     return;
                 }
             }
             if (SaveAsMode)
             {
                 StageStamps?.Write(SaveAsFilePath);
                 Methods.Solution.SolutionPaths.Stamps_Source = new Methods.Solution.SolutionPaths.FileSource(-3, SaveAsFilePath);
             }
             else
             {
                 if (Methods.Solution.SolutionState.Main.DataDirectoryReadOnlyMode && Methods.Solution.SolutionPaths.Stamps_Source.SourceID == -1)
                 {
                     return;
                 }
                 else
                 {
                     StageStamps?.Write(ManiacEditor.Methods.Solution.SolutionPaths.Stamps_Source.SourcePath);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Methods.Internal.Common.ShowError($@"Failed to save StageStamps to file '{ManiacEditor.Methods.Solution.SolutionPaths.Stamps_Source.SourcePath}' Error: {ex.Message}");
     }
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     StageStamps.DisposeTextures();
 }